Commit 01dde9b0 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/59152 (ICE: loop 2's latch does not have an edge to its header…

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
parent da719a9f
2013-11-26 Jakub Jelinek <jakub@redhat.com>
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.
2013-11-26 Bernd Edlinger <bernd.edlinger@hotmail.de>
Remove parameter keep_aligning from get_inner_reference.
......@@ -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;
......
2013-11-26 Jakub Jelinek <jakub@redhat.com>
PR middle-end/59152
* c-c++-common/gomp/pr59152.c: New test.
2013-11-26 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/gomp/openmp-simd-1.c: Cleanup original tree dump.
......
/* PR middle-end/59152 */
/* { dg-do compile } */
/* { dg-options "-fopenmp -fipa-pure-const" } */
extern int b[];
void
foo (void)
{
unsigned long v1, v2, v3;
#pragma omp parallel for schedule(static, 32) collapse(3)
for (v1 = 0; v1 < 20; v1 += 2)
for (v2 = __LONG_MAX__; v2 > __LONG_MAX__ - 30; v2 -= 3)
for (v3 = 10; v3 > 0; v3--)
#pragma omp atomic
b[v3]++;
}
void
bar (void)
{
unsigned long v1, v2, v3;
#pragma omp parallel for schedule(static) collapse(3)
for (v1 = 0; v1 < 20; v1 += 2)
for (v2 = __LONG_MAX__; v2 > __LONG_MAX__ - 30; v2 -= 3)
for (v3 = 10; v3 > 0; v3--)
#pragma omp atomic
b[v3]++;
}
void
baz (void)
{
unsigned long v1, v2, v3;
#pragma omp parallel for schedule(runtime) collapse(3)
for (v1 = 0; v1 < 20; v1 += 2)
for (v2 = __LONG_MAX__; v2 > __LONG_MAX__ - 30; v2 -= 3)
for (v3 = 10; v3 > 0; v3--)
#pragma omp atomic
b[v3]++;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment