diff mbox series

testsuite: Add -fno-common to pr82374.c [PR94077]

Message ID 52e6b0a4-e188-2180-679b-18fad5399bd4@linux.ibm.com
State New
Headers show
Series testsuite: Add -fno-common to pr82374.c [PR94077] | expand

Commit Message

Kewen.Lin Aug. 12, 2020, 9:03 a.m. UTC
Hi,

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 release on ppc64-redhat-linux (Power7).

Is it ok for gcc8 and gcc9 release?

I guess for gcc10 and trunk, we can just let it alone?

BR,
Kewen
-----
gcc/testsuite/ChangeLog:

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

Comments

Jakub Jelinek Aug. 12, 2020, 9:08 a.m. UTC | #1
On Wed, Aug 12, 2020 at 05:03:45PM +0800, Kewen.Lin wrote:
> Hi,
> 
> 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 release on ppc64-redhat-linux (Power7).
> 
> Is it ok for gcc8 and gcc9 release?
> 
> I guess for gcc10 and trunk, we can just let it alone?
> 
> BR,
> Kewen
> -----
> gcc/testsuite/ChangeLog:
> 
> 	PR testsuite/94077
> 	* gcc.dg/gomp/pr82374.c: Add option -fno-common.

Ok for 8/9, thanks.

	Jakub
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/gomp/pr82374.c b/gcc/testsuite/gcc.dg/gomp/pr82374.c
index 453266e..e63a2f5 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr82374.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr82374.c
@@ -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 } } */