Weird optimization bug...?

Ian Lance Taylor ian@wasabisystems.com
Fri Jun 4 03:00:00 GMT 2004


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