]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add -fno-common to pr82374.c [PR94077]
authorKewen Lin <linkw@linux.ibm.com>
Wed, 12 Aug 2020 09:19:16 +0000 (04:19 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Wed, 12 Aug 2020 09:43:12 +0000 (04:43 -0500)
As the PR comments show, the case gcc.dg/gomp/pr82374.c fails on
Power7 since gcc8.  But it passes from gcc10.  By looking into
the difference, it's due to that gcc10 sets -fno-common as default,
which makes vectorizer force the alignment and be able to use
aligned vector load/store on those targets which doesn't support
unaligned vector load/store (here it's Power7).

As Jakub suggested in the PR, this patch is to append -fno-common
into dg-options.

Verified with gcc8/gcc9 releases on ppc64-redhat-linux (Power7).

gcc/testsuite/ChangeLog:

PR testsuite/94077
* gcc.dg/gomp/pr82374.c: Add option -fno-common.

gcc/testsuite/gcc.dg/gomp/pr82374.c

index 453266ed84e690200ee72a44a33427e03714eb99..e63a2f5c62d8e93399f0685d126eaa3da47ff691 100644 (file)
@@ -1,6 +1,9 @@
 /* PR tree-optimization/82374 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-vect-details" } */
+/* Option -fno-common makes vectorizer able to force alignment and ensures
+   vectorization can succeed even on targets lacking of unaligned vector
+   load/store.  */
+/* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-vect-details -fno-common" } */
 /* { dg-additional-options "-mavx -mno-avx2" { target i?86-*-* x86_64-*-* } } */
 /* { dg-additional-options "-mvsx" { target powerpc_vsx_ok } } */