On Wed, Oct 31, 2012 at 3:39 AM, Jan Hubicka <hubi...@ucw.cz> wrote: > Hi, > this patch implements the logic to remove statements that are known to be > undefined and thus expected to not be executed after unrolling. It also > removes redundant exits that I originally tried to do at once, but it > does not fly, since the peeling confuse number_of_iterations_exit > and it no longer understands the ivs. > > So now we > 1) always remove exits that are known to be redundant by the bounds found > 2) try to peel/unroll > 3) if success remove statemnts from the last iteration > > This silence the array-bounds warnings in my testcase and many cases of > -O3 bootstrap (I am running it now). > Still if one construct testcase touching out of bound in more than one > iteration we will produce false warning, I will do that incrementally > by similar logic in loop copying. > > Bootstrapped/regtested x86_64-linux, OK? > > Honza > > * tree-ssa-loop-niter.c (free_loop_bounds): Break out from ... > (free_numbers_of_iterations_estimates_loop): ... here. > * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): New > function. > (remove_redundant_iv_test): New function. > (try_unroll_loop_completely): Pass in MAXITER; use > remove_exits_and_undefined_stmts > (canonicalize_loop_induction_variables): Compute MAXITER; > use remove_redundant_iv_test. > * cfgloop.h (free_loop_bounds): New function. > > * gcc.dg/tree-ssa/cunroll-10.c: New testcase. > * gcc.dg/tree-ssa/cunroll-9.c: New testcase.
This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55555 -- H.J.