[Bug tree-optimization/45397] [4.5/4.6/4.7/4.8 Regression] Issues with integer narrowing conversions

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 2 09:37:00 GMT 2012


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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-02 09:36:52 UTC ---
Another testcase (lightly based on PR50182), -O3 -mavx:

signed char a[1024], b[1024];

void
foo (void)
{
  int i, s, t;
  for (i = 0; i < 1024; i++)
    { s = a[i]; t = b[i]; s += t; a[i] = s; }
}

void
bar (void)
{
  int i;
  for (i = 0; i < 1024; i++)
    a[i] += b[i];
}

shows terrible code for the first loop and nice for the second one, eventhough
both can be implemented as the second loop.



More information about the Gcc-bugs mailing list