On Thu, Nov 20, 2014 at 05:27:35PM +0100, Richard Biener wrote: > On Wed, Nov 19, 2014 at 9:19 PM, Andrew Stubbs <a...@codesourcery.com> wrote: > > On 19/11/14 16:39, Marek Polacek wrote: > >> > >> On Wed, Nov 19, 2014 at 04:32:43PM +0000, Andrew Stubbs wrote: > >>> > >>> + if (warning_at (gimple_location (elt->stmt), > >>> + OPT_Waggressive_loop_optimizations, > >>> + "Loop exit may only be reached after > >>> undefined behaviour.")) > >> > >> > >> Warnings should start with a lowercase and should be without > >> a fullstop at the end. > > > > > > Fixed, and I spotted a britishism too. > > If it's really duplicated code can you split it out to a function? > > + if (OPT_Waggressive_loop_optimizations) > + { > > this doesn't do what you think it does ;) The variable to check is > warn_aggressive_loop_optimizations. > > + if (exit_warned && problem_stmts != vNULL) > + { > > !problem_stmts.empty () > > Otherwise it looks ok.
This caused PR64491. If the loop has multiple exits, the loop might be exit earlier and so it would be just fine if the other loop exit may only be reached after undefined behavior. Jakub