Commit a5c8d67f by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/26412 (ICE with external arrays using OpenMP)

	PR middle-end/26412
	* gimplify.c (omp_add_variable): Guard variable size decl test with
	DECL_SIZE (decl) check.

	* gcc.dg/gomp/pr26412.c: New test.

From-SVN: r111391
parent 98b2060a
2006-02-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/26412
* gimplify.c (omp_add_variable): Guard variable size decl test with
DECL_SIZE (decl) check.
2006-02-23 Richard Guenther <rguenther@suse.de> 2006-02-23 Richard Guenther <rguenther@suse.de>
PR middle-end/26439 PR middle-end/26439
......
...@@ -4267,7 +4267,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags) ...@@ -4267,7 +4267,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags)
/* When adding a variable-sized variable, we have to handle all sorts /* When adding a variable-sized variable, we have to handle all sorts
of additional bits of data: the pointer replacement variable, and of additional bits of data: the pointer replacement variable, and
the parameters of the type. */ the parameters of the type. */
if (!TREE_CONSTANT (DECL_SIZE (decl))) if (DECL_SIZE (decl) && !TREE_CONSTANT (DECL_SIZE (decl)))
{ {
/* Add the pointer replacement variable as PRIVATE if the variable /* Add the pointer replacement variable as PRIVATE if the variable
replacement is private, else FIRSTPRIVATE since we'll need the replacement is private, else FIRSTPRIVATE since we'll need the
......
2006-02-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/26412
* gcc.dg/gomp/pr26412.c: New test.
2006-02-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-02-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/26291 PR c++/26291
/* PR middle-end/26412 */
/* { dg-do compile } */
extern double a[];
extern int b;
double
test (void)
{
int i;
double c = 0;
#pragma omp parallel for private(i) reduction(+:c)
for (i = 0; i < 10000; i++)
c += a[b];
return c;
}
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