[PATCH 1/2] Fix PR 110487: invalid signed boolean value

2023-07-01 Thread Andrew Pinski via Gcc-patches
This fixes the first part of this bug where `a ? -1 : 0` would cause a value of 1 into the signed boolean value. It fixes the problem by casting to an integer type of the same size/signedness before doing the negative and then casting to the type of expression. OK? Bootstrapped and tested on x86_6

Re: [PATCH 1/2] Fix PR 110487: invalid signed boolean value

2023-07-03 Thread Richard Biener via Gcc-patches
On Sat, Jul 1, 2023 at 10:23 AM Andrew Pinski via Gcc-patches wrote: > > This fixes the first part of this bug where `a ? -1 : 0` > would cause a value of 1 into the signed boolean value. > It fixes the problem by casting to an integer type of > the same size/signedness before doing the negative a