aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/omp-expand.c')
-rw-r--r--gcc/omp-expand.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 159ae0e..496c0e6 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -8433,11 +8433,17 @@ expand_omp_single (struct omp_region *region)
exit_bb = region->exit;
si = gsi_last_nondebug_bb (entry_bb);
- gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_SINGLE
- || gimple_code (gsi_stmt (si)) == GIMPLE_OMP_SCOPE);
+ enum gimple_code code = gimple_code (gsi_stmt (si));
+ gcc_assert (code == GIMPLE_OMP_SINGLE || code == GIMPLE_OMP_SCOPE);
gsi_remove (&si, true);
single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU;
+ if (exit_bb == NULL)
+ {
+ gcc_assert (code == GIMPLE_OMP_SCOPE);
+ return;
+ }
+
si = gsi_last_nondebug_bb (exit_bb);
if (!gimple_omp_return_nowait_p (gsi_stmt (si)))
{