Ciao,
3 set 2023, 22:16 da ni...@lysator.liu.se:
> Andrew Teylu writes:
>
> I see no good reason to involve any signed values here, though. Maybe
> the variable neg, and the return value, should be changed to mp_limb_t,
> or at least unsigned int?
>
Yes, unsigned is the best choice, it used
On 2023-09-03 22:16:21 +0200, Niels Möller wrote:
> Andrew Teylu writes:
>
> >> I am not sure the arithmetic on unsigned types is what clang is unhappy
> >> about, though. Perhaps it dislikes the xor with "neg", which is a
> >> signed variable.
>
> I can't say precisely what implicit
On Sun, Sep 3, 2023 at 9:16 PM Niels Möller wrote:
> Does it make any difference if you change the "1" constants to "1u" ?
>
I'll try this in the morning and see if the runtime error goes away or not.
> I see no good reason to involve any signed values here, though. Maybe
> the variable neg,
Andrew Teylu writes:
>> I am not sure the arithmetic on unsigned types is what clang is unhappy
>> about, though. Perhaps it dislikes the xor with "neg", which is a
>> signed variable.
I can't say precisely what implicit conversions happen according to the
spec: Unsigned to signed is always
On Sun, Sep 3, 2023 at 7:16 PM Torbjörn Granlund wrote:
>
> Andrew Teylu writes:
>
> When I run `multiply.c` from gmpbench [https://gmplib.org/gmpbench],
> I'm seeing an unsigned integer overflow in `toom_eval_pm2.c` on this
> line:
>
> neg ^= ((k & 1) - 1)
>
> I fully appreciate that
Andrew Teylu writes:
When I run `multiply.c` from gmpbench [https://gmplib.org/gmpbench],
I'm seeing an unsigned integer overflow in `toom_eval_pm2.c` on this
line:
neg ^= ((k & 1) - 1)
I fully appreciate that unsigned integer overflow is implementation
defined, but I am not sure
Hi,
I'm working with gmp-6.3.0 compiled with clang 16 and its
`-fsanitize=integer` flag.
When I run `multiply.c` from gmpbench [https://gmplib.org/gmpbench],
I'm seeing an unsigned integer overflow in `toom_eval_pm2.c` on this
line:
```
neg ^= ((k & 1) - 1)
```
The values we're normally