Patchwork [obvious] PR 57200

login
register
mail settings
Submitter Paolo Carlini
Date May 8, 2013, 8:56 a.m.
Message ID <518A1343.5020306@oracle.com>
Download mbox | patch
Permalink /patch/242525/
State New
Headers show

Comments

Paolo Carlini - May 8, 2013, 8:56 a.m.
Hi,

I personally consider the fix for this this issue obvious: barring 
objections I mean to commit it mainline and branch later today.

Thanks,
Paolo.

///////////////////////
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.
Jakub Jelinek - May 8, 2013, 11:23 a.m.
On Wed, May 08, 2013 at 10:56:35AM +0200, Paolo Carlini wrote:
> I personally consider the fix for this this issue obvious: barring
> objections I mean to commit it mainline and branch later today.
> 
> Thanks,
> Paolo.
> 
> ///////////////////////

> 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.

Ok, thanks.

	Jakub

Patch

Index: tree-ssa-loop-niter.c
===================================================================
--- tree-ssa-loop-niter.c	(revision 198703)
+++ tree-ssa-loop-niter.c	(working copy)
@@ -2553,10 +2553,11 @@  do_warn_aggressive_loop_optimizations (struct 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;
 }