Jakub Jelinek <ja...@redhat.com> writes: > On Mon, Mar 03, 2025 at 01:46:20PM +0000, Richard Sandiford wrote: >> Jakub Jelinek <ja...@redhat.com> writes: >> > On Mon, Mar 03, 2025 at 01:02:07PM +0000, 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, >> > 0) >> > and XEXP (op1, 0) modes are at least from the same class, rather than say >> > have one of the comparisons in MODE_CC and another in MODE_INT or vice >> > versa >> > or whatever other modes. >> >> There's: >> >> if (!(rtx_equal_p (XEXP (op0, 0), XEXP (op1, 0)) >> && rtx_equal_p (XEXP (op0, 1), XEXP (op1, 1)))) >> return 0; > > You're right, and rtx_equal_p returns false for GET_MODE differences. > > Will you test your patch (with the testcase from my patch) or should I?
I'm just about to test it with a tweak to the mode check. Should be done in a couple of hours. Thanks, Richard