aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.dg/pr92115.c10
-rw-r--r--gcc/tree-ssa-ifcombine.c6
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index afe0d29..5fccbd4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-10-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/92115
+ * tree-ssa-ifcombine.c (ifcombine_ifandif): Force condition into
+ temporary if it could trap.
+
2019-10-17 Richard Biener <rguenther@suse.de>
PR debug/91887
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e23272a..c79ba7b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2019-10-17 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/92115
+ * gcc.dg/pr92115.c: New test.
+
PR fortran/87752
* gfortran.dg/gomp/pr87752.f90: New test.
diff --git a/gcc/testsuite/gcc.dg/pr92115.c b/gcc/testsuite/gcc.dg/pr92115.c
new file mode 100644
index 0000000..ae506d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr92115.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/92115 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fexceptions -ffinite-math-only -fnon-call-exceptions -fsignaling-nans -fno-signed-zeros" } */
+
+void
+foo (double x)
+{
+ if (x == 0.0 && !__builtin_signbit (x))
+ __builtin_abort ();
+}
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);