Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-04 Thread Jakub Jelinek
On Tue, Mar 04, 2025 at 09:26:07AM +, Richard Sandiford wrote: > gcc/ > PR rtl-optimization/119002 > * simplify-rtx.cc > (simplify_context::simplify_logical_relational_operation): Handle > comparisons between CC values. If there is no evidence that the > CC values

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-04 Thread Richard Sandiford
Richard Sandiford writes: > Jakub Jelinek writes: >> On Mon, Mar 03, 2025 at 01:46:20PM +, Richard Sandiford wrote: >>> Jakub Jelinek writes: >>> > On Mon, Mar 03, 2025 at 01:02:07PM +, Richard Sandiford wrote: >>> >> ...how about something like this? Completely untested, and I haven't

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-03 Thread Richard Sandiford
Jakub Jelinek writes: > On Mon, Mar 03, 2025 at 01:46:20PM +, Richard Sandiford wrote: >> Jakub Jelinek writes: >> > On Mon, Mar 03, 2025 at 01:02:07PM +, Richard Sandiford wrote: >> >> ...how about something like this? Completely untested, and I haven't >> >> thought about it much. Jus

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-03 Thread Jakub Jelinek
On Mon, Mar 03, 2025 at 01:46:20PM +, Richard Sandiford wrote: > Jakub Jelinek writes: > > On Mon, Mar 03, 2025 at 01:02:07PM +, Richard Sandiford wrote: > >> ...how about something like this? Completely untested, and I haven't > >> thought about it much. Just didn't want to hold up the

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-03 Thread Richard Sandiford
Jakub Jelinek writes: > On Mon, Mar 03, 2025 at 01:02:07PM +, Richard Sandiford wrote: >> ...how about something like this? Completely untested, and I haven't >> thought about it much. Just didn't want to hold up the discussion. > > Works for me. > > Just wonder if there is anything that wil

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-03 Thread Jakub Jelinek
On Mon, Mar 03, 2025 at 01:02:07PM +, Richard Sandiford wrote: > ...how about something like this? Completely untested, and I haven't > thought about it much. Just didn't want to hold up the discussion. Works for me. Just wonder if there is anything that will actually verify that XEXP (op0,

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-03 Thread Richard Sandiford
Jakub Jelinek writes: > On Mon, Mar 03, 2025 at 12:20:00PM +, Richard Sandiford wrote: >> I think we should instead go back to punting on comparisons whose inputs >> are CC modes, as we did (indirectly, via comparison_code_valid_for_mode) >> before r15-6777. Sorry, I'd forgotten/hadn't though

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-03 Thread Jakub Jelinek
On Mon, Mar 03, 2025 at 12:20:00PM +, Richard Sandiford wrote: > I think we should instead go back to punting on comparisons whose inputs > are CC modes, as we did (indirectly, via comparison_code_valid_for_mode) > before r15-6777. Sorry, I'd forgotten/hadn't thought to exclude CC modes > expl

Re: [PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-03-03 Thread Richard Sandiford
Jakub Jelinek writes: > Hi! > > The following testcase is miscompiled on powerpc64le-linux starting with > r15-6777. > That change has the if (HONOR_NANS (GET_MODE (XEXP (op0, 0 all = 15; > lines which work fine if the comparisons use MODE_FLOAT or MODE_INT operands > (or say MODE_VECTOR* etc.

[PATCH] simplify-rtx: Fix up simplify_logical_relational_operation [PR119002]

2025-02-25 Thread Jakub Jelinek
Hi! The following testcase is miscompiled on powerpc64le-linux starting with r15-6777. That change has the if (HONOR_NANS (GET_MODE (XEXP (op0, 0 all = 15; lines which work fine if the comparisons use MODE_FLOAT or MODE_INT operands (or say MODE_VECTOR* etc.). But on this testcase on ppc64le