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

2023-08-10 Thread Andrew Pinski via Gcc-patches
On Thu, Aug 10, 2023 at 12:32 AM Richard Biener via Gcc-patches wrote: > > On Thu, Aug 10, 2023 at 2:21 AM Andrew Pinski via Gcc-patches > wrote: > > > > This was an oversight on my part not realizing that > > comparisons in generic can have a non-boolean type. > > This means if we have `(f < 0)

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

2023-08-10 Thread Richard Biener via Gcc-patches
On Thu, Aug 10, 2023 at 2:21 AM Andrew Pinski via Gcc-patches wrote: > > This was an oversight on my part not realizing that > comparisons in generic can have a non-boolean type. > This means if we have `(f < 0) | !(f < 0)` we would > optimize this to -1 rather than just 1. > This patch just adds

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

2023-08-09 Thread Andrew Pinski via Gcc-patches
This was an oversight on my part not realizing that comparisons in generic can have a non-boolean type. This means if we have `(f < 0) | !(f < 0)` we would optimize this to -1 rather than just 1. This patch just adds the check for the type of the comparisons to be boolean type to keep the optimizat