mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-24 11:24:05 +08:00
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
This commit is contained in:
parent
3a0572072d
commit
a7a53ca582
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
* intrinsic.texi: Fix a typo.
|
||||
|
@ -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.attr.referenced = 1;
|
||||
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));
|
||||
init_val_sym.backend_decl = backend_decl;
|
||||
|
||||
@ -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.attr.dummy = 0;
|
||||
outer_sym.attr.result = 0;
|
||||
outer_sym.attr.flavor = FL_VARIABLE;
|
||||
outer_sym.backend_decl = create_tmp_var_raw (TREE_TYPE (decl), NULL);
|
||||
|
||||
/* Create fake symtrees for it. */
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR libgomp/29494
|
||||
|
20
libgomp/testsuite/libgomp.fortran/pr29629.f90
Normal file
20
libgomp/testsuite/libgomp.fortran/pr29629.f90
Normal file
@ -0,0 +1,20 @@
|
||||
! 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
|
Loading…
Reference in New Issue
Block a user