]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/41654 (ICE: in gimple_cond_get_ops_from_tree, at gimple.c...
authorRichard Guenther <rguenther@suse.de>
Sat, 10 Oct 2009 14:53:27 +0000 (14:53 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 10 Oct 2009 14:53:27 +0000 (14:53 +0000)
2009-10-10  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/41654
* tree-ssa-ifcombine.c (ifcombine_ifandif): Properly canonicalize
a cond expr before calling gimple_cond_set_condition_from_tree.
(ifcombine_iforif): Likewise.

* gfortran.fortran-torture/compile/pr41654.f90: New testcase.

From-SVN: r152620

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90 [new file with mode: 0644]
gcc/tree-ssa-ifcombine.c

index dd177c4ad0d101ef29faf6a2e76b5c1f51cb5a8d..947dd1f75c37682bdd7c06fe9325c4e5db582635 100644 (file)
@@ -1,3 +1,10 @@
+2009-10-10  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/41654
+       * tree-ssa-ifcombine.c (ifcombine_ifandif): Properly canonicalize
+       a cond expr before calling gimple_cond_set_condition_from_tree.
+       (ifcombine_iforif): Likewise.
+
 2009-10-09  Ian Lance Taylor  <iant@google.com>
 
        * configure.ac: Use AC_SEARCH_LIBS to find dlopen.
index 534d797e04dea4dcf42257a0958d5a4182408f4e..7bf174abf9470bf0f88ace2c9f101903f6149b7a 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-10  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/41654
+       * gfortran.fortran-torture/compile/pr41654.f90: New testcase.
+
 2009-10-09  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/cpp/ucn-1.C: New.
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90
new file mode 100644 (file)
index 0000000..aa61905
--- /dev/null
@@ -0,0 +1,15 @@
+SUBROUTINE SCANBUFR (LBUFRIGNOREERROR, LBOPRPRO, LLSPLIT)
+LOGICAL :: LBUFRIGNOREERROR, LBOPRPRO, LLSPLIT
+INTEGER :: IBOTYP, IBSTYP
+IF ((IBOTYP.eq.0).AND.(IBSTYP.eq.1)) GO TO 251
+IF ((IBOTYP.eq.0).AND.(IBSTYP.eq.3)) GO TO 251
+IF(LBUFRIGNOREERROR) THEN
+ goto 360
+ENDIF
+251  CONTINUE
+IF(LBOPRPRO.AND.LLSPLIT) THEN
+  CALL OBSCREEN
+ENDIF
+360 CONTINUE
+END SUBROUTINE SCANBUFR
+
index 1d2d85b7a8f6e21c12630820306e7d457b47b4ca..335b4fd95fcc627ee46689940f0298116e44b03a 100644 (file)
@@ -340,6 +340,9 @@ ifcombine_ifandif (basic_block inner_cond_bb, basic_block outer_cond_bb)
       t2 = force_gimple_operand_gsi (&gsi, t2, true, NULL_TREE,
                                     true, GSI_SAME_STMT);
       t = fold_build2 (EQ_EXPR, boolean_type_node, t2, t);
+      t = canonicalize_cond_expr_cond (t);
+      if (!t)
+       return false;
       gimple_cond_set_condition_from_tree (inner_cond, t);
       update_stmt (inner_cond);
 
@@ -488,6 +491,9 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
                                    true, GSI_SAME_STMT);
       t = fold_build2 (NE_EXPR, boolean_type_node, t,
                       build_int_cst (TREE_TYPE (t), 0));
+      t = canonicalize_cond_expr_cond (t);
+      if (!t)
+       return false;
       gimple_cond_set_condition_from_tree (inner_cond, t);
       update_stmt (inner_cond);