re PR tree-optimization/57200 (aggressive-loop-optimizations notes appear even when...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 8 May 2013 09:09:52 +0000 (09:09 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 8 May 2013 09:09:52 +0000 (09:09 +0000)
2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>

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
gcc/tree-ssa-loop-niter.c

index 2cb6a745fbc00e053c288536799bb63ea3f367ef..ea0b5b44c5d2cafd483f68ec269c561ade802ee9 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       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  <shenhan@google.com>
 
        * cfgexpand.c (record_or_union_type_has_array_p): New function.
index bcd4317f39048f0a1d6cee160e70551ad27176f0..090e114c36d89c24ff14502e8f6fb096e471bf07 100644 (file)
@@ -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;
 }