aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ifcombine.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-10-17 09:20:36 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-10-17 09:20:36 +0200
commit432b4f729dff4808de4f3b00ff9b312db095afc3 (patch)
tree51b68b6aa67dcca39af95deb75de251b4af83bb5 /gcc/tree-ssa-ifcombine.c
parent62900598dfec3c26b203bb8847277db9f4c40ed2 (diff)
downloadgcc-432b4f729dff4808de4f3b00ff9b312db095afc3.zip
gcc-432b4f729dff4808de4f3b00ff9b312db095afc3.tar.gz
gcc-432b4f729dff4808de4f3b00ff9b312db095afc3.tar.bz2
re PR tree-optimization/92115 (ICE in gimple_cond_get_ops_from_tree, at gimple-expr.c:577)
PR tree-optimization/92115 * tree-ssa-ifcombine.c (ifcombine_ifandif): Force condition into temporary if it could trap. * gcc.dg/pr92115.c: New test. From-SVN: r277092
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r--gcc/tree-ssa-ifcombine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 90d8bb5..21c1b0e 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -599,6 +599,12 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool inner_inv,
t = canonicalize_cond_expr_cond (t);
if (!t)
return false;
+ if (!is_gimple_condexpr_for_cond (t))
+ {
+ gsi = gsi_for_stmt (inner_cond);
+ t = force_gimple_operand_gsi_1 (&gsi, t, is_gimple_condexpr_for_cond,
+ NULL, true, GSI_SAME_STMT);
+ }
gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);