+2022-09-24 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/107001
+ * omp-low.cc (lower_omp_taskgroup): Don't add GOMP_RETURN statement
+ at the end.
+ * omp-expand.cc (build_omp_regions_1): Clarify GF_OMP_TARGET_KIND_DATA
+ is not stand-alone directive. For GIMPLE_OMP_TASKGROUP, also don't
+ update parent.
+ (omp_make_gimple_edges) <case GIMPLE_OMP_TASKGROUP>: Reset
+ cur_region back after new_omp_region.
+
2022-09-23 Thomas Schwinge <thomas@codesourcery.com>
Backport from master branch:
case GF_OMP_TARGET_KIND_OACC_ENTER_DATA:
case GF_OMP_TARGET_KIND_OACC_EXIT_DATA:
case GF_OMP_TARGET_KIND_OACC_DECLARE:
- /* ..., other than for those stand-alone directives... */
+ /* ..., other than for those stand-alone directives...
+ To be precise, target data isn't stand-alone, but
+ gimplifier put the end API call into try finally block
+ for it, so omp expansion can treat it as such. */
region = NULL;
break;
default:
&& gimple_omp_task_taskwait_p (stmt))
/* #pragma omp taskwait depend(...) is a stand-alone directive. */
region = NULL;
+ else if (code == GIMPLE_OMP_TASKGROUP)
+ /* #pragma omp taskgroup isn't a stand-alone directive, but
+ gimplifier put the end API call into try finall block
+ for it, so omp expansion can treat it as such. */
+ region = NULL;
/* ..., this directive becomes the parent for a new region. */
if (region)
parent = region;
case GIMPLE_OMP_MASTER:
case GIMPLE_OMP_MASKED:
case GIMPLE_OMP_SCOPE:
- case GIMPLE_OMP_TASKGROUP:
case GIMPLE_OMP_CRITICAL:
case GIMPLE_OMP_SECTION:
cur_region = new_omp_region (bb, code, cur_region);
fallthru = true;
break;
+ case GIMPLE_OMP_TASKGROUP:
+ cur_region = new_omp_region (bb, code, cur_region);
+ fallthru = true;
+ cur_region = cur_region->outer;
+ break;
+
case GIMPLE_OMP_TASK:
cur_region = new_omp_region (bb, code, cur_region);
fallthru = true;
gimple_bind_add_seq (bind, gimple_omp_body (stmt));
gimple_omp_set_body (stmt, NULL);
- gimple_bind_add_stmt (bind, gimple_build_omp_return (true));
gimple_bind_add_seq (bind, dseq);
pop_gimplify_context (bind);
+2022-09-24 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-09-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/107001
+ * c-c++-common/gomp/pr107001.c: New test.
+
2022-09-24 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline: