From 01dde9b0e98f435232dd99d8128cd1087066d5ef Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 26 Nov 2013 21:38:10 +0100 Subject: re PR middle-end/59152 (ICE: loop 2's latch does not have an edge to its header with -fopenmp -fipa-pure-const) PR middle-end/59152 * omp-low.c (expand_omp_for_static_chunk): Don't set loop->latch for the inner loop if collapse_bb is non-NULL. (expand_omp_simd): Use cont_bb rather than e->dest as latch. * c-c++-common/gomp/pr59152.c: New test. From-SVN: r205410 --- gcc/omp-low.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/omp-low.c') diff --git a/gcc/omp-low.c b/gcc/omp-low.c index df9cd25..7abe456 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -6491,7 +6491,8 @@ expand_omp_for_static_chunk (struct omp_region *region, { struct loop *loop = alloc_loop (); loop->header = body_bb; - loop->latch = cont_bb; + if (collapse_bb == NULL) + loop->latch = cont_bb; add_loop (loop, trip_loop); } } @@ -6771,7 +6772,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd) { struct loop *loop = alloc_loop (); loop->header = l1_bb; - loop->latch = e->dest; + loop->latch = cont_bb; add_loop (loop, l1_bb->loop_father); if (safelen == NULL_TREE) loop->safelen = INT_MAX; -- cgit v1.1