Weird optimization bug...?

Adrian Bentley adruab@voria.com
Sat Jun 5 20:21:00 GMT 2004


Ok, it's posted (#15837).  Hope it helps.

Adruab

On Thu, 2004-06-03 at 19:59, Ian Lance Taylor wrote:
> Adrian Bentley <adruab@voria.com> writes:
> 
> > And I'm indirecting off of iter which is being incremented every
> > iteration.  But for some reason it looks like gcc decided to use the
> > original value of iter for the 10th iteration (1 greater than the value
> > for length my example is using) inside the sample case I have... (i.e.
> > rather than using the incremented value).  So it looks like it was
> > trying to optimize out an expression that wasn't constant (either in
> > attempting to optimize the first if statement out of the loop).  It
> > doesn't do this when I turn optimization off... so it definitely looks
> > like an optimizer bug.
> > 
> > Anyways, I'm not sure why it would do this as iter is being changed
> > every iteration.  Oh well, I'm gonna manually do some unrolling and
> > hopefully it won't break any more.  Hope that helps anyone interested in
> > the issue.
> 
> If you have time, please submit a bug report.  See
>     http://gcc.gnu.org/bugs.html
> 
> Thanks.
> 
> Ian
> 
> 



More information about the Gcc-help mailing list