genrecog.cc (print_nonbool_test): Fix type error of SUBREG_BYTE

Message ID 20220919060141.5014-1-rjiejie@linux.alibaba.com
State Accepted, archived
Headers
Series genrecog.cc (print_nonbool_test): Fix type error of SUBREG_BYTE |

Checks

Context Check Description
snail/gcc-patches-check success Github commit url

Commit Message

Jojo R Sept. 19, 2022, 6:01 a.m. UTC
  * gcc/genrecog.cc (print_nonbool_test): Fix type error of
	SUBREG_BYTE
---
 gcc/genrecog.cc | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Richard Sandiford Sept. 20, 2022, 8:33 a.m. UTC | #1
Jojo R via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> 	* gcc/genrecog.cc (print_nonbool_test): Fix type error of
> 	SUBREG_BYTE

We can't do this here.  The code has done nothing to prove that the
subreg offset is a compile-time constant.

Thanks,
Richard

> ---
>  gcc/genrecog.cc | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/genrecog.cc b/gcc/genrecog.cc
> index 77f8fb97853..319e437e334 100644
> --- a/gcc/genrecog.cc
> +++ b/gcc/genrecog.cc
> @@ -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:
  

Patch

diff --git a/gcc/genrecog.cc b/gcc/genrecog.cc
index 77f8fb97853..319e437e334 100644
--- a/gcc/genrecog.cc
+++ b/gcc/genrecog.cc
@@ -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: