Commit a7a53ca5 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/29629 (ICE on OpenMP-enabled program (gfc_conv_variable, at…

re PR fortran/29629 (ICE on OpenMP-enabled program (gfc_conv_variable, at fortran/trans-expr.c:404))

	PR fortran/29629
	* trans-openmp.c (gfc_trans_omp_array_reduction): Set attr.flavor
	of init_val_sym and outer_sym to FL_VARIABLE.

	* testsuite/libgomp.fortran/pr29629.f90: New test.

From-SVN: r118134
parent 3a057207
2006-10-29 Jakub Jelinek <jakub@redhat.com>
PR fortran/29629
* trans-openmp.c (gfc_trans_omp_array_reduction): Set attr.flavor
of init_val_sym and outer_sym to FL_VARIABLE.
2006-10-29 Kazu Hirata <kazu@codesourcery.com> 2006-10-29 Kazu Hirata <kazu@codesourcery.com>
* intrinsic.texi: Fix a typo. * intrinsic.texi: Fix a typo.
......
...@@ -300,6 +300,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) ...@@ -300,6 +300,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
init_val_sym.ts = sym->ts; init_val_sym.ts = sym->ts;
init_val_sym.attr.referenced = 1; init_val_sym.attr.referenced = 1;
init_val_sym.declared_at = where; init_val_sym.declared_at = where;
init_val_sym.attr.flavor = FL_VARIABLE;
backend_decl = omp_reduction_init (c, gfc_sym_type (&init_val_sym)); backend_decl = omp_reduction_init (c, gfc_sym_type (&init_val_sym));
init_val_sym.backend_decl = backend_decl; init_val_sym.backend_decl = backend_decl;
...@@ -308,6 +309,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) ...@@ -308,6 +309,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
outer_sym.as = gfc_copy_array_spec (sym->as); outer_sym.as = gfc_copy_array_spec (sym->as);
outer_sym.attr.dummy = 0; outer_sym.attr.dummy = 0;
outer_sym.attr.result = 0; outer_sym.attr.result = 0;
outer_sym.attr.flavor = FL_VARIABLE;
outer_sym.backend_decl = create_tmp_var_raw (TREE_TYPE (decl), NULL); outer_sym.backend_decl = create_tmp_var_raw (TREE_TYPE (decl), NULL);
/* Create fake symtrees for it. */ /* Create fake symtrees for it. */
......
2006-10-29 Jakub Jelinek <jakub@redhat.com>
PR fortran/29629
* testsuite/libgomp.fortran/pr29629.f90: New test.
2006-10-24 Eric Botcazou <ebotcazou@libertysurf.fr> 2006-10-24 Eric Botcazou <ebotcazou@libertysurf.fr>
PR libgomp/29494 PR libgomp/29494
......
! PR fortran/29629
! { dg-do run }
program pr29629
integer :: n
n = 10000
if (any (func(n).ne.10000)) call abort
contains
function func(n)
integer, intent(in) :: n
integer, dimension(n) :: func
integer :: k
func = 0
!$omp parallel do private(k), reduction(+:func), num_threads(4)
do k = 1, n
func = func + 1
end do
!$omp end parallel do
end function
end program
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