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 middle-end/36691] [4.2/4.3/4.4 Regression] wrong value left in induction variable



------- Comment #6 from rguenth at gcc dot gnu dot org  2008-08-04 13:00 -------
Slightly differently "worded" the testcase is

unsigned int g_5;

void func_1 (void)
{
  for (g_5 = 9; g_5 >= 4; g_5 -= 5)
    ;
}

extern void abort (void);
int main (void)
{
  func_1 ();
  if (g_5 != 0)
    abort ();
  return 0;
}

so the loop wraps once (9, 4, UINT_MAX, ..., 5, 0).

>From the scev-cprop dump we see that the number of iterations is wrong:

Analyzing # of iterations of loop 1
  exit condition 3 < [4, + , 4294967291]
  bounds on difference of bases: 1 ... 1
  result:
    # of iterations 1, bounded by 1
  (set_nb_iterations_in_loop = 1))


-- 


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


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