OSDN Git Service

2007-12-16 Thomas Koenig <tkoenig@gcc.gnu.org>
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Dec 2007 21:09:34 +0000 (21:09 +0000)
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Dec 2007 21:09:34 +0000 (21:09 +0000)
PR fortran/34305
* resolve.c (compare_bound):  If either of the types of
the arguments isn't INTEGER, return CMP_UNKNOWN.

2007-12-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/34305
* gfortran.dg/real_dimension_1.f:  New test case.

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

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/real_dimension_1.f [new file with mode: 0644]

index ac72fb2..cf54102 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/34305
+       * resolve.c (compare_bound):  If either of the types of
+       the arguments isn't INTEGER, return CMP_UNKNOWN.
+
 2007-12-16  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/34246
index 0df0aa7..57c17dc 100644 (file)
@@ -3149,8 +3149,11 @@ compare_bound (gfc_expr *a, gfc_expr *b)
       || b == NULL || b->expr_type != EXPR_CONSTANT)
     return CMP_UNKNOWN;
 
+  /* If either of the types isn't INTEGER, we must have
+     raised an error earlier.  */
+
   if (a->ts.type != BT_INTEGER || b->ts.type != BT_INTEGER)
-    gfc_internal_error ("compare_bound(): Bad expression");
+    return CMP_UNKNOWN;
 
   i = mpz_cmp (a->value.integer, b->value.integer);
 
index f25a036..82411bd 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/34305
+       * gfortran.dg/real_dimension_1.f:  New test case.
+
 2007-12-16  Rask Ingemann Lambertsen  <rask@sygehus.dk>
 
        * gcc.dg/torture/pr24257.c: Remove -O from options.
diff --git a/gcc/testsuite/gfortran.dg/real_dimension_1.f b/gcc/testsuite/gfortran.dg/real_dimension_1.f
new file mode 100644 (file)
index 0000000..73e9131
--- /dev/null
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR 34305 - make sure there's an error message for specifying a
+      program test
+      parameter (datasize = 1000) 
+      dimension idata (datasize)  ! { dg-error "must be of INTEGER type|must have constant shape" }
+      idata (1) = -1
+      end