------- Comment #11 from jakub at gcc dot gnu dot org 2008-04-24 09:33 -------
extern void abort (void);
int g[48][3][3];
void __attribute__ ((noinline))
bar (int x[3][3], int y[3][3])
{
static int i;
if (x != g[i + 8] || y != g[i++])
abort ();
}
static inline void __attribute__ ((always_inline))
foo (int x[][3][3])
{
int i;
for (i = 0; i < 8; i++)
#ifdef GOOD
bar (x[i + 8], x[i]);
#else
{
int k = i + 8;
bar (x[k], x[k - 8]);
}
#endif
}
int
main ()
{
foo (g);
return 0;
}
with -DGOOD doesn't fail at any optimization level, without it fails again with
-O2 -funroll-loops, -O3 etc.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36008