diff mbox

Don't warn with -Waggressive-loop-optimizations multiple times about the same loop (PR middle-end/59561)

Message ID 20140124211433.GY892@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Jan. 24, 2014, 9:14 p.m. UTC
Hi!

When a loop is duplicated, inlined etc. and we've already warned
about undefined behavior in it, it is undesirable to warn again.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2014-01-22  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/59561
	* cfgloopmanip.c (copy_loop_info): If
	loop->warned_aggressive_loop_optimizations, make sure
	the flag is set in target loop too.


	Jakub

Comments

Jeff Law Jan. 24, 2014, 10:56 p.m. UTC | #1
On 01/24/14 14:14, Jakub Jelinek wrote:
> Hi!
>
> When a loop is duplicated, inlined etc. and we've already warned
> about undefined behavior in it, it is undesirable to warn again.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2014-01-22  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR middle-end/59561
> 	* cfgloopmanip.c (copy_loop_info): If
> 	loop->warned_aggressive_loop_optimizations, make sure
> 	the flag is set in target loop too.
>
> --- gcc/cfgloopmanip.c.jj	2014-01-03 11:40:33.000000000 +0100
> +++ gcc/cfgloopmanip.c	2014-01-22 10:21:54.057871045 +0100
> @@ -1022,6 +1022,8 @@ copy_loop_info (struct loop *loop, struc
>     target->any_estimate = loop->any_estimate;
>     target->nb_iterations_estimate = loop->nb_iterations_estimate;
>     target->estimate_state = loop->estimate_state;
> +  target->warned_aggressive_loop_optimizations
> +    |= loop->warned_aggressive_loop_optimizations;
OK.

jeff
diff mbox

Patch

--- gcc/cfgloopmanip.c.jj	2014-01-03 11:40:33.000000000 +0100
+++ gcc/cfgloopmanip.c	2014-01-22 10:21:54.057871045 +0100
@@ -1022,6 +1022,8 @@  copy_loop_info (struct loop *loop, struc
   target->any_estimate = loop->any_estimate;
   target->nb_iterations_estimate = loop->nb_iterations_estimate;
   target->estimate_state = loop->estimate_state;
+  target->warned_aggressive_loop_optimizations
+    |= loop->warned_aggressive_loop_optimizations;
 }
 
 /* Copies copy of LOOP as subloop of TARGET loop, placing newly