http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45122

--- Comment #16 from Zdenek Dvorak <rakdver at gcc dot gnu.org> 2011-02-01 
11:27:13 UTC ---
(In reply to comment #15)
> Ah, the reason why pr19210-* fail is that those loops have non-const/pure call
> in it.  So, while single_exit (loop) == exit, loop_only_exit_p (loop, exit)
> still returns false.
> So, the question is if we really need to give up on 
> -funsafe-loop-optimizations
> whenever loop_only_exit_p (loop, exit), or if a single_exit (loop) == exit
> test would be sufficient for that.

I believe single_exit (loop) test would sufficiently match the expectations of
-funsafe-loop-optimizations.  This would misscompile code like

while (b)
  {
    foo(b);
    b -= 8;
  }

in the case that b is not divisible by 8, on the assumption that there are no
nontrivial infinite loops; which seems reasonable.

Reply via email to