Patchwork Fix PR53050

login
register
mail settings
Submitter Richard Guenther
Date April 20, 2012, 10:16 a.m.
Message ID <Pine.LNX.4.64.1204201216250.23071@jbgna.fhfr.qr>
Download mbox | patch
Permalink /patch/154001/
State New
Headers show

Comments

Richard Guenther - April 20, 2012, 10:16 a.m.
This fixes PR53050.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-04-20  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/53050
	* tree-ssa-forwprop.c (ssa_forward_propagate_and_combine):
	Do only one transform on COND_EXPRs at the same time.

Patch

Index: gcc/tree-ssa-forwprop.c
===================================================================
--- gcc/tree-ssa-forwprop.c	(revision 186611)
+++ gcc/tree-ssa-forwprop.c	(working copy)
@@ -2536,9 +2536,12 @@  ssa_forward_propagate_and_combine (void)
 			 || code == VEC_COND_EXPR)
 		  {
 		    /* In this case the entire COND_EXPR is in rhs1. */
-		    changed |= forward_propagate_into_cond (&gsi);
-		    changed |= combine_cond_exprs (&gsi);
-		    stmt = gsi_stmt (gsi);
+		    if (forward_propagate_into_cond (&gsi)
+			|| combine_cond_exprs (&gsi))
+		      {
+			changed = true;
+			stmt = gsi_stmt (gsi);
+		      }
 		  }
 		else if (TREE_CODE_CLASS (code) == tcc_comparison)
 		  {