This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: optimization/3384: PowerPC -funroll-loops -fbranch-count-reg misoptimization


Zoltan Hidvegi <hzoli@hzoli.2y.net> writes:

...
> Thanks for looking at that, but could you please consider the patch in
> http://gcc.gnu.org/ml/gcc-patches/2001-07/msg01080.html in favor of this
> one?  This improves a tiny bit on normal non-unrolled loops, and it has
> some comments.  Also I forgot to remove some misleanding comments in that
> patch, so I attach below a comment-only patch that should be applied
> after http://gcc.gnu.org/ml/gcc-patches/2001-07/msg01080.html.
> 
> Also note that there is still a bug here, that is not new:
> 
> main(){unsigned int i; for (i = ~0-39; i < ~0u-1; i += 4);}
> 
> This is an infinite loop, but it quits when compiled with -O2.  It would
> be easy to fix for the constant limit case, actually I have some hack for
> that, but for the variable final value case that would require extra
> run-time checks for every loop even if they would never overflow, and the
> standard behavior is undefined anyways, so it probably does not worth
> fixing it (that was that way even in 2.95).

Your patches are in my queue (and have been for some time).  I hope to
get to them very soon.

The infinite loop above seems to be strictly conforming C, except that
it should be '~0u'; does it still fail with this change?  If so,
please file a GNATS bug report so the issue doesn't get lost.  I
wonder if there's any way to write a dejagnu test for this case?

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]