]> gcc.gnu.org Git - gcc.git/commitdiff
Fix type error of 'switch (SUBREG_BYTE (op)).'
authorJin Ma <jinma@linux.alibaba.com>
Wed, 17 May 2023 21:48:39 +0000 (15:48 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Wed, 17 May 2023 21:48:39 +0000 (15:48 -0600)
For example:
(define_insn "mov_lowpart_sidi2"
  [(set (match_operand:SI            0 "register_operand" "=r")
        (subreg:SI (match_operand:DI 1 "register_operand" " r") 0))]
  "TARGET_64BIT"
  "mov\t%0,%1")

(define_insn "mov_highpart_sidi2"
  [(set (match_operand:SI            0 "register_operand" "=r")
        (subreg:SI (match_operand:DI 1 "register_operand" " r") 1))]
  "TARGET_64BIT"
  "movh\t%0,%1")

When defining the above patterns, the generated file insn-recog.cc will
appear 'switch (SUBREG_BYTE (op))', but since the return value of
SUBREG_BYTE is poly_uint16_pod, the following error will occur:
"error: switch quantity not an integer".

gcc/ChangeLog:

* genrecog.cc (print_nonbool_test): Fix type error of
switch (SUBREG_BYTE (op))'.

gcc/genrecog.cc

index 6dd375da5e35d12b2e3db339a7d7a1569ef8c311..04a5533ca4b29b90ff64d9e5434d82715b2a1847 100644 (file)
@@ -4619,6 +4619,7 @@ print_nonbool_test (output_state *os, const rtx_test &test)
       printf ("SUBREG_BYTE (");
       print_test_rtx (os, test);
       printf (")");
+      printf (".to_constant ()");
       break;
 
     case rtx_test::WIDE_INT_FIELD:
This page took 0.069826 seconds and 5 git commands to generate.