Xueying ZHANG
2011-Jul-28 17:23 UTC
[LLVMdev] New Problem: llc -O0: Broken module found, compilation aborted!
Hi all, Here is my problem, overflow.c: int main() { return 0; } $ clang -c -fstack-protector-all overflow.c -emit-llvm overflow.bc $ llc -O0 overflow.bc The result seems like the Bug 9259 which had been fixed (r126812). But I find I still have the problem below: Both operands to a binary operator are not of the same type! %aaa = xor i8* %"Call Return Address", i32 1892499360 Instruction does not dominate all uses! %aaa = xor i8* %"Call Return Address", i32 1892499360 call void @llvm.stackprotector(i8* %aaa, i8** %StackGuardSlot) Logical operators only work with integral types! %abbaa = xor i8* %2, %"Call the return address" Both operands to ICmp instruction are not of the same type! %3 = icmp eq i32 1892499360, i8* %abbaa Instruction does not dominate all uses! %3 = icmp eq i32 1892499360, i8* %abbaa br i1 %3, label %SP_return, label %CallStackCheckFailBlk Broken module found, compilation aborted! 0 llc 0x087b2328 Stack dump: 0. Program arguments: llc -O0 overflow.bc 1. Running pass 'Function Pass Manager' on module 'overflow.bc'. 2. Running pass 'Module Verifier' on function '@main' Aborted How can I solve this problem? Thank you Ying -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
Eli Friedman
2011-Jul-28 17:34 UTC
[LLVMdev] New Problem: llc -O0: Broken module found, compilation aborted!
On Thu, Jul 28, 2011 at 10:23 AM, Xueying ZHANG <s1031770 at sms.ed.ac.uk> wrote:> Hi all, > Here is my problem, > > overflow.c: > > int main() > { > return 0; > } > > > $ clang -c -fstack-protector-all overflow.c -emit-llvm overflow.bc > $ llc -O0 overflow.bc > > The result seems like the Bug 9259 which had been fixed (r126812). But > I find I still have the problem below: > > Both operands to a binary operator are not of the same type! > %aaa = xor i8* %"Call Return Address", i32 1892499360 > Instruction does not dominate all uses! > %aaa = xor i8* %"Call Return Address", i32 1892499360 > call void @llvm.stackprotector(i8* %aaa, i8** %StackGuardSlot) > Logical operators only work with integral types! > %abbaa = xor i8* %2, %"Call the return address" > Both operands to ICmp instruction are not of the same type! > %3 = icmp eq i32 1892499360, i8* %abbaa > Instruction does not dominate all uses! > %3 = icmp eq i32 1892499360, i8* %abbaa > br i1 %3, label %SP_return, label %CallStackCheckFailBlk > Broken module found, compilation aborted! > 0 llc 0x087b2328 > Stack dump: > 0. Program arguments: llc -O0 overflow.bc > 1. Running pass 'Function Pass Manager' on module 'overflow.bc'. > 2. Running pass 'Module Verifier' on function '@main' > Aborted > > How can I solve this problem?You're generating invalid IR. For development, I'd suggest using a build with assertions turned on, which will catch this earlier. -Eli
Reasonably Related Threads
- [LLVMdev] Is va_arg correct on Mips backend?
- [LLVMdev] Is va_arg correct on Mips backend?
- [LLVMdev] Is va_arg correct on Mips backend?
- [LLVMdev] Is va_arg correct on Mips backend?
- Difference between clang -O1 -Xclang -disable-O0-optnone and clang -O0 -Xclang -disable-O0-optnone in LLVM 9