public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-2489] openmp: Fix ICE when splitting invalid depend(source)/depend(sink:vec)
@ 2022-09-06 7:23 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-09-06 7:23 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:1bf8b7adc2de6f2ddaffa3af131b6855ae3e3793
commit r13-2489-g1bf8b7adc2de6f2ddaffa3af131b6855ae3e3793
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Sep 6 09:21:10 2022 +0200
openmp: Fix ICE when splitting invalid depend(source)/depend(sink:vec)
As we now create OMP_CLAUSE_DOACROSS rather than OMP_CLAUSE_DEPEND when
depend is used with source/sink modifiers, c_omp_split_clauses can see
OMP_CLAUSE_DOACROSS clause too before we diagnose it as erroneous.
The following patch treats it like OMP_CLAUSE_DEPEND during
the splitting but adds an assertion.
2022-09-06 Jakub Jelinek <jakub@redhat.com>
PR c/106836
* c-omp.cc (c_omp_split_clauses): Handle OMP_CLAUSE_DOACROSS.
* c-c++-common/gomp/pr106836.c: New test.
Diff:
---
gcc/c-family/c-omp.cc | 6 ++++++
gcc/testsuite/c-c++-common/gomp/pr106836.c | 9 +++++++++
2 files changed, 15 insertions(+)
diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc
index 56bc4b1bfef..1b086d80581 100644
--- a/gcc/c-family/c-omp.cc
+++ b/gcc/c-family/c-omp.cc
@@ -1877,6 +1877,12 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
case OMP_CLAUSE_DEPEND:
s = C_OMP_CLAUSE_SPLIT_TARGET;
break;
+ case OMP_CLAUSE_DOACROSS:
+ /* This can happen with invalid depend(source) or
+ depend(sink:vec) on target combined with other constructs. */
+ gcc_assert (OMP_CLAUSE_DOACROSS_DEPEND (clauses));
+ s = C_OMP_CLAUSE_SPLIT_TARGET;
+ break;
case OMP_CLAUSE_NUM_TEAMS:
s = C_OMP_CLAUSE_SPLIT_TEAMS;
break;
diff --git a/gcc/testsuite/c-c++-common/gomp/pr106836.c b/gcc/testsuite/c-c++-common/gomp/pr106836.c
new file mode 100644
index 00000000000..6df8250f81c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr106836.c
@@ -0,0 +1,9 @@
+/* PR c/106836 */
+
+void
+foo (void)
+{
+#pragma omp target parallel depend (source) /* { dg-error "'depend\\\(source\\\)' is only allowed in 'omp ordered'" } */
+ ;
+#pragma omp taskwait
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-06 7:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 7:23 [gcc r13-2489] openmp: Fix ICE when splitting invalid depend(source)/depend(sink:vec) 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).