]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/50780 (ICE: verify_gimple failed: invalid operands in ternary...
authorRichard Guenther <rguenther@suse.de>
Wed, 19 Oct 2011 14:54:34 +0000 (14:54 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 19 Oct 2011 14:54:34 +0000 (14:54 +0000)
2011-10-19  Richard Guenther  <rguenther@suse.de>

PR middle-end/50780
* tree-ssa-forwprop.c (forward_propagate_into_cond): Verify
the condition is properly gimple before using it.
* tree-eh (stmt_could_throw_1_p): Properly extract the
operation type from comparisons.

From-SVN: r180192

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

index 3eb106f78f230d0814d16c87f5e08116086f2f88..e9b48b60c590ca73277da81e5ee27429660babde 100644 (file)
@@ -1,3 +1,11 @@
+2011-10-19  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/50780
+       * tree-ssa-forwprop.c (forward_propagate_into_cond): Verify
+       the condition is properly gimple before using it.
+       * tree-eh (stmt_could_throw_1_p): Properly extract the
+       operation type from comparisons.
+
 2011-10-19  Roland Stigge  <stigge@antcom.de>
 
        PR translation/48638
index f751d8d98a2f8fffd5e9e77b0932616744d81ebc..c1896be228d2f87b13a3c01513416732325bd9e8 100644 (file)
@@ -2512,7 +2512,13 @@ stmt_could_throw_1_p (gimple stmt)
       || TREE_CODE_CLASS (code) == tcc_unary
       || TREE_CODE_CLASS (code) == tcc_binary)
     {
-      t = gimple_expr_type (stmt);
+      if (is_gimple_assign (stmt)
+         && TREE_CODE_CLASS (code) == tcc_comparison)
+       t = TREE_TYPE (gimple_assign_rhs1 (stmt));
+      else if (gimple_code (stmt) == GIMPLE_COND)
+       t = TREE_TYPE (gimple_cond_lhs (stmt));
+      else
+       t = gimple_expr_type (stmt);
       fp_operation = FLOAT_TYPE_P (t);
       if (fp_operation)
        {
index 1db93a65a65f434cf8ad6a42544306705652a9a2..d707db520e342a273d86082003770ca9dbf621f6 100644 (file)
@@ -597,7 +597,8 @@ forward_propagate_into_cond (gimple_stmt_iterator *gsi_p)
        }
     }
 
-  if (tmp)
+  if (tmp
+      && is_gimple_condexpr (tmp))
     {
       if (dump_file && tmp)
        {