libgfortran.h: Increase GFC_MAX_DIMENSIONS to 15.
authorTobias Burnus <burnus@net-b.de>
Fri, 16 May 2008 21:05:08 +0000 (23:05 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Fri, 16 May 2008 21:05:08 +0000 (23:05 +0200)
2008-05-16  Tobias Burnus  <burnus@net-b.de>

        * libgfortran.h: Increase GFC_MAX_DIMENSIONS to 15.
        * array.c (gfc_match_array_spec): Error with -std=f2003 if rank > 7.

2008-05-16  Tobias Burnus  <burnus@net-b.de>

        * gfortran.dg/rank_1.f90
        * gfortran.dg/rank_2.f90

From-SVN: r135442

gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/fortran/libgfortran.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/rank_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/rank_2.f90 [new file with mode: 0644]

index ef9f1cfe35c1b435b40bc3ec9836494d42beb75f..bc62570a7e46a1b762675b34aff54cc87da9ead3 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-16  Tobias Burnus  <burnus@net-b.de>
+
+       * libgfortran.h: Increase GFC_MAX_DIMENSIONS to 15.
+       * array.c (gfc_match_array_spec): Error with -std=f2003 if rank > 7.
+
 2008-04-16  Daniel Kraft  <d@domob.eu>
 
        PR fortran/27997
index 71c8b5d669e0a42528255716c3f4c4584867ca30..5593289a9104a78e00ea4545c7253211b32c43ee 100644 (file)
@@ -437,6 +437,12 @@ gfc_match_array_spec (gfc_array_spec **asp)
          goto cleanup;
        }
 
+      if (as->rank > 7
+         && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Array "
+                            "specification at %C with more than 7 dimensions")
+            == FAILURE)
+       goto cleanup;
+
       as->rank++;
     }
 
index 513dbd228ab23ce9d76819682605d4f23ce589af..ccae391aebb48d32524ef50f7f32078178f0c910 100644 (file)
@@ -88,7 +88,7 @@ libgfortran_error_codes;
 #define GFC_STDERR_UNIT_NUMBER 0
 
 
-#define GFC_MAX_DIMENSIONS 7
+#define GFC_MAX_DIMENSIONS 15
 
 #define GFC_DTYPE_RANK_MASK 0x07
 #define GFC_DTYPE_TYPE_SHIFT 3
index 74fd38089097874d2bc0f32600017ef448330a9a..9d1b7aa02086dde5dae288bf1bdf648d3008939e 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-16  Tobias Burnus  <burnus@net-b.de>
+
+       * gfortran.dg/rank_1.f90
+       * gfortran.dg/rank_2.f90
+
 2008-05-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        * gfortran.dg/missing_parens_1.f90: Update test.
diff --git a/gcc/testsuite/gfortran.dg/rank_1.f90 b/gcc/testsuite/gfortran.dg/rank_1.f90
new file mode 100644 (file)
index 0000000..3467fad
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! { dg-options "-std=f2008" }
+!
+! Fortran < 2008 allows 7  dimensions
+! 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)
+integer :: b(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ! { dg-error "has more than 15 dimensions" }
+end
diff --git a/gcc/testsuite/gfortran.dg/rank_2.f90 b/gcc/testsuite/gfortran.dg/rank_2.f90
new file mode 100644 (file)
index 0000000..b7d75db
--- /dev/null
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! Fortran < 2008 allows 7  dimensions
+! 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" }
+end