===================================================================
@@ -1594,7 +1639,7 @@ (define_operator_list CBRT BUILT_IN_CBRT
tree tem = const_binop (op == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR,
TREE_TYPE (@1), @2, @1);
}
- (if (!TREE_OVERFLOW (tem))
+ (if (tem && !TREE_OVERFLOW (tem))
(cmp @0 { tem; }))))))
/* Likewise, we can simplify a comparison of a real constant with
@@ -1605,7 +1650,7 @@ (define_operator_list CBRT BUILT_IN_CBRT
(simplify
(cmp (minus REAL_CST@0 @1) REAL_CST@2)
(with { tree tem = const_binop (MINUS_EXPR, TREE_TYPE (@1), @0, @2); }
- (if (!TREE_OVERFLOW (tem))
+ (if (tem && !TREE_OVERFLOW (tem))
(cmp { tem; } @1)))))
/* Fold comparisons against built-in math functions. */
===================================================================
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-frounding-math -funsafe-math-optimizations" } */
+
+int test ()
+{
+ return 5.0 < 5.0 - 0.1;
+}