Re: [PATCHv2] Fix PR 110954: wrong code with cmp | !cmp

2023-08-10 Thread Richard Biener via Gcc-patches
On Fri, Aug 11, 2023 at 12:52 AM Andrew Pinski via Gcc-patches wrote: > > This was an oversight on my part forgetting that > cmp will might have a different true value than all ones > but will have a value of 1 in most cases. > This means if we have `(f < 0) | !(f < 0)` we would > optimize this to

[PATCHv2] Fix PR 110954: wrong code with cmp | !cmp

2023-08-10 Thread Andrew Pinski via Gcc-patches
This was an oversight on my part forgetting that cmp will might have a different true value than all ones but will have a value of 1 in most cases. This means if we have `(f < 0) | !(f < 0)` we would optimize this to -1 rather than just 1. This is version 2 of the patch. Decided to go down a diffe