------- 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. */ ---------------------------- Makes it work, Now I am not going to say this is the "correct" fix or not. What I am going to say, this is the most logical fix in that we know one iv can not overflow does not mean all will not. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |spop at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26304