diff mbox

Cleanup patches

Message ID 87r4buu8jq.fsf@schwinge.name
State New
Headers show

Commit Message

Thomas Schwinge Oct. 9, 2013, 8:56 a.m. UTC
Hi!

On Tue, 8 Oct 2013 22:04:23 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Oct 08, 2013 at 09:17:35AM +0200, Thomas Schwinge wrote:
> > Here are a few cleanup patches, mostly in the realm of OpenMP, so Jakub
> > gets a CC.  OK to commit?
> 
> They look ok to me, but I'd prefer if they could go in after the merge
> I've just posted.

Sure, I can wait until then.


Meanwhile, here's another series that I assumed had gotten lost, but now
recovered thanks to »git fsck«.  Also OK to commit?


_OPENMP pre-processor checks, openmp_version Fortran instrinsic checks.

	gcc/testsuite/
	* c-c++-common/cpp/openmp-define-1.c: New file.
	* c-c++-common/cpp/openmp-define-2.c: Likewise.
	* c-c++-common/cpp/openmp-define-3.c: Likewise.
	* gfortran.dg/openmp-define-1.f90: Likewise.
	* gfortran.dg/openmp-define-2.f90: Likewise.
	* gfortran.dg/openmp-define-3.f90: Likewise.
	libgomp/
	* testsuite/libgomp.fortran/openmp_version-1.f: New file.
	* testsuite/libgomp.fortran/openmp_version-2.f90: Likewise.
---
 gcc/testsuite/c-c++-common/cpp/openmp-define-1.c       |  6 ++++++
 gcc/testsuite/c-c++-common/cpp/openmp-define-2.c       |  7 +++++++
 gcc/testsuite/c-c++-common/cpp/openmp-define-3.c       | 11 +++++++++++
 gcc/testsuite/gfortran.dg/openmp-define-1.f90          |  7 +++++++
 gcc/testsuite/gfortran.dg/openmp-define-2.f90          |  7 +++++++
 gcc/testsuite/gfortran.dg/openmp-define-3.f90          | 11 +++++++++++
 libgomp/testsuite/libgomp.fortran/openmp_version-1.f   |  9 +++++++++
 libgomp/testsuite/libgomp.fortran/openmp_version-2.f90 |  9 +++++++++
 8 files changed, 67 insertions(+)
 create mode 100644 gcc/testsuite/c-c++-common/cpp/openmp-define-1.c
 create mode 100644 gcc/testsuite/c-c++-common/cpp/openmp-define-2.c
 create mode 100644 gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
 create mode 100644 gcc/testsuite/gfortran.dg/openmp-define-1.f90
 create mode 100644 gcc/testsuite/gfortran.dg/openmp-define-2.f90
 create mode 100644 gcc/testsuite/gfortran.dg/openmp-define-3.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/openmp_version-1.f
 create mode 100644 libgomp/testsuite/libgomp.fortran/openmp_version-2.f90



Grüße,
 Thomas

Comments

Jakub Jelinek Oct. 9, 2013, 9:04 a.m. UTC | #1
On Wed, Oct 09, 2013 at 10:56:25AM +0200, Thomas Schwinge wrote:
> On Tue, 8 Oct 2013 22:04:23 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Tue, Oct 08, 2013 at 09:17:35AM +0200, Thomas Schwinge wrote:
> > > Here are a few cleanup patches, mostly in the realm of OpenMP, so Jakub
> > > gets a CC.  OK to commit?
> > 
> > They look ok to me, but I'd prefer if they could go in after the merge
> > I've just posted.
> 
> Sure, I can wait until then.
> 
> 
> Meanwhile, here's another series that I assumed had gotten lost, but now
> recovered thanks to »git fsck«.  Also OK to commit?

The testing _OPENMP value against 201107 won't work after merge, it will be
201307 instead.  The Fortran openmp_version will be still 201107 for now,
as Fortran OpenMP 4.0 support isn't there yet.  Other than that it looks good.

	Jakub
Thomas Schwinge Oct. 9, 2013, 9:56 a.m. UTC | #2
Hi!

On Wed, 9 Oct 2013 11:04:29 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> The testing _OPENMP value against 201107 won't work after merge, it will be
> 201307 instead.  The Fortran openmp_version will be still 201107 for now,
> as Fortran OpenMP 4.0 support isn't there yet.

And:

On Wed, 9 Oct 2013 11:13:38 +0200, Tobias Burnus <tobias.burnus@physik.fu-berlin.de> wrote:
> * When Jakub's patch gets it, one needs to update the C/C++ OpenMP version
> number for OpenMPv4 (i.e. 201307 instead of 201107). The Fortran
> version number hasn't been bumped, yet.

Sorry for not pointing this out upfront: I've been aware of that, but
posted the patch I had tested based on yesterday's trunk.


> * gfortran's preprocessor also defines _OPENMP. Thus, you could also add
> test cases for _OPENMP.

That's what I'm testing in the new file
gcc/testsuite/gfortran.dg/openmp-define-3.f90 -- anything I'm missing
there?


Grüße,
 Thomas
diff mbox

Patch

diff --git gcc/testsuite/c-c++-common/cpp/openmp-define-1.c gcc/testsuite/c-c++-common/cpp/openmp-define-1.c
new file mode 100644
index 0000000..0e7943a
--- /dev/null
+++ gcc/testsuite/c-c++-common/cpp/openmp-define-1.c
@@ -0,0 +1,6 @@ 
+/* { dg-require-effective-target fopenmp } */
+/* { dg-do preprocess } */
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
diff --git gcc/testsuite/c-c++-common/cpp/openmp-define-2.c gcc/testsuite/c-c++-common/cpp/openmp-define-2.c
new file mode 100644
index 0000000..f777789
--- /dev/null
+++ gcc/testsuite/c-c++-common/cpp/openmp-define-2.c
@@ -0,0 +1,7 @@ 
+/* { dg-require-effective-target fopenmp } */
+/* { dg-options "-fno-openmp" } */
+/* { dg-do preprocess } */
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
diff --git gcc/testsuite/c-c++-common/cpp/openmp-define-3.c gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
new file mode 100644
index 0000000..6ea0425
--- /dev/null
+++ gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
@@ -0,0 +1,11 @@ 
+/* { dg-require-effective-target fopenmp } */
+/* { dg-options "-fopenmp" } */
+/* { dg-do preprocess } */
+
+#ifndef _OPENMP
+# error _OPENMP not defined
+#endif
+
+#if _OPENMP != 201107
+# error _OPENMP defined to wrong value
+#endif
diff --git gcc/testsuite/gfortran.dg/openmp-define-1.f90 gcc/testsuite/gfortran.dg/openmp-define-1.f90
new file mode 100644
index 0000000..d4ef1d1
--- /dev/null
+++ gcc/testsuite/gfortran.dg/openmp-define-1.f90
@@ -0,0 +1,7 @@ 
+! { dg-require-effective-target fopenmp }
+! { dg-options "-cpp" }
+! { dg-do preprocess }
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
diff --git gcc/testsuite/gfortran.dg/openmp-define-2.f90 gcc/testsuite/gfortran.dg/openmp-define-2.f90
new file mode 100644
index 0000000..651dae7
--- /dev/null
+++ gcc/testsuite/gfortran.dg/openmp-define-2.f90
@@ -0,0 +1,7 @@ 
+! { dg-require-effective-target fopenmp }
+! { dg-options "-cpp -fno-openmp" }
+! { dg-do preprocess }
+
+#ifdef _OPENMP
+# error _OPENMP defined
+#endif
diff --git gcc/testsuite/gfortran.dg/openmp-define-3.f90 gcc/testsuite/gfortran.dg/openmp-define-3.f90
new file mode 100644
index 0000000..dfc45b1
--- /dev/null
+++ gcc/testsuite/gfortran.dg/openmp-define-3.f90
@@ -0,0 +1,11 @@ 
+! { dg-require-effective-target fopenmp }
+! { dg-options "-cpp -fopenmp" }
+! { dg-do preprocess }
+
+#ifndef _OPENMP
+# error _OPENMP not defined
+#endif
+
+#if _OPENMP != 201107
+# error _OPENMP defined to wrong value
+#endif
diff --git libgomp/testsuite/libgomp.fortran/openmp_version-1.f libgomp/testsuite/libgomp.fortran/openmp_version-1.f
new file mode 100644
index 0000000..aaa8881
--- /dev/null
+++ libgomp/testsuite/libgomp.fortran/openmp_version-1.f
@@ -0,0 +1,9 @@ 
+! { dg-do run }
+
+      program main
+      implicit none
+      include "omp_lib.h"
+
+      if (openmp_version .ne. 201107) call abort;
+
+      end program main
diff --git libgomp/testsuite/libgomp.fortran/openmp_version-2.f90 libgomp/testsuite/libgomp.fortran/openmp_version-2.f90
new file mode 100644
index 0000000..b2d1d26
--- /dev/null
+++ libgomp/testsuite/libgomp.fortran/openmp_version-2.f90
@@ -0,0 +1,9 @@ 
+! { dg-do run }
+
+program main
+  use omp_lib
+  implicit none
+
+  if (openmp_version .ne. 201107) call abort;
+
+end program main


libgomp/
	* configure.ac: Typo fix.
	* configure: Regenerate.

---
 libgomp/configure    | 2 +-
 libgomp/configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git libgomp/configure.ac libgomp/configure.ac
index d87ed29..e7fbb31 100644
--- libgomp/configure.ac
+++ libgomp/configure.ac
@@ -238,7 +238,7 @@  fi
 # See if we support thread-local storage.
 GCC_CHECK_TLS
 
-# See what sort of export controls are availible.
+# See what sort of export controls are available.
 LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY
 LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT
 LIBGOMP_CHECK_ATTRIBUTE_ALIAS


gcc/
	* tree.h (OMP_CLAUSE_CODE): Remove duplicate definition.

---
 gcc/tree.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git gcc/tree.h gcc/tree.h
index a71cd96..2ecda8a 100644
--- gcc/tree.h
+++ gcc/tree.h
@@ -1351,9 +1351,6 @@  extern void protected_set_expr_location (tree, location_t);
 #define OMP_CLAUSE_SET_CODE(NODE, CODE)				\
 	((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE))
 
-#define OMP_CLAUSE_CODE(NODE)					\
-	(OMP_CLAUSE_CHECK (NODE))->omp_clause.code
-
 #define OMP_CLAUSE_OPERAND(NODE, I)				\
 	OMP_CLAUSE_ELT_CHECK (NODE, I)
 


libgomp/
	* testsuite/libgomp.c/lib-1.c (main): Add missing error check.
	* testsuite/libgomp.fortran/lib1.f90: Likewise.
	* testsuite/libgomp.fortran/lib2.f: Likewise.
	* testsuite/libgomp.fortran/lib3.f: Likewise.

---
 libgomp/testsuite/libgomp.c/lib-1.c        | 2 ++
 libgomp/testsuite/libgomp.fortran/lib1.f90 | 1 +
 libgomp/testsuite/libgomp.fortran/lib2.f   | 1 +
 libgomp/testsuite/libgomp.fortran/lib3.f   | 1 +
 4 files changed, 5 insertions(+)

diff --git libgomp/testsuite/libgomp.c/lib-1.c libgomp/testsuite/libgomp.c/lib-1.c
index 4839cf93..086036d 100644
--- libgomp/testsuite/libgomp.c/lib-1.c
+++ libgomp/testsuite/libgomp.c/lib-1.c
@@ -85,6 +85,8 @@  main (void)
   l = ! omp_in_parallel ();
 #pragma omp parallel reduction (|:l) if (1)
   l = ! omp_in_parallel ();
+  if (l)
+    abort ();
 
   e = omp_get_wtime ();
   if (d > e)
