re PR fortran/36825 ([F08] Rank > 7 arrays [will break library ABI] libgfortran...
authorTobias Burnus <burnus@net-b.de>
Thu, 17 Jul 2008 05:54:42 +0000 (07:54 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Thu, 17 Jul 2008 05:54:42 +0000 (07:54 +0200)
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

gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/rank_2.f90

index e36e8089c24bbff3e9f8b5d63bb3124a80238609..5febef3a63b45f92703d32c3653dfde023f0937b 100644 (file)
@@ -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.
index c6bb5e857b9ae69f73772784a308c03bb1a8af3c..1f41701ca966f8cf479a6cbe4d80c24127562cac 100644 (file)
@@ -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)
index 273f2ae746be6f7d17f19f2fb5595b047159477e..a1baa9e8d75e54fb28633fa6b3d030a29209ea84 100644 (file)
@@ -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]))
index 0eb8eaa2bafc8e68931e2a7824b7b07a77e37241..54da1a1b18d683c13ff46dc509296f6d98744530 100644 (file)
@@ -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
index b7d75dbeae418f9752cbb63595335a216b0b0e67..cd52cc446e2cf60940f11cf11fc63ef82c6f7954 100644 (file)
@@ -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