diff mbox

Cleanup patches

Message ID 877gdout80.fsf@schwinge.name
State New
Headers show

Commit Message

Thomas Schwinge Oct. 8, 2013, 7:17 a.m. UTC
Hi!

Here are a few cleanup patches, mostly in the realm of OpenMP, so Jakub
gets a CC.  OK to commit?


libgomp/
	* omp.h.in: Don't touch the user's namespace.

---
 libgomp/omp.h.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



Grüße,
 Thomas

Comments

Jakub Jelinek Oct. 8, 2013, 8:04 p.m. UTC | #1
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.

	Jakub
diff mbox

Patch

diff --git libgomp/omp.h.in libgomp/omp.h.in
index 5db4407..ce68163 100644
--- libgomp/omp.h.in
+++ libgomp/omp.h.in
@@ -22,8 +22,8 @@ 
    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef OMP_H
-#define OMP_H 1
+#ifndef _OMP_H
+#define _OMP_H 1
 
 #ifndef _LIBGOMP_OMP_LOCK_DEFINED
 #define _LIBGOMP_OMP_LOCK_DEFINED 1
@@ -104,4 +104,4 @@  int omp_in_final (void) __GOMP_NOTHROW;
 }
 #endif
 
-#endif /* OMP_H */
+#endif /* _OMP_H */


gcc/
	* doc/gimple.texi (is_gimple_omp): Move into the correct section.

---
 gcc/doc/gimple.texi | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git gcc/doc/gimple.texi gcc/doc/gimple.texi
index 896aea3..7bd9fd5 100644
--- gcc/doc/gimple.texi
+++ gcc/doc/gimple.texi
@@ -711,6 +711,10 @@  Return true if g is a @code{GIMPLE_DEBUG} that binds the value of an
 expression to a variable.
 @end deftypefn
 
+@deftypefn {GIMPLE function} bool is_gimple_omp (gimple g)
+Return true if g is any of the OpenMP codes.
+@end deftypefn
+
 @node Manipulating GIMPLE statements
 @section Manipulating GIMPLE statements
 @cindex Manipulating GIMPLE statements
@@ -1846,11 +1850,6 @@  Return a pointer to the data argument for @code{OMP_PARALLEL} @code{G}.
 Set @code{DATA_ARG} to be the data argument for @code{OMP_PARALLEL} @code{G}.
 @end deftypefn
 
-@deftypefn {GIMPLE function} bool is_gimple_omp (gimple stmt)
-Returns true when the gimple statement @code{STMT} is any of the OpenMP
-types.
-@end deftypefn
-
 
 @node @code{GIMPLE_OMP_RETURN}
 @subsection @code{GIMPLE_OMP_RETURN}


gcc/
	* doc/generic.texi (Adding new DECL node types): Explain *_CHECK
	macros.

---
 gcc/doc/generic.texi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git gcc/doc/generic.texi gcc/doc/generic.texi
index cacab01..07e3f5a 100644
--- gcc/doc/generic.texi
+++ gcc/doc/generic.texi
@@ -924,6 +924,11 @@  structures, something like the following should be used
    (BASE_STRUCT_CHECK(NODE)->base_struct.fieldname
 @end smallexample
 
+Reading them from the generated @file{all-tree.def} file (which in
+turn includes all the @file{tree.def} files), @file{gencheck.c} is
+used during GCC's build to generate the @code{*_CHECK} macros for all
+tree codes.
+
 @end table
 
 


The following two patches change the documentation/sources to
consistently talk about subcodes.

gcc/
	* doc/generic.texi (OpenMP): OMP_CLAUSE_* are subcodes, not
	sub-codes.

---
 gcc/doc/generic.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git gcc/doc/generic.texi gcc/doc/generic.texi
index 07e3f5a..ccecd6e 100644
--- gcc/doc/generic.texi
+++ gcc/doc/generic.texi
@@ -2204,7 +2204,7 @@  regular critical section around the expression is used.
 @item OMP_CLAUSE
 
 Represents clauses associated with one of the @code{OMP_} directives.
-Clauses are represented by separate sub-codes defined in
+Clauses are represented by separate subcodes defined in
 @file{tree.h}.  Clauses codes can be one of:
 @code{OMP_CLAUSE_PRIVATE}, @code{OMP_CLAUSE_SHARED},
 @code{OMP_CLAUSE_FIRSTPRIVATE},

gcc/
	* gimple.c: GIMPLE statements have subcodes, not sub-codes.
	* gimple.h: Likewise.

---
 gcc/gimple.c | 4 ++--
 gcc/gimple.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git gcc/gimple.c gcc/gimple.c
index dbcfa3a..4776a7d 100644
--- gcc/gimple.c
+++ gcc/gimple.c
@@ -157,7 +157,7 @@  gimple_set_subcode (gimple g, unsigned subcode)
 
 
 /* Build a tuple with operands.  CODE is the statement to build (which
-   must be one of the GIMPLE_WITH_OPS tuples).  SUBCODE is the sub-code
+   must be one of the GIMPLE_WITH_OPS tuples).  SUBCODE is the subcode
    for the new tuple.  NUM_OPS is the number of operands to allocate.  */
 
 #define gimple_build_with_ops(c, s, n) \
@@ -429,7 +429,7 @@  gimple_build_assign_stat (tree lhs, tree rhs MEM_STAT_DECL)
 }
 
 
