From 44398cbede9597490250b2ed86c690f10eb41e4f Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 8 May 2013 09:09:52 +0000 Subject: [PATCH] re PR tree-optimization/57200 (aggressive-loop-optimizations notes appear even when warning itself is suppressed) 2013-05-08 Paolo Carlini PR tree-optimization/57200 * tree-ssa-loop-niter.c (do_warn_aggressive_loop_optimizations): Only call inform if the preceding warning_at returns true. From-SVN: r198704 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-loop-niter.c | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2cb6a745fbc..ea0b5b44c5d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-05-08 Paolo Carlini + + PR tree-optimization/57200 + * tree-ssa-loop-niter.c (do_warn_aggressive_loop_optimizations): + Only call inform if the preceding warning_at returns true. + 2013-05-07 Han Shen * cfgexpand.c (record_or_union_type_has_array_p): New function. diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index bcd4317f390..090e114c36d 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2553,10 +2553,11 @@ do_warn_aggressive_loop_optimizations (struct loop *loop, return; gimple estmt = last_stmt (e->src); - warning_at (gimple_location (stmt), OPT_Waggressive_loop_optimizations, - "iteration %E invokes undefined behavior", - double_int_to_tree (TREE_TYPE (loop->nb_iterations), i_bound)); - inform (gimple_location (estmt), "containing loop"); + if (warning_at (gimple_location (stmt), OPT_Waggressive_loop_optimizations, + "iteration %E invokes undefined behavior", + double_int_to_tree (TREE_TYPE (loop->nb_iterations), + i_bound))) + inform (gimple_location (estmt), "containing loop"); loop->warned_aggressive_loop_optimizations = true; } -- 2.30.2