OSDN Git Service

2008-05-16 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 May 2008 21:05:08 +0000 (21:05 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 May 2008 21:05:08 +0000 (21:05 +0000)
        * 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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135442 138bc75d-0d04-0410-961f-82ee72b054a4

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 ef9f1cf..bc62570 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 71c8b5d..5593289 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 513dbd2..ccae391 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 74fd380..9d1b7aa 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