This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/19945] New: [4.0 Regression] inefficient store of constant into a global register
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Feb 2005 00:18:19 -0000
- Subject: [Bug c/19945] New: [4.0 Regression] inefficient store of constant into a global register
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
----------------------------
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