------- Comment #12 from manu at gcc dot gnu dot org 2008-08-19 02:33 -------
The key difference is -ftree-vrp (which is enabled at -O2). With INIT=2, it is
missing the obvious optimization that it detects with INIT=1. I wonder if this
is expected (after all, it is value-RANGE-propagation) or there is a PR open
about this.
Notice that any two consecutive integers trigger the optimization 0,1 but also
1,2 and thus remove the bogus uninitialized warning.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|bogus uninitialized warning |bogus uninitialized warning
|(loop representation) |(loop representation, VRP
| |missed-optimization)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36296