middle-end: Fix issue of poly_uint16 (1, 1) in self test

Message ID 20220822090941.131517-1-juzhe.zhong@rivai.ai
State Committed
Commit 21e7d87a901d45f0cb5e5510d22bfbdb0d0ac6a1
Headers
Series middle-end: Fix issue of poly_uint16 (1, 1) in self test |

Commit Message

钟居哲 Aug. 22, 2022, 9:09 a.m. UTC
  From: zhongjuzhe <juzhe.zhong@rivai.ai>

This patch fix issue of poly_uint16 (1, 1) in machine mode self test.

gcc/ChangeLog:

        * simplify-rtx.cc (test_vector_subregs_fore_back): Make first value and repeat value different.

---
 gcc/simplify-rtx.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Richard Sandiford Aug. 22, 2022, 9:16 a.m. UTC | #1
juzhe.zhong@rivai.ai writes:
> From: zhongjuzhe <juzhe.zhong@rivai.ai>
>
> This patch fix issue of poly_uint16 (1, 1) in machine mode self test.
>
> gcc/ChangeLog:
>
>         * simplify-rtx.cc (test_vector_subregs_fore_back): Make first value and repeat value different.

Thanks, pushed.

Richard

>
> ---
>  gcc/simplify-rtx.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
> index 7d09bf7103d..fc0d6c3ca2a 100644
> --- a/gcc/simplify-rtx.cc
> +++ b/gcc/simplify-rtx.cc
> @@ -8434,7 +8434,7 @@ test_vector_subregs_fore_back (machine_mode inner_mode)
>    for (unsigned int i = 0; i < count; ++i)
>      builder.quick_push (gen_int_mode (i, int_mode));
>    for (unsigned int i = 0; i < count; ++i)
> -    builder.quick_push (gen_int_mode (-(int) i, int_mode));
> +    builder.quick_push (gen_int_mode (-1 - (int) i, int_mode));
>    rtx x = builder.build ();
>  
>    test_vector_subregs_modes (x);
  

Patch

diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index 7d09bf7103d..fc0d6c3ca2a 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -8434,7 +8434,7 @@  test_vector_subregs_fore_back (machine_mode inner_mode)
   for (unsigned int i = 0; i < count; ++i)
     builder.quick_push (gen_int_mode (i, int_mode));
   for (unsigned int i = 0; i < count; ++i)
-    builder.quick_push (gen_int_mode (-(int) i, int_mode));
+    builder.quick_push (gen_int_mode (-1 - (int) i, int_mode));
   rtx x = builder.build ();
 
   test_vector_subregs_modes (x);