[LLVMbugs] [Bug 8671] New: Incorrect code generation using opt for arch x86

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 23 05:57:14 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=8671

           Summary: Incorrect code generation using opt for arch x86
           Product: tools
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: babslachem at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Use attached dumbret.ll file and generate dumbret as follows:

llc -march=x86 -O2 dumbret.ll -o dumbret.s
gcc -m32 dumbret.s -o dumbret

launch dumbret exec:
./dumbret

You should get following output:
114 15 7345

Now use opt on this file as follows:

opt dumbret.ll -disable-inlining -realign-stack -O2 -S -o dumbret.oll
llc -march=x86 -O2 dumbret.oll -o odumbret.s

gcc -m32 odumbret.s -o odumbret

launch odumbret exec:
./odumbret

You should get a SEGFAULT.

Now look at generated code for odumbret before call to retzerosec:

...
    movsd    24, %xmm0
    movsd    %xmm0, 28(%esp)
    movsd    16, %xmm0
    movsd    %xmm0, 20(%esp)
    movsd    0, %xmm0
    movsd    8, %xmm1
    movsd    %xmm1, 12(%esp)
    movsd    %xmm0, 4(%esp)
    leal    40(%esp), %ecx
    movl    %ecx, (%esp)
    call    retzerosec
...

I guess what should be generated is something like:

    movsd    $24, %xmm0

instead of 

    movsd    24, %xmm0

Moreover, instruction movsd $24, %xmm0 doesn't exists.
So something different should be generated to move value 24 into xmm0 reg,
instead of trying to move what's at address 24 into xmm0.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list