On 9/7/23 14:33, Palmer Dabbelt wrote:
On Thu, 07 Sep 2023 13:16:36 PDT (-0700), dimi...@dinux.eu wrote:
Hi,

This patch appears to have caused PR 111259.

Thanks.  Looks like wer'e not running our tests with RTL checking, Patrick is going to try and see if we've got compute time left for some builds -- even just having builds with checking would be a good one, we get bit by these bugs from time to time.

I'm spinning up a --enable-checking=yes build.  Maybe we just need something like

   diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md
    index 53e7c1d03aa..aa4f02c67d5 100644
    --- a/gcc/config/riscv/predicates.md
    +++ b/gcc/config/riscv/predicates.md
    @@ -172,11 +172,11 @@ (define_predicate "stack_pop_up_to_s11_operand"
     ;; ZCMP predicates
     (define_predicate "a0a1_reg_operand"
    -  (and (match_operand 0 "register_operand")
    +  (and (match_code "reg")
            (match_test "IN_RANGE (REGNO (op), A0_REGNUM, A1_REGNUM)")))
     (define_predicate "zcmp_mv_sreg_operand"
    -  (and (match_operand 0 "register_operand")
    +  (and (match_code "reg")
           (match_test "TARGET_RVE ? IN_RANGE (REGNO (op), S0_REGNUM, S1_REGNUM)
                         : IN_RANGE (REGNO (op), S0_REGNUM, S1_REGNUM)
                         || IN_RANGE (REGNO (op), S2_REGNUM, S7_REGNUM)")))
Presumably you got a SUBREG if that patch solves the problem.

Note that due to RTL checking's compile-time cost, I think it's a separate option to enable-checking. It's probably not feasible to turn it on for anything but cross testing right now.

IIRC Jakub does RTL checking builds & regression testing just once a year in the spring due to its cost. And I think on just one target (x86). We could probably do something similar to weed out these kinds of problems. Spin it in November and wait however long it takes :-)

jeff

Reply via email to