------- Comment #3 from rguenth at gcc dot gnu dot org 2009-06-20 16:43 ------- My guess is that this is the number-of-iteration code which tries to use predicate information (that is obviously available a lot with -fbounds-check). At -O1 we do not do value-range propagation, so practically all of the -fbounds-check tests remain.
Which leads to my recommendation to _not_ enable -fbounds-check without also enabling value-range propagation. What we could do is limit the walking of the predicates a lot more at -O1. Another candidate is find_loop_niter_by_eval as loops with bound checks have a lot of exits. We could limit that to flag_expensive_optimizations. Or we can simply enable VRP at -O1, possibly without tracking symbolic ranges and equivalences (which is the most expensive parts here). -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2009-06-20 16:43:34 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38729