This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/24647] New: two copies of a constant in two different registers
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Nov 2005 01:15:13 -0000
- Subject: [Bug target/24647] New: two copies of a constant in two different registers
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take the following code:
int f(void)
{
static int i;
int i1;
i1 = i;
if (i1 == 0)
i = i1 = 2;
return i1;
}
----
Currently we generate:
f:
movl i.1285, %eax
pushl %ebp
movl %esp, %ebp
testl %eax, %eax
jne .L7
movl $2, %ecx
movl $2, %eax
movl %ecx, i.1285
.L7:
popl %ebp
ret
Why is 2 in two different registers (I think the issue here is really a target
issue)? But should postreload CSE detect this or postreload GCSE?
--
Summary: two copies of a constant in two different registers
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24647