This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/19945] New: [4.0 Regression] inefficient store of constant into a global register


----------------------------
int a;
void foo(void)
{
  a = 10;
}
----------------------------

when compiled with GCC 4.0 20050118, with -O2 -fomit-frame-pointer, generates 
the following code:

foo:
        movl    $10, %eax
        movl    %eax, a
        ret

Notice the unnecessary which wastes a register.  With 3.4, we get the expected 
code:

foo:
        movl    $10, a
        ret

-- 
           Summary: [4.0 Regression] inefficient store of constant into a
                    global register
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giovannibajo at libero dot it
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: x86-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19945


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]