From 3c7c9afcbf5105e3eec93f79e2efb92068fda2ef Mon Sep 17 00:00:00 2001 From: jakub Date: Wed, 14 Feb 2018 12:12:15 +0000 Subject: PR fortran/84313 * testsuite/libgomp.fortran/threadprivate4.f90: Add -std=f2003 -fall-intrinsics into dg-additional-options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257654 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 6 ++++++ libgomp/testsuite/libgomp.fortran/threadprivate4.f90 | 1 + 2 files changed, 7 insertions(+) (limited to 'libgomp') diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index a620923729b..c33919d64d1 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2018-02-14 Jakub Jelinek + + PR fortran/84313 + * testsuite/libgomp.fortran/threadprivate4.f90: Add + -std=f2003 -fall-intrinsics into dg-additional-options. + 2018-02-08 Martin Jambor * testsuite/libgomp.hsa.c/pr82416.c: Make the function with target diff --git a/libgomp/testsuite/libgomp.fortran/threadprivate4.f90 b/libgomp/testsuite/libgomp.fortran/threadprivate4.f90 index b5fb10bfee7..c86cac72305 100644 --- a/libgomp/testsuite/libgomp.fortran/threadprivate4.f90 +++ b/libgomp/testsuite/libgomp.fortran/threadprivate4.f90 @@ -1,4 +1,5 @@ ! { dg-do run } +! { dg-additional-options "-std=f2003 -fall-intrinsics" } ! { dg-require-effective-target tls_runtime } module threadprivate4 -- cgit v1.2.1 From 51c6e646d40e5019e0a8df761fb1ac7e3459d4b3 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 16 Feb 2018 22:40:32 +0000 Subject: PR fortran/84418 * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step. * libgomp.fortran/pr84418-1.f90: New test. * libgomp.fortran/pr84418-2.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257771 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 6 +++++ libgomp/testsuite/libgomp.fortran/pr84418-1.f90 | 26 ++++++++++++++++++ libgomp/testsuite/libgomp.fortran/pr84418-2.f90 | 35 +++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 libgomp/testsuite/libgomp.fortran/pr84418-1.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/pr84418-2.f90 (limited to 'libgomp') diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index c33919d64d1..5e5e22f3a9f 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2018-02-16 Jakub Jelinek + + PR fortran/84418 + * libgomp.fortran/pr84418-1.f90: New test. + * libgomp.fortran/pr84418-2.f90: New test. + 2018-02-14 Jakub Jelinek PR fortran/84313 diff --git a/libgomp/testsuite/libgomp.fortran/pr84418-1.f90 b/libgomp/testsuite/libgomp.fortran/pr84418-1.f90 new file mode 100644 index 00000000000..e56c022446c --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr84418-1.f90 @@ -0,0 +1,26 @@ +! PR fortran/84418 +! { dg-do run { target vect_simd_clones } } +! { dg-options "-fno-inline" } +! { dg-additional-options "-msse2" { target sse2_runtime } } +! { dg-additional-options "-mavx" { target avx_runtime } } + + real :: a(1024), b(1024), c(1024) + integer :: i + do i = 1, 1024 + a(i) = 0.5 * i + b(i) = 1.5 * i + end do + !$omp simd + do i = 1, 1024 + c(i) = foo (a(i), b(i)) + end do + do i = 1, 1024 + if (c(i).ne.(2 * i)) call abort + end do +contains + real function foo (x, y) + real :: x, y + !$omp declare simd linear (ref (x, y)) + foo = x + y + end function +end diff --git a/libgomp/testsuite/libgomp.fortran/pr84418-2.f90 b/libgomp/testsuite/libgomp.fortran/pr84418-2.f90 new file mode 100644 index 00000000000..a6657d18095 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr84418-2.f90 @@ -0,0 +1,35 @@ +! PR fortran/84418 +! { dg-do run { target vect_simd_clones } } +! { dg-options "-fno-inline" } +! { dg-additional-options "-msse2" { target sse2_runtime } } +! { dg-additional-options "-mavx" { target avx_runtime } } + + type p + integer :: i, j + end type + type(p) :: a(1024) + integer :: b(4,1024), c(1024) + integer :: i + do i = 1, 1024 + a(i)%i = 2 * i + a(i)%j = 3 * i + b(1,i) = 4 * i + b(2,i) = 5 * i + b(3,i) = 6 * i + b(4,i) = 7 * i + end do + !$omp simd + do i = 1, 1024 + c(i) = foo (a(i), b(:,i)) + end do + do i = 1, 1024 + if (c(i).ne.(6 * i)) call abort + end do +contains + function foo (x, y) + type (p) :: x + integer :: y(4), foo + !$omp declare simd linear (ref (x, y)) + foo = x%i + y(1) + end function +end -- cgit v1.2.1 From 5611e648542e5fdbb5a839ec21179ab979338839 Mon Sep 17 00:00:00 2001 From: itsimbal Date: Mon, 19 Feb 2018 16:25:49 +0000 Subject: CET shouldn't be enabled in 32-bit run-time libraries by defualt ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and newer x86 processors, starting Pentium Pro. They are UD on older 32-bit processors. Detect this at configure time and adjust the default value for enable_cet. GCC will enable CET in 32-bit run-time libraries in any case if --enable-cet is used to configure GCC. PR target/84148 * config/cet.m4: Check if target support multi-byte NOPS (SSE). * libatomic/configure: Regenerate. * libbacktrace/configure: Likewise. * libgcc/configure: Likewise. * libgfortran/configure: Likewise. * libgomp/configure: Likewise. * libitm/configure: Likewise. * libmpx/configure: Likewise. * libobjc/configure: Likewise. * libquadmath/configure: Likewise. * libsanitizer/configure: Likewise. * libssp/configure: Likewise. * libstdc++-v3/configure: Likewise. * libvtv/configure: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257809 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 5 +++++ libgomp/configure | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'libgomp') diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 5e5e22f3a9f..ccc77006c5a 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2018-02-19 Igor Tsimbalist + + PR target/84148 + * configure: Regenerate. + 2018-02-16 Jakub Jelinek PR fortran/84418 diff --git a/libgomp/configure b/libgomp/configure index e7842b5519f..92b8142b0b1 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -15142,7 +15142,7 @@ fi # Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*- # -# Copyright (C) 2014-2017 Free Software Foundation, Inc. +# Copyright (C) 2014-2018 Free Software Foundation, Inc. # # Contributed by Mentor Embedded. # @@ -16633,18 +16633,28 @@ else fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CET support" >&5 +$as_echo_n "checking for CET support... " >&6; } + case "$host" in i[34567]86-*-linux* | x86_64-*-linux*) case "$enable_cet" in default) - # Check if assembler supports CET. + # Check if target supports multi-byte NOPs + # and if assembler supports CET insn. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { + +#if !defined(__SSE2__) +#error target does not support multi-byte NOPs +#else asm ("setssbsy"); +#endif + ; return 0; } @@ -16684,6 +16694,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext esac if test x$enable_cet = xyes; then CET_FLAGS="-fcf-protection -mcet" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi XCFLAGS="$XCFLAGS $CET_FLAGS" -- cgit v1.2.1