re PR middle-end/42029 (ICE with complex data type and openmp for reduction clause)

PR middle-end/42029
	* gimplify.c (gimplify_omp_atomic): Set DECL_GIMPLE_REG_P on
	tmp_load if needed.

	* libgomp.c/pr42029.c: New test.

From-SVN: r154162
This commit is contained in:
Jakub Jelinek 2009-11-13 19:42:32 +01:00 committed by Jakub Jelinek
parent 8e2f53ef6e
commit 54ef1db76c
4 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-11-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/42029
* gimplify.c (gimplify_omp_atomic): Set DECL_GIMPLE_REG_P on
tmp_load if needed.
2009-11-11 Kai Tietz <kai.tietz@onevision.com>
Backported from trunk

View File

@ -6134,6 +6134,8 @@ gimplify_omp_atomic (tree *expr_p, gimple_seq *pre_p)
tree tmp_load;
tmp_load = create_tmp_var (type, NULL);
if (TREE_CODE (type) == COMPLEX_TYPE || TREE_CODE (type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp_load) = 1;
if (goa_stabilize_expr (&rhs, pre_p, addr, tmp_load) < 0)
return GS_ERROR;

View File

@ -1,3 +1,8 @@
2009-11-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/42029
* libgomp.c/pr42029.c: New test.
2009-10-15 Release Manager
* GCC 4.4.2 released.

View File

@ -0,0 +1,19 @@
/* PR middle-end/42029 */
/* { dg-do run } */
extern void abort (void);
int
main ()
{
int i;
_Complex int c = 0;
#pragma omp parallel for private(i) reduction(+:c)
for (i = 0; i < 8; ++i)
c += 1;
if (c != 8)
abort ();
return 0;
}