[PR,87073,committed] fix go bootstrap
diff mbox series

Message ID ba4cd00c-9a13-b33b-ee3b-5531e54db31d@redhat.com
State New
Headers show
Series
  • [PR,87073,committed] fix go bootstrap
Related show

Commit Message

Aldy Hernandez Aug. 24, 2018, 8:02 a.m. UTC
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

Comments

H.J. Lu Aug. 24, 2018, 4:56 p.m. UTC | #1
n Fri, Aug 24, 2018 at 1:02 AM Aldy Hernandez <aldyh@redhat.com> wrote:
>
> 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.

This patch also fixed:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87092

I am checking in this patch to add a testcase.
Aldy Hernandez Aug. 24, 2018, 5:05 p.m. UTC | #2
On 08/24/2018 12:56 PM, H.J. Lu wrote:
> n Fri, Aug 24, 2018 at 1:02 AM Aldy Hernandez <aldyh@redhat.com> wrote:
>>
>> 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.
> 
> This patch also fixed:
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87092
> 
> I am checking in this patch to add a testcase.
> 

Thank you.

Patch
diff mbox series

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.  */