I have no idea how this passed bootstrap and tests in other languages.

The problem here is that wide_int_binop is overflowing on TRUNC_DIV_EXPR and a range in Go. This is causing us to use wmin/wmax uninitialized.

Serves me right for all my whining about Ada yesterday. I think the VRP changes are sufficiently all encompassing that I will start testing --enable-languages=all instead of whatever our defaults are. My bad.

Committed as obvious.

Aldy
gcc/

	PR 87073/bootstrap
	* wide-int-range.cc (wide_int_range_div): Do not ignore result
	from wide_int_range_multiplicative_op.

diff --git a/gcc/wide-int-range.cc b/gcc/wide-int-range.cc
index cbc71c25cfe..3cdcede04cd 100644
--- a/gcc/wide-int-range.cc
+++ b/gcc/wide-int-range.cc
@@ -687,14 +687,11 @@ wide_int_range_div (wide_int &wmin, wide_int &wmax,
 
   /* If we know we won't divide by zero, just do the division.  */
   if (!wide_int_range_includes_zero_p (divisor_min, divisor_max, sign))
-    {
-      wide_int_range_multiplicative_op (wmin, wmax, code, sign, prec,
-					dividend_min, dividend_max,
-					divisor_min, divisor_max,
-					overflow_undefined,
-					overflow_wraps);
-      return true;
-    }
+    return wide_int_range_multiplicative_op (wmin, wmax, code, sign, prec,
+					     dividend_min, dividend_max,
+					     divisor_min, divisor_max,
+					     overflow_undefined,
+					     overflow_wraps);
 
   /* If flag_non_call_exceptions, we must not eliminate a division
      by zero.  */

Reply via email to