-/* Build a GIMPLE_ASSIGN statement with sub-code SUBCODE and operands
+/* Build a GIMPLE_ASSIGN statement with subcode SUBCODE and operands
    OP1 and OP2.  If OP2 is NULL then SUBCODE must be of class
    GIMPLE_UNARY_RHS or GIMPLE_SINGLE_RHS.  */
 
diff --git gcc/gimple.h gcc/gimple.h
index e7021a4..636b9e2 100644
--- gcc/gimple.h
+++ gcc/gimple.h
@@ -81,7 +81,7 @@  enum gimple_rhs_class
 
 /* Specific flags for individual GIMPLE statements.  These flags are
    always stored in gimple_statement_base.subcode and they may only be
-   defined for statement codes that do not use sub-codes.
+   defined for statement codes that do not use subcodes.
 
    Values for the masks can overlap as long as the overlapping values
    are never used in the same statement class.


And then, I noticed that the gcc.dg/gomp testsuite was missing some of
its test source files:

gcc/testsuite/
	* g++.dg/gomp/gomp.exp: Recurse into subdirectories when looking
	for test source files.
	* gcc.dg/gomp/gomp.exp: Likewise.
	* gcc.dg/gomp/appendix-a/a.35.1.c: Expect error.
	* gcc.dg/gomp/appendix-a/a.35.3.c: Likewise.
	* gcc.dg/gomp/appendix-a/a.35.4.c: Likewise.
	* gcc.dg/gomp/appendix-a/a.35.6.c: Likewise.

---
 gcc/testsuite/g++.dg/gomp/gomp.exp            | 4 +++-
 gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c | 2 +-
 gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c | 2 +-
 gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c | 2 +-
 gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c | 2 +-
 gcc/testsuite/gcc.dg/gomp/gomp.exp            | 4 +++-
 6 files changed, 10 insertions(+), 6 deletions(-)

diff --git gcc/testsuite/g++.dg/gomp/gomp.exp gcc/testsuite/g++.dg/gomp/gomp.exp
index d0199cb..e783bdb 100644
--- gcc/testsuite/g++.dg/gomp/gomp.exp
+++ gcc/testsuite/g++.dg/gomp/gomp.exp
@@ -27,7 +27,9 @@  if ![check_effective_target_fopenmp] {
 dg-init
 
 # Main loop.
-g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C $srcdir/c-c++-common/gomp/*.c]] "-fopenmp"
+g++-dg-runtest [lsort [concat \
+	[find $srcdir/$subdir *.C] \
+	[find $srcdir/c-c++-common/gomp *.c]]] "-fopenmp"
 
 # All done.
 dg-finish
diff --git gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c
index 4196b2d..f2c4a67 100644
--- gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c
+++ gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c
@@ -15,7 +15,7 @@  wrong1 (int n)
     for (i = 0; i < n; i++)
       {
 	/* incorrect nesting of loop regions */
-#pragma omp for		/* { dg-warning "may not be closely nested" } */
+#pragma omp for		/* { dg-error "may not be closely nested" } */
 	for (j = 0; j < n; j++)
 	  work (i, j);
       }
diff --git gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c
index 31b2ddf..64005b3 100644
--- gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c
+++ gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c
@@ -12,7 +12,7 @@  wrong3 (int n)
     for (i = 0; i < n; i++)
       {
 /* incorrect nesting of regions */
-#pragma omp single	/* { dg-warning "may not be closely nested" } */
+#pragma omp single	/* { dg-error "may not be closely nested" } */
 	work (i, 0);
       }
   }
diff --git gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c
index d7579e6..5bb6b80 100644
--- gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c
+++ gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c
@@ -11,7 +11,7 @@  wrong4 (int n)
       {
 	work (i, 0);
 	/* incorrect nesting of barrier region in a loop region */
-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
+#pragma omp barrier	/* { dg-error "may not be closely nested" } */
 	work (i, 1);
       }
   }
diff --git gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c
index ac850e5..d18188b 100644
--- gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c
+++ gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c
@@ -9,7 +9,7 @@  wrong6 (int n)
     {
       work (n, 0);
 /* incorrect nesting of barrier region in a single region */
-#pragma omp barrier	/* { dg-warning "may not be closely nested" } */
+#pragma omp barrier	/* { dg-error "may not be closely nested" } */
       work (n, 1);
     }
   }
diff --git gcc/testsuite/gcc.dg/gomp/gomp.exp gcc/testsuite/gcc.dg/gomp/gomp.exp
index ca8aefd..cc2cd8e 100644
--- gcc/testsuite/gcc.dg/gomp/gomp.exp
+++ gcc/testsuite/gcc.dg/gomp/gomp.exp
@@ -29,7 +29,9 @@  if ![check_effective_target_fopenmp] {
 dg-init
 
 # Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common/gomp/*.c]] "" "-fopenmp"
+dg-runtest [lsort [concat \
+	[find $srcdir/$subdir *.c] \
+	[find $srcdir/c-c++-common/gomp *.c]]] "" "-fopenmp"
 
 # All done.
 dg-finish

Plus, the following patch is needed on gomp-4_0-branch:

gcc/testsuite/
	* gcc.dg/gomp/appendix-a/a.35.5.c: Expect error.

---
 gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c
index 7b53015..7b4aee1 100644
--- gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c
+++ gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c
@@ -9,7 +9,7 @@  wrong5 (int n)
     {
       work (n, 0);
 /* incorrect nesting of barrier region in a critical region */
-#pragma omp barrier
+#pragma omp barrier	/* { dg-error "may not be closely nested" } */
       work (n, 1);
     }
   }