From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26818 invoked by alias); 27 Jan 2005 01:36:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26461 invoked by uid 48); 27 Jan 2005 01:36:18 -0000 Date: Thu, 27 Jan 2005 01:36:00 -0000 Message-ID: <20050127013618.26460.qmail@sourceware.org> From: "steven at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040909235415.17387.hjl@lucon.org> References: <20040909235415.17387.hjl@lucon.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug rtl-optimization/17387] Redundant instructions in loop optimization X-Bugzilla-Reason: CC X-SW-Source: 2005-01/txt/msg03965.txt.bz2 List-Id: ------- 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