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: r154161
This commit is contained in:
Jakub Jelinek 2009-11-13 19:38:36 +01:00
parent 8410737add
commit 2b32c27d98
4 changed files with 34 additions and 2 deletions

View File

@ -1,8 +1,14 @@
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-13 Uros Bizjak <ubizjak@gmail.com>
PR target/41900
(*call_pop_1, *call_1, *call_value_pop_1, *call_value_1): Use "lsm"
as operand 1 constraint.
* config/i386/i386.md (*call_pop_1, *call_1, *call_value_pop_1,
*call_value_1): Use "lsm" as operand 1 constraint.
* config/i386/predicates.md (call_insn_operand): Depend on
index_register_operand to avoid %esp register.

View File

@ -6231,6 +6231,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-26 Jakub Jelinek <jakub@redhat.com>
* acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Avoid using too many

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;
}