From: Kyrylo Tkachov <[email protected]>

r17-2413-ge46d96d20bbf ("PR middle-end/123236: Simplify (int)((long
long)x >> 4)") relaxed the guard on the truncate-of-extract
simplification in simplify_truncation, so combine can now narrow

  (truncate:SI (zero_extract:DI (subreg:DI (reg:V2QI)) 8 8))

to an SImode extract, and test_nonpst8 ends in ubfx w0 rather than
ubfx x0.  Both compute the same 64-bit result in x0.

These blocks exist to check the SVE PCS handling of a non-pure-scalable
struct, so the width the extract happens to use is incidental.  Accept
either rather than swapping one hard-coded width for the other, so the
test does not break again the next time the narrowing decision moves.

gcc/testsuite/ChangeLog:

        * gcc.target/aarch64/sve/pcs/struct_3_128.c (test_nonpst8): Accept
        a ubfx of either width.
        * gcc.target/aarch64/sve/pcs/struct_3_256.c (test_nonpst8):
        Likewise for little endian.

Signed-off-by: Kyrylo Tkachov <[email protected]>
---
 gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_128.c | 2 +-
 gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_256.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_128.c 
b/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_128.c
index 7583d0c0c1c..02bf10cd4fd 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_128.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_128.c
@@ -1074,7 +1074,7 @@ SEL2 (struct, nonpst8)
 
 /*
 ** test_nonpst8:
-**     ubfx    x0, x0, 8, 8
+**     ubfx    [wx]0, [wx]0, 8, 8
 **     ret
 */
 /* { dg-final { scan-assembler-not {\t\.variant_pcs\ttest_nonpst8\n} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_256.c 
b/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_256.c
index af0af29d515..02ec1aeae05 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_256.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pcs/struct_3_256.c
@@ -1187,7 +1187,7 @@ SEL2 (struct, nonpst8)
 
 /*
 ** test_nonpst8: { target aarch64_little_endian }
-**     ubfx    x0, x0, 8, 8
+**     ubfx    [wx]0, [wx]0, 8, 8
 **     ret
 */
 /*
-- 
2.50.1 (Apple Git-155)

Reply via email to