[Bug tree-optimization/53265] Warn when undefined behavior implies smaller iteration count

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 12 21:48:00 GMT 2013


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

--- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-12 21:47:38 UTC ---
Short C testcase reproducing the exp_ch7.adb issue (for -O2):
void bar (int);

__attribute__((noinline)) static int
foo (int x)
{
  int i = 1;
  if (x > 1)
    do
      bar (i);
    while (++i != x);
}

void
baz (void)
{
  foo (1);
  foo (1);
  foo (1);
}



More information about the Gcc-bugs mailing list