re PR c++/53050 (ssa_forward_propagate_and_combine: segmentation fault)
authorRichard Guenther <rguenther@suse.de>
Fri, 20 Apr 2012 10:17:46 +0000 (10:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 20 Apr 2012 10:17:46 +0000 (10:17 +0000)
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.

From-SVN: r186620

gcc/ChangeLog
gcc/tree-ssa-forwprop.c

index 4c8825d59cd5ac30ae29fb2e19d19bda816ab684..f1d9799aa30216c3a1af77fbbb9f940359cd5952 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2012-04-19  Jan Hubicka  <jh@suse.cz>
 
        * symtab.c (dump_symtab_base): Revert accidental checkin.
index 3e2371bc83ca513d9527087e1e81da7c7d6ca9a9..965f44150e613a86df82700f11b93700eab7c81a 100644 (file)
@@ -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)
                  {