Re: [PATCH] aarch64: Fix undefinedness while testing the J constraint [PR100204]

2024-01-26 Thread Alex Coplan
On 25/01/2024 11:57, Andrew Pinski wrote: > The J constraint can invoke undefined behavior due to it taking the > negative of the ival if ival was HWI_MIN. The fix is simple as casting > to `unsigned HOST_WIDE_INT` before doing the negative of it. This > does that. Thanks for doing this. > >

[PATCH] aarch64: Fix undefinedness while testing the J constraint [PR100204]

2024-01-25 Thread Andrew Pinski
The J constraint can invoke undefined behavior due to it taking the negative of the ival if ival was HWI_MIN. The fix is simple as casting to `unsigned HOST_WIDE_INT` before doing the negative of it. This does that. Committed as obvious after build/test for aarch64-linux-gnu. gcc/ChangeLog: