diff options
author | Richard Guenther <rguenther@suse.de> | 2009-10-10 14:53:27 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-10-10 14:53:27 +0000 |
commit | 740bb6ad8f28b53201c9d0a3d0849068c5d414e4 (patch) | |
tree | f61162308417f730044161c62446557cddff40bf /gcc/tree-ssa-ifcombine.c | |
parent | fdfea49e45f7aee01a4fa17075803a57e02b9aac (diff) | |
download | gcc-740bb6ad8f28b53201c9d0a3d0849068c5d414e4.tar.gz |
re PR tree-optimization/41654 (ICE: in gimple_cond_get_ops_from_tree, at gimple.c:417)
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
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r-- | gcc/tree-ssa-ifcombine.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c index 1d2d85b7a8f..335b4fd95fc 100644 --- a/gcc/tree-ssa-ifcombine.c +++ b/gcc/tree-ssa-ifcombine.c @@ -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); |