This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/48774] [4.6/4.7 Regression] gcc-4.6.0 optimization regression on x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48774

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-02 08:52:44 UTC ---
unsigned long int s[12][2]
  = { { 12, ~1 }, { 12, ~2 }, { 12, ~4 }, { 12, ~8 },
      { 12, ~16 }, { 12, ~32 }, { 12, ~64 }, { 12, ~128 },
      { 12, ~256 }, { 12, ~512 }, { 12, ~1024 }, { 12, ~2048 } };
struct { int n; unsigned long *e[12]; } g
  = { 12, { &s[0][1], &s[1][1], &s[2][1], &s[3][1],
    &s[4][1], &s[5][1], &s[6][1], &s[7][1],
    &s[8][1], &s[9][1], &s[10][1], &s[11][1] } };

int
main ()
{
  int i, j, c[12];
  for (i = 0; i < 12; i++)
    c[i] = 0;
  for (i = 0; i < g.n; i++)
    for (j = 0; j < g.n; j++)
      {
        if (i == j && j < g.e[0][-1] && (g.e[i][0] & (1UL << j)))
          __builtin_exit (0);
        if (j < g.e[0][-1] && (g.e[i][0] & (1UL << j)))
          c[i]++;
      }
  for (i = 0; i < 12; i++)
    if (c[i] != 11)
      __builtin_abort ();
  return 0;
}

Slightly more reduced.  This one shows clearly on which iteration of the inner
unrolled loop there is some problem, as c during abort is { 10, 11, 10 ... },
which means & 1 testing is performed, & 2 is wrong and & 4 and higher works
too.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]