[LLVMdev] Miscompilation

Sanghyeon Seo sanxiyn at gmail.com
Thu Dec 13 04:54:43 PST 2007


I reduced the above case to this:

; test.ll
define i8* @test() {
%x1 = malloc i8, i32 16
%x2 = bitcast i8* %x1 to i8**
store i8* %x1, i8** %x2
ret i8* %x1

$ llvm-as test.ll
$ opt -instcombine test.bc -o testopt.bc
$ llc test.bc
$ llc testopt.bc
$ diff -u test.s testopt.s
-movl $16, (%esp)
+movl $8, (%esp)
 call malloc

I'm afraid that I'm not up to fixing this myself. Please help!

Seo Sanghyeon

More information about the llvm-dev mailing list