re PR middle-end/60682 ([OpenMP] ICE on an assignment of local variable inside SIMD loop)

PR middle-end/60682
	* omp-low.c (lower_omp_1): For gimple_clobber_p stmts,
	if they need regimplification, just drop them instead of
	calling gimple_regimplify_operands on them.

	* g++.dg/gomp/pr60682.C: New test.

From-SVN: r208864
This commit is contained in:
Jakub Jelinek 2014-03-27 14:18:52 +01:00 committed by Jakub Jelinek
parent 82bb2e4069
commit 47519a1446
4 changed files with 70 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2014-03-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/60682
* omp-low.c (lower_omp_1): For gimple_clobber_p stmts,
if they need regimplification, just drop them instead of
calling gimple_regimplify_operands on them.
2014-03-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
PR target/60580

View File

@ -10124,7 +10124,20 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
if ((ctx || task_shared_vars)
&& walk_gimple_op (stmt, lower_omp_regimplify_p,
ctx ? NULL : &wi))
gimple_regimplify_operands (stmt, gsi_p);
{
/* Just remove clobbers, this should happen only if we have
"privatized" local addressable variables in SIMD regions,
the clobber isn't needed in that case and gimplifying address
of the ARRAY_REF into a pointer and creating MEM_REF based
clobber would create worse code than we get with the clobber
dropped. */
if (gimple_clobber_p (stmt))
{
gsi_replace (gsi_p, gimple_build_nop (), true);
break;
}
gimple_regimplify_operands (stmt, gsi_p);
}
break;
}
}

View File

@ -1,3 +1,8 @@
2014-03-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/60682
* g++.dg/gomp/pr60682.C: New test.
2014-03-27 John David Anglin <danglin@gcc.gnu.org>
* gcc.dg/torture/pr60092.c: Remove default dg-skip-if arguments.

View File

@ -0,0 +1,44 @@
// PR middle-end/60682
// { dg-do compile }
// { dg-options "-O2 -fopenmp-simd" }
struct A
{
float a;
A () {}
A (const A &x) { a = x.a; }
};
struct B
{
A a[16];
};
struct C
{
float a[1];
C () {}
C (const C &x) { a[0] = x.a[0]; }
};
struct D
{
C a[16];
};
void
foo (int x, B &y, D &z)
{
#pragma omp simd
for (int i = 0; i < x; ++i)
{
A a;
y.a[i] = a;
}
#pragma omp simd
for (int i = 0; i < x; ++i)
{
C a;
z.a[i] = a;
}
}