[LLVMbugs] [Bug 3326] New: missed optimization with -m32: empty functions shouldn' t contain push/mov/pop

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jan 15 01:25:30 PST 2009


           Summary: missed optimization with -m32: empty functions shouldn't
                    contain push/mov/pop
           Product: new-bugs
           Version: unspecified
          Platform: PC
               URL: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38854
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu

LLVM exhibits same missed optimization as gcc with -m32.

void noop(char* foo) {}

$ llvm-gcc -O2 x.c -S -m32
        pushl   %ebp
        movl    %esp, %ebp
        popl    %ebp

It shouldn't contain the push/mov/pop, and indeed without -m32 it doesn't:

However I can't reproduce this with
llvm-gcc -S -emit-llvm -m32 -O2 | llvm-as | llc -march=x86

I tried -mcpu=i486 too.

Is gcc still using LLVM for code generation with -m32?

What is special in llvm-gcc's invocation of the code generator?

Here is the bitcode, and llc correctly generates the code w/o push/mov/pop

target datalayout =
target triple = "i386-unknown-linux-gnu"

define void @noop(i8* nocapture %foo) nounwind readnone {
        ret void

Both llvm and llvm-gcc were compiled from same revision (r62238).

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