public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix up ICE with linear on questionable testcase (PR middle-end/67517)
@ 2015-09-10  8:01 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2015-09-10  8:01 UTC (permalink / raw)
  To: gcc-patches

Hi!

The spec is unclear how to handle this yet, so I'm committing an easy fix,
perhaps the right one will be to deal with the wrapping of inner linear into
outer firstprivate/lastprivate and/or shared during clause splitting in the
FEs.

Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk
and 5 branch.

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

	PR middle-end/67517
	* gimplify.c (gimplify_scan_omp_clauses): Instead of
	asserting that decl is not specified in octx->variables,
	break out of the loop if it is.

	* c-c++-common/gomp/pr67517.c: New test.

--- gcc/gimplify.c.jj	2015-09-09 13:16:14.000000000 +0200
+++ gcc/gimplify.c	2015-09-09 14:20:59.255606297 +0200
@@ -6214,9 +6214,12 @@ gimplify_scan_omp_clauses (tree *list_p,
 		    }
 		  else
 		    break;
-		  gcc_checking_assert (splay_tree_lookup (octx->variables,
-							  (splay_tree_key)
-							  decl) == NULL);
+		  if (splay_tree_lookup (octx->variables,
+					 (splay_tree_key) decl) != NULL)
+		    {
+		      octx = NULL;
+		      break;
+		    }
 		  flags = GOVD_SEEN;
 		  if (!OMP_CLAUSE_LINEAR_NO_COPYIN (c))
 		    flags |= GOVD_FIRSTPRIVATE;
--- gcc/testsuite/c-c++-common/gomp/pr67517.c.jj	2015-09-09 15:36:55.972319265 +0200
+++ gcc/testsuite/c-c++-common/gomp/pr67517.c	2015-09-09 15:35:37.000000000 +0200
@@ -0,0 +1,13 @@
+/* PR middle-end/67517 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int
+foo (int x, int y, int z)
+{
+  int i;
+  #pragma omp parallel for simd linear (y : x & 15) linear (x : 16) linear (z : x & 15)
+  for (i = 0; i < 256; ++i)
+    x += 16, y += x & 15, z += x & 15;
+  return x + y + z;
+}

	Jakub

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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10  8:01 [PATCH] Fix up ICE with linear on questionable testcase (PR middle-end/67517) 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).