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]
Other format: [Raw text]

[Bug middle-end/64491] [5 Regression] incorrect warning: loop exit may only be reached after undefined behavior


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.


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