This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/26587] [4.1 Regression] strict aliasing incorrectly pre-loads an array element with loops
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2006 10:12:47 -0000
- Subject: [Bug rtl-optimization/26587] [4.1 Regression] strict aliasing incorrectly pre-loads an array element with loops
- References: <bug-26587-12319@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from rguenth at gcc dot gnu dot org 2006-03-07 10:12 -------
Umm, that has uninitialized vars. The following is ok wrt -Wall -Werror:
extern int printf(const char *, ...);
typedef unsigned int BF_word;
typedef BF_word BF_key[16 + 2];
static struct {
BF_key P;
} BF_current;
int main(void)
{
BF_word L;
BF_word tmp4, *ptr;
BF_word i;
for (i = 0; i < 16 + 2; i++)
BF_current.P[i] = i * 0x98765432;
L = 0;
ptr = BF_current.P;
do {
ptr += 2;
L ^= BF_current.P[0];
tmp4 = L >> 24;
L = tmp4 ^ BF_current.P[16 + 1];
*(ptr - 2) = L;
} while (ptr < &BF_current.P[16 + 2]);
printf("%08x\n", L);
return 0;
}
and prints 1fdb9752 vs. 1fdb974d.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26587