diff --git libgomp/testsuite/libgomp.fortran/lib1.f90 libgomp/testsuite/libgomp.fortran/lib1.f90
index 8840018..e7e1c74 100644
--- libgomp/testsuite/libgomp.fortran/lib1.f90
+++ libgomp/testsuite/libgomp.fortran/lib1.f90
@@ -66,6 +66,7 @@ 
 !$omp parallel reduction (.or.:l) if (.true.)
   l = .not. omp_in_parallel ()
 !$omp end parallel
+  if (l) call abort
 
   e = omp_get_wtime ()
   if (d .gt. e) call abort
diff --git libgomp/testsuite/libgomp.fortran/lib2.f libgomp/testsuite/libgomp.fortran/lib2.f
index 7551082..20db04a 100644
--- libgomp/testsuite/libgomp.fortran/lib2.f
+++ libgomp/testsuite/libgomp.fortran/lib2.f
@@ -66,6 +66,7 @@  C$OMP END PARALLEL
 C$OMP PARALLEL REDUCTION (.OR.:L) IF (.TRUE.)
       L = .NOT. OMP_IN_PARALLEL ()
 C$OMP END PARALLEL
+      IF (L) CALL ABORT
 
       E = OMP_GET_WTIME ()
       IF (D .GT. E) CALL ABORT
diff --git libgomp/testsuite/libgomp.fortran/lib3.f libgomp/testsuite/libgomp.fortran/lib3.f
index fa7b227..264a377 100644
--- libgomp/testsuite/libgomp.fortran/lib3.f
+++ libgomp/testsuite/libgomp.fortran/lib3.f
@@ -66,6 +66,7 @@  C$OMP END PARALLEL
 C$OMP PARALLEL REDUCTION (.OR.:L) IF (.TRUE.)
       L = .NOT. OMP_IN_PARALLEL ()
 C$OMP END PARALLEL
+      IF (L) CALL ABORT
 
       E = OMP_GET_WTIME ()
       IF (D .GT. E) CALL ABORT


libgomp/
	* libgomp.texi (Runtime Library Routines): C linkage, don't throw
	exceptions.

---
 libgomp/libgomp.texi | 2 ++
 1 file changed, 2 insertions(+)

diff --git libgomp/libgomp.texi libgomp/libgomp.texi
index 2985128..f674293 100644
--- libgomp/libgomp.texi
+++ libgomp/libgomp.texi
@@ -132,6 +132,8 @@  three parts:
 
 Control threads, processors and the parallel environment.
 
+They have C linkage, and don't throw exceptions.
+
 @menu
 * omp_get_active_level::        Number of active parallel regions
 * omp_get_ancestor_thread_num:: Ancestor thread ID


contrib/
	* gcc_update (files_and_dependencies): Fix rule for
	libgomp/testsuite/Makefile.in.

---
 contrib/gcc_update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git contrib/gcc_update contrib/gcc_update
index bdf89c4..235c8a9 100755
--- contrib/gcc_update
+++ contrib/gcc_update
@@ -139,7 +139,7 @@  libcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4
 libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4
 libgomp/aclocal.m4: libgomp/configure.ac libgomp/acinclude.m4
 libgomp/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4
-libgomp/testsuite/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4
+libgomp/testsuite/Makefile.in: libgomp/testsuite/Makefile.am libgomp/aclocal.m4
 libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4
 libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4
 libitm/aclocal.m4: libitm/configure.ac libitm/acinclude.m4


libgomp/
	* Makefile.am (omp_lib.mod): Streamline rule.
	* Makefile.in: Regenerate.

---
 libgomp/Makefile.am | 2 +-
 libgomp/Makefile.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git libgomp/Makefile.am libgomp/Makefile.am
index 2bc4986..8cdd6a0 100644
--- libgomp/Makefile.am
+++ libgomp/Makefile.am
@@ -76,7 +76,7 @@  LINK = $(LIBTOOL) --tag CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
 omp_lib_kinds.mod: omp_lib.mod
 	:
 omp_lib.mod: omp_lib.f90
-	$(FC) $(FCFLAGS) -fsyntax-only omp_lib.f90
+	$(FC) $(FCFLAGS) -fsyntax-only $<
 fortran.lo: libgomp_f.h
 fortran.o: libgomp_f.h
 env.lo: libgomp_f.h