aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2008-07-17 07:54:42 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2008-07-17 07:54:42 +0200
commitbdad068304fad30f7082d9e7e6076a1e2ee1c2cf (patch)
tree7c27b8443697acbc5006880c4e3b22f8ddef9623
parent2ae421dd9bed6eb2f8bb6b1c9906577755682618 (diff)
downloadgcc-bdad068304fad30f7082d9e7e6076a1e2ee1c2cf.zip
gcc-bdad068304fad30f7082d9e7e6076a1e2ee1c2cf.tar.gz
gcc-bdad068304fad30f7082d9e7e6076a1e2ee1c2cf.tar.bz2
re PR fortran/36825 ([F08] Rank > 7 arrays [will break library ABI] libgfortran I/O+intrinsics:)
2008-07-17 Tobias Burnus <burnus@net-b.de> PR fortran/36825 PR fortran/36824 * array.c (gfc_match_array_spec): Fix array-rank check. * resolve.c (resolve_fl_derived): Fix constentness check for the array dimensions. 2008-07-17 Tobias Burnus <burnus@net-b.de> PR fortran/36825 PR fortran/36824 * gfortran.dg/rank_2.f90: Add additional array-rank test. * gfortran.dg/array_4.f90: New. From-SVN: r137910
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/array.c2
-rw-r--r--gcc/fortran/resolve.c2
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/rank_2.f904
5 files changed, 21 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index e36e808..5febef3 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-17 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36825
+ PR fortran/36824
+ * array.c (gfc_match_array_spec): Fix array-rank check.
+ * resolve.c (resolve_fl_derived): Fix constentness check
+ for the array dimensions.
+
2008-07-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Make-lang.in (gfortranspec.o): Fix dependencies.
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index c6bb5e8..1f41701 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -437,7 +437,7 @@ gfc_match_array_spec (gfc_array_spec **asp)
goto cleanup;
}
- if (as->rank > 7
+ if (as->rank >= 7
&& gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Array "
"specification at %C with more than 7 dimensions")
== FAILURE)
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 273f2ae..a1baa9e 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -7682,8 +7682,8 @@ resolve_fl_derived (gfc_symbol *sym)
for (i = 0; i < c->as->rank; i++)
{
if (c->as->lower[i] == NULL
- || !gfc_is_constant_expr (c->as->lower[i])
|| (resolve_index_expr (c->as->lower[i]) == FAILURE)
+ || !gfc_is_constant_expr (c->as->lower[i])
|| c->as->upper[i] == NULL
|| (resolve_index_expr (c->as->upper[i]) == FAILURE)
|| !gfc_is_constant_expr (c->as->upper[i]))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0eb8eaa2..54da1a1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-17 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36825
+ PR fortran/36824
+ * gfortran.dg/rank_2.f90: Add additional array-rank test.
+ * gfortran.dg/array_4.f90: New.
+
2008-07-17 H.J. Lu <hongjiu.lu@intel.com>
PR testsuite/36443
diff --git a/gcc/testsuite/gfortran.dg/rank_2.f90 b/gcc/testsuite/gfortran.dg/rank_2.f90
index b7d75db..cd52cc4 100644
--- a/gcc/testsuite/gfortran.dg/rank_2.f90
+++ b/gcc/testsuite/gfortran.dg/rank_2.f90
@@ -5,4 +5,8 @@
! Fortran 2008 allows 15 dimensions (including co-array ranks)
!
integer :: a(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ! { dg-error "more than 7 dimensions" }
+
+! PR fortran/36825:
+integer,parameter :: N=10
+complex,dimension(-N:N,-N:N,0:1,0:1,-N:N,-N:N,0:1,0:1) :: P ! { dg-error "more than 7 dimensions" }
end