]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix wrong partial subreg check for bsetidisi
authorLin Sinan <sinan.lin@linux.alibaba.com>
Tue, 28 Feb 2023 05:00:36 +0000 (13:00 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Sun, 5 Mar 2023 08:59:16 +0000 (16:59 +0800)
The partial subreg check should be for subreg operand(operand 1) instead of
the immediate operand(operand 2). This change also fix pr68648.c in zbs.

gcc/ChangeLog:

* config/riscv/bitmanip.md: Fix wrong index in the check.
Reviewed-by: <philipp.tomsich@vrull.eu>
gcc/config/riscv/bitmanip.md

index 14d18edbe62bbbc1bf843d465a443dbf7a7eaecc..58a86bd929f1305715800b5e43d6b66679a64758 100644 (file)
        (ior:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
                (match_operand 2 "single_bit_mask_operand" "i")))]
   "TARGET_ZBS && TARGET_64BIT
-   && !partial_subreg_p (operands[2])"
+   && !partial_subreg_p (operands[1])"
   "bseti\t%0,%1,%S2"
   [(set_attr "type" "bitmanip")])