@@ -11856,14 +11856,16 @@ build_binary_op (location_t location, en
else if (TREE_CODE (ret) != INTEGER_CST && int_operands
&& !in_late_binary_op)
ret = note_integer_operands (ret);
- if (semantic_result_type)
- ret = build1 (EXCESS_PRECISION_EXPR, semantic_result_type, ret);
protected_set_expr_location (ret, location);
if (instrument_expr != NULL)
ret = fold_build2 (COMPOUND_EXPR, TREE_TYPE (ret),
instrument_expr, ret);
+ if (semantic_result_type)
+ ret = build1_loc (location, EXCESS_PRECISION_EXPR,
+ semantic_result_type, ret);
+
return ret;
}
@@ -0,0 +1,10 @@
+/* PR c/80097 */
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -fsanitize=float-divide-by-zero" } */
+
+int
+foo (double a)
+{
+ int b = (1 / a >= 1);
+ return b;
+}