This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/64491] [5 Regression] incorrect warning: loop exit may only be reached after undefined behavior
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Feb 2015 16:28:26 +0000
- Subject: [Bug middle-end/64491] [5 Regression] incorrect warning: loop exit may only be reached after undefined behavior
- Auto-submitted: auto-generated
- References: <bug-64491-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64491
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Andrew Stubbs from comment #8)
> Just silencing the warning may not be enough. The compiler may optimize away
> loop exit conditions based on this analysis. The warning mirrors the logic
> rather than shares it (due to the way the logic is distributed) so this may
> not actually be a problem, in this case, but I'd have to look closer.
Sure, it is desirable if the compiler optimizes away the loop exit test, it
really is dead, because the loop will always be exit through the other loop
exit earlier. But there is no user bug in there, so you shouldn't emit a false
positive.