This patch handles an ICE that is thrown in omp_expand_metadirective when a
basic_block for a metadirective label is tried to be deleted multiple times.
To avoid this situation, processed labels are added to the already existing
list of labels that are not intended to be deleted.
The issue occured in the attached test case.
gcc/ChangeLog:
* omp-expand-metadirective.cc (omp_expand_metadirective): Add already
processed labels to "labels" (the list of labels not to be deleted).
gcc/testsuite/ChangeLog:
* c-c++-common/gomp/metadirective-8.c: New test.
+2022-11-01 Marcel Vollweiler <marcel@codesourcery.com>
+
+ * omp-expand-metadirective.cc (omp_expand_metadirective): Add already
+ processed labels to "labels" (the list of labels not to be deleted).
+
2022-11-01 Andrew Stubbs <ams@codesourcery.com>
Backport from mainline:
{
edge e = find_edge (bb, label_to_block (fun, label));
remove_edge_and_dominated_blocks (e);
+ labels.safe_push (label);
}
}
+2022-11-01 Marcel Vollweiler <marcel@codesourcery.com>
+
+ * c-c++-common/gomp/metadirective-8.c: New test.
+
2022-10-28 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
--- /dev/null
+/* { dg-do compile } */
+
+#define N 256
+
+void f ()
+{
+ int i;
+ int a[N];
+
+ #pragma omp metadirective \
+ when( device={kind(nohost)}: nothing ) \
+ when( device={arch("nvptx")}: nothing) \
+ default( parallel for)
+ for (i = 0; i < N; i++)
+ a[i] = i;
+}