summaryrefslogtreecommitdiff
path: root/gcc/omp-expand.c
diff options
context:
space:
mode:
authorCesar Philippidis <cesar@codesourcery.com>2018-04-16 11:01:09 -0700
committerTom de Vries <vries@gcc.gnu.org>2018-04-16 18:01:09 +0000
commit05e0af43867f79ab6f2e9ad7664ec969ad484890 (patch)
tree77bb51f57a7a4946543700ee8edc336f786b0a87 /gcc/omp-expand.c
parent2d4e0a12089d6bfe5079df70f0618c925bee79e8 (diff)
[openacc] Fix ICE when compiling tile loop containing infinite loop
2018-04-16 Cesar Philippidis <cesar@codesourcery.com> Tom de Vries <tom@codesourcery.com> PR middle-end/84955 * omp-expand.c (expand_oacc_for): Add dummy false branch for tiled basic blocks without omp continue statements. * testsuite/libgomp.oacc-c-c++-common/pr84955.c: New test. * testsuite/libgomp.oacc-fortran/pr84955.f90: New test. Co-Authored-By: Tom de Vries <tom@codesourcery.com> From-SVN: r259406
Diffstat (limited to 'gcc/omp-expand.c')
-rw-r--r--gcc/omp-expand.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index bb204906ea6..c7d30ea3964 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -5439,6 +5439,14 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd)
split->flags ^= EDGE_FALLTHRU | EDGE_TRUE_VALUE;
+ /* Add a dummy exit for the tiled block when cont_bb is missing. */
+ if (cont_bb == NULL)
+ {
+ edge e = make_edge (body_bb, exit_bb, EDGE_FALSE_VALUE);
+ e->probability = profile_probability::even ();
+ split->probability = profile_probability::even ();
+ }
+
/* Initialize the user's loop vars. */
gsi = gsi_start_bb (elem_body_bb);
expand_oacc_collapse_vars (fd, true, &gsi, counts, e_offset);