[LLVMdev] New Problem: llc -O0: Broken module found, compilation aborted!
Eli Friedman
eli.friedman at gmail.com
Thu Jul 28 10:34:07 PDT 2011
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
More information about the llvm-dev
mailing list