diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2010-04-24 20:32:04 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2010-04-24 20:32:04 +0000 |
commit | 8583a5123e24fd75f42d9d1afa610dcce1181623 (patch) | |
tree | bce094af1ae6ff42fe85335230fd8ef39a6ff460 /gcc | |
parent | 423b2799961457c7c494e50a727d612318dccae7 (diff) | |
download | gcc-8583a5123e24fd75f42d9d1afa610dcce1181623.zip gcc-8583a5123e24fd75f42d9d1afa610dcce1181623.tar.gz gcc-8583a5123e24fd75f42d9d1afa610dcce1181623.tar.bz2 |
re PR fortran/30073 (Array out of bounds gives name of RHS array not LHS array)
2010-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/30073
PR fortran/43793
* trans-array.c (gfc_trans_array_bound_check): Use TREE_CODE instead
of mucking with a tree directly.
2010-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/30073
PR fortran/43793
gfortran.dg/pr43793.f90: New test.
From-SVN: r158692
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr43793.f90 | 23 |
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 82d2fe3..a45ba4f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2010-04-24 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/30073 + PR fortran/43793 + * trans-array.c (gfc_trans_array_bound_check): Use TREE_CODE instead + of mucking with a tree directly. + 2010-04-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/43832 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index c3a92bc..1b56189 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -2336,7 +2336,7 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n, name = "unnamed constant"; } - if (descriptor->base.code != COMPONENT_REF) + if (TREE_CODE (descriptor) == VAR_DECL) name = IDENTIFIER_POINTER (DECL_NAME (descriptor)); /* If upper bound is present, include both bounds in the error message. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0133717..db7d77c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-04-24 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/30073 + PR fortran/43793 + gfortran.dg/pr43793.f90: New test. + 2010-04-24 Bernd Schmidt <bernds@codesourcery.com> PR tree-optimization/41442 diff --git a/gcc/testsuite/gfortran.dg/pr43793.f90 b/gcc/testsuite/gfortran.dg/pr43793.f90 new file mode 100644 index 0000000..c30f842 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr43793.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! +! PR fortran/30073 +! PR fortran/43793 +! +! Original code by Joost VandeVondele +! Reduced and corrected code by Steven G. Kargl +! +module fft_tools + implicit none + integer, parameter :: lp = 8 +contains + subroutine sparse_alltoall (rs, rq, rcount) + complex(kind=lp), dimension(:, :), pointer :: rs, rq + integer, dimension(:) :: rcount + integer :: pos + pos = 1 + if (rcount(pos) /= 0) then + rq(1:rcount(pos),pos) = rs(1:rcount(pos),pos) + end if + end subroutine sparse_alltoall +end module fft_tools +! { dg-final { cleanup-modules "fft_tools" } } |