public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4.1] Follow-up to PRs 67504 and 67522
@ 2015-09-10 11:20 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2015-09-10 11:20 UTC (permalink / raw)
  To: gcc-patches

Hi!

This patch repeats PR67504 changes to ordered clause too, and adjusts
PR67522 testcase to also test array reductions.

2015-09-10  Jakub Jelinek  <jakub@redhat.com>

	* parser.c (cp_parser_omp_clause_ordered): Test tree_fits_shwi_p
	before INTEGRAL_TYPE_P test.

	* g++.dg/gomp/pr67504.C (foo): Add test for ordered clause with
	dependent argument.
	* g++.dg/gomp/pr67522.C (foo): Add test for invalid array section
	in reduction clause.

--- gcc/cp/parser.c.jj	2015-09-10 10:45:43.000000000 +0200
+++ gcc/cp/parser.c	2015-09-10 12:03:29.906674538 +0200
@@ -29883,8 +29883,8 @@ cp_parser_omp_clause_ordered (cp_parser
       if (num == error_mark_node)
 	return list;
       num = fold_non_dependent_expr (num);
-      if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
-	  || !tree_fits_shwi_p (num)
+      if (!tree_fits_shwi_p (num)
+	  || !INTEGRAL_TYPE_P (TREE_TYPE (num))
 	  || (n = tree_to_shwi (num)) <= 0
 	  || (int) n != n)
 	{
--- gcc/testsuite/g++.dg/gomp/pr67504.C.jj	2015-09-10 10:45:39.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/pr67504.C	2015-09-10 12:08:35.119031422 +0200
@@ -12,4 +12,8 @@ foo (T x)
   #pragma omp for collapse (x + 1) // { dg-error "collapse argument needs positive constant integer expression" }
   for (int i = 0; i < 10; i++)
     ;
+  #pragma omp for ordered (x + 1) // { dg-error "ordered argument needs positive constant integer expression" }
+  for (int i = 0; i < 10; i++)
+    for (int j = 0; j < 10; j++)
+      ;
 }
--- gcc/testsuite/g++.dg/gomp/pr67522.C.jj	2015-09-10 10:45:39.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/pr67522.C	2015-09-10 12:16:36.681699083 +0200
@@ -17,6 +17,10 @@ foo (void)
 
   #pragma omp task depend (inout: S[0:10])	// { dg-error "is not a variable in" }
   ;
+
+  #pragma omp for reduction (+:S[0:10])		// { dg-error "is not a variable in" }
+  for (int i = 0; i < 16; i++)
+    ;
 }
 
 void

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-10 11:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10 11:20 [gomp4.1] Follow-up to PRs 67504 and 67522 Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).