aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2023-11-07 08:02:03 -0300
committerAlexandre Oliva <oliva@gnu.org>2023-11-07 08:02:03 -0300
commite87bc7dc08a1bd05f07781edf064db26456102d5 (patch)
tree87353b058773e78c9188712100a9f15d49ec80a9 /gcc
parent74b35716a8eb3fef8ce2545ebdb1ff78cbeed28b (diff)
downloadgcc-e87bc7dc08a1bd05f07781edf064db26456102d5.zip
gcc-e87bc7dc08a1bd05f07781edf064db26456102d5.tar.gz
gcc-e87bc7dc08a1bd05f07781edf064db26456102d5.tar.bz2
testsuite: check for and use -mno-strict-align where needed
Various tests fail on powerpc if the toolchain is configured to enable -mstrict-align by default. This patch introduces -mno-strict-align on tests found to fail that way, when the target supports this option. I suppose !non_strict_align could be used to skip tests, instead of or in addition to this tweak, and that might be desirable if they still fail on targets that do no support -mno-strict-align, but I haven't observed such scenarios. The p9-vec-length tests expect vectorization on loop bodies and epilogues that reference arrays that are not known to be more aligned than their small element types. Though VSX vectors work best with 32- or 64-bit alignment, unaligned vector loads and stores are expected by the tests. However, with -mstrict-align by default, vector loads and stores not known to be aligned end up open coded, which doesn't match the asm output expectations coded in the tests. for gcc/ChangeLog * doc/sourcebuild.texi (opt_mstrict_align): New target. for gcc/testsuite/ChangeLog * lib/target-supports.exp (check_effective_target_opt_mstrict_align): New. * gcc.dg/strlenopt-80.c: Add -mno-strict-align if supported. * gcc.target/powerpc/prefix-ds-dq.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-8.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-epil-run-8.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-8.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-1.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-2.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-3.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-4.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-5.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-6.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-7.c: Likewise. * gcc.target/powerpc/p9-vec-length-full-run-8.c: Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/doc/sourcebuild.texi3
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-80.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c2
-rw-r--r--gcc/testsuite/lib/target-supports.exp8
36 files changed, 81 insertions, 0 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index c8611a0..51ca735 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2580,6 +2580,9 @@ Target supports FPU instructions.
@item non_strict_align
Target does not require strict alignment.
+@item opt_mstrict_align
+Target supports @option{-mstrict-align} and @option{-mno-strict-align}.
+
@item pie_copyreloc
The x86-64 target linker supports PIE with copy reloc.
diff --git a/gcc/testsuite/gcc.dg/strlenopt-80.c b/gcc/testsuite/gcc.dg/strlenopt-80.c
index a8adbf1..63d4eb1 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-80.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-80.c
@@ -8,6 +8,10 @@
{ dg-options "-O2 -Wall -fdump-tree-optimized" }
{ dg-additional-options "-msse" { target i?86-*-* x86_64-*-* } } */
+/* On powerpc configurations that have -mstrict-align by default,
+ the memcpy calls for ncpylog >= 3 are not turned into MEM_REFs.
+ { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
#define CHAR_BIT __CHAR_BIT__
#define SIZE_MAX __SIZE_MAX__
#define LEN_MAX (__PTRDIFF_MAX__ - 2)
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c
index dfcc0e9..f57d945 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-1.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c
index e63f1bf..1985640 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-2.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c
index 4a99e3a..eaea96d 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-3.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c
index 9fbee6a..0199132 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-4.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c
index d023a99..c68faa8 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-5.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c
index dbce907..18076cc 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-6.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c
index 011b731..4e37c0a 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-7.c
@@ -5,6 +5,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c
index e56fd55..0f3cd07 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-8.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for that only vectorize the epilogue with vector access with length,
the main body still use normal vector load/store. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c
index d1cd67f..2f091a3 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-1.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c
index 815867b..03b1725 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-2.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c
index 5378d02..5329422 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-3.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c
index daed9a7..2021372 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-4.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c
index b5f24e6..00ed61a 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-5.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c
index a3e6367..adbfd08 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-6.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c
index f0b69d4..79ba4a1 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-7.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c
index 84abecf..6e09b07 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-epil-run-8.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c
index f01f1c5..2818bac 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-1.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c
index f546e97..b476910 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-2.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c
index 65142b3..0f50242 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-3.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c
index a4cc7aa..20ddfb3 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-4.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c
index 4b0b907..0bad693 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-5.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
index 65ddf2b..a73178e 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-6.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c
index e0e51d9..b50ff3c 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-7.c
@@ -5,6 +5,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c
index 7fe0dd0..94f2aa4 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-8.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Test for fully with length, the loop body uses vector access with length,
there should not be any epilogues. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c
index 4e9bd0f..8950392 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-1.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c
index 8e06b1b..1f295ae 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-2.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c
index 0b86f62..1cb9b8f 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-3.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c
index 359f31c..029454a 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-4.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c
index 7aa468e5..02bb0a8 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-5.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c
index 53a2ad0..9839ad9 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-6.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c
index 0c21d13..10ce774 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-7.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c
index 9107842..163bfb2 100644
--- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c
+++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length-full-run-8.c
@@ -3,6 +3,8 @@
/* { dg-additional-options "--param=vect-partial-vector-usage=2" } */
+/* { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
+
/* Check whether it runs successfully if we vectorize the loop fully
with vector access with length. */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c
index 554cd0c..3f477a0 100644
--- a/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-ds-dq.c
@@ -2,6 +2,8 @@
/* { dg-require-effective-target powerpc_prefixed_addr } */
/* { dg-require-effective-target lp64 } */
/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+/* If -mstrict-align is enabled by default, we don't get the expected opcodes.
+ { dg-additional-options "-mno-strict-align" { target opt_mstrict_align } } */
/* Tests whether we generate a prefixed load/store operation for addresses that
don't meet DS/DQ offset constraints. 64-bit is needed for testing the use
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 17a87db..6ef53e0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -11575,6 +11575,14 @@ proc check_effective_target_non_strict_align {} {
} "-Wcast-align"]
}
+# Return 1 if the target supports -mstrict-align (and -mno-strict-align).
+
+proc check_effective_target_opt_mstrict_align {} {
+ return [check_no_compiler_messages opt_mstrict_align assembly {
+ void foo(void) {}
+ } "-mstrict-align -mno-strict-align"]
+}
+
# Return 1 if the target has <ucontext.h>.
proc check_effective_target_ucontext_h { } {