This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/37096] conditional evaluation incorrect with -O3
- From: "erik dot moller at cycos dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Aug 2008 16:22:23 -0000
- Subject: [Bug middle-end/37096] conditional evaluation incorrect with -O3
- References: <bug-37096-16590@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from erik dot moller at cycos dot com 2008-08-18 16:22 -------
the printf("shouldn't happen: %d\n", pAR[0]) happens when debug flags -O2 or
-O3 and -msse2 are set.
the printf("nz: %d\n", nZ); seems to do something awful...
void fun(short *pAR)
{
const short tmp = Transform4x4(pAR);
pAR[0] = 0;
int nZ = 0;
for( int i=0; i<4 ; ++i )
if ( pAR[i] ) {
++nZ;
}
printf("nz: %d\n", nZ);
if ( pAR[0] )
printf("shouldn't happen: %d\n", pAR[0]);
pAR[0] = tmp;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37096