Jeff Law <[email protected]> writes:

> On 10/10/26 10:08 AM, Michiel Derhaeg wrote:
>> Hi Jeff,
>>
>> Jeff Law <[email protected]> writes:
>>
>>> On 10/2/26 3:20 AM, Michiel Derhaeg wrote:
>>>> diff --git a/gcc/expr.cc b/gcc/expr.cc
>>>> index a9157dc5d41..0dd9d7d8870 100644
>>>> --- a/gcc/expr.cc
>>>> +++ b/gcc/expr.cc
>>>> @@ -14563,16 +14563,14 @@ int_expr_size (const_tree exp)
>>>>    }
>>>>    
>>>>    /* Return the quotient of polynomial long division of x^2N by POLYNOMIAL
>>>> -   in GF (2^N).
>>>> +   in GF (2^N).  The result has degree N, so if N > 63, the result will
>>>> +   not fit in a HOST_WIDE_INT.  This must be taken into account by the 
>>>> caller.
>>>>       Author: Richard Sandiford<[email protected]>  */
>>>>    
>>>>    unsigned HOST_WIDE_INT
>>>>    gf2n_poly_long_div_quotient (unsigned HOST_WIDE_INT polynomial,
>>>>                                 unsigned short n)
>>>>    {
>>>> -  /* The result has degree N, so needs N + 1 bits.  */
>>>> -  gcc_assert (n < 64);
>>> Would it make sense to test n <= 64 here?
>> That's what Loeka's first version did. But I felt that it was a bit
>> arbitrary. For every degree higher than 63, 1 bit of information is lost
>> in the result. So why draw the line at 1?
> But does it work for those higher degrees?
For some reason I believed it did, but that turns out to be nonsense.
We'll reintroduce the assert.

Thanks,
Michiel

Reply via email to