Re: [PATCH] wide-int: Fix up mul_internal overflow checking [PR116224]

2024-08-06 Thread Sam James
Jakub Jelinek writes: > Hi! > > The following testcase is miscompiled, because wi::mul for (_BitInt(65))-15 > times (_BitInt(65))-15 computes the right value (_BitInt(65))225, but > sets *overflow to wi::OVF_UNKNOWN as that it overflowed when it didn't. > > Even signed operands are unpacked as un

Re: [PATCH] wide-int: Fix up mul_internal overflow checking [PR116224]

2024-08-06 Thread Richard Biener
On Tue, 6 Aug 2024, Jakub Jelinek wrote: > Hi! > > The following testcase is miscompiled, because wi::mul for (_BitInt(65))-15 > times (_BitInt(65))-15 computes the right value (_BitInt(65))225, but > sets *overflow to wi::OVF_UNKNOWN as that it overflowed when it didn't. > > Even signed operand