------- Comment #19 from dberlin at gcc dot gnu dot org 2006-04-24 01:10 ------- Subject: Re: [4.2 Regression] 25_algorithms/prev_permutation/1.cc on powerpc{64,}-linux and powerpc-darwin
On Sun, 2006-04-23 at 23:14 +0000, pinskia at gcc dot gnu dot org wrote: > > ------- Comment #17 from pinskia at gcc dot gnu dot org 2006-04-23 23:14 > ------- > Rewritting that loop like: > [kudzu:local/trunk/gcc] pinskia% svn diff tree-ssa-loop-niter.c > Index: tree-ssa-loop-niter.c > =================================================================== > --- tree-ssa-loop-niter.c (revision 113199) > +++ tree-ssa-loop-niter.c (working copy) > @@ -1939,6 +1939,7 @@ scev_probably_wraps_p (tree type, tree b > tree unsigned_type, valid_niter; > tree base_plus_step, bpsps; > int cps, cpsps; > + bool known_not_to_wrap; > > /* FIXME: The following code will not be used anymore once > http://gcc.gnu.org/ml/gcc-patches/2005-06/msg02025.html is > @@ -2077,8 +2078,10 @@ scev_probably_wraps_p (tree type, tree b > > estimate_numbers_of_iterations_loop (loop); > for (bound = loop->bounds; bound; bound = bound->next) > - if (proved_non_wrapping_p (at_stmt, bound, type, valid_niter)) > - return false; > + if (!proved_non_wrapping_p (at_stmt, bound, type, valid_niter)) > + known_not_to_wrap = false; > + if (known_not_to_wrap) > + return false; > > /* At this point we still don't have a proof that the iv does not > overflow: give up. */ > known_to_wrap may be uninitialized at the if statement here. You need to init it to true. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26304