This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/17387] Redundant instructions in loop optimization
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jan 2005 01:36:18 -0000
- Subject: [Bug rtl-optimization/17387] Redundant instructions in loop optimization
- References: <20040909235415.17387.hjl@lucon.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-27 01:36 -------
My first suspicion was the `register' keyword, but that's not it:
--------------------------------------------------
extern unsigned int S[];
extern unsigned int state[];
unsigned int
foo ()
{
unsigned int t;
int j;
t=0;
for (j=0; j<16; j+=4)
{
t = state[j + 0] ^= S[t];
t = state[j + 1] ^= S[t];
}
return t;
}
--------------------------------------------------
-->
--------------------------------------------------
foo:
.LFB2:
xorl %eax, %eax
movl $4, %ecx
movl $state, %edx
.p2align 4,,7
.L2:
mov %eax, %eax
movl S(,%rax,4), %eax
xorl (%rdx), %eax
movl %eax, (%rdx)
mov %eax, %eax <-- bah!
movl S(,%rax,4), %eax
xorl 4(%rdx), %eax
movl %eax, 4(%rdx)
addq $16, %rdx
decl %ecx
jne .L2
rep ; ret
.LFE2:
--------------------------------------------------
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17387