]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/49708 (ICE with allocate and no dimensions)
authorJanus Weil <janus@gcc.gnu.org>
Sat, 23 Jul 2011 14:44:22 +0000 (16:44 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Sat, 23 Jul 2011 14:44:22 +0000 (16:44 +0200)
2011-07-23  Janus Weil  <janus@gcc.gnu.org>

PR fortran/49708
* resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.

2011-07-23  Janus Weil  <janus@gcc.gnu.org>

PR fortran/49708
* gfortran.dg/allocate_error_3.f90: New.

From-SVN: r176688

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

index 4a9037b08bfb6339488c74c38172478ed1d5b575..28d574a46765e3c183d556f465b8d32f675b4d45 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-23  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/49708
+       * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.
+
 2011-06-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        Backport from trunk
index d102357645f631ef361d9c7a5decf9d0567ba112..1c606a3033cf4f339305fed84aed5d79130ca181 100644 (file)
@@ -6402,7 +6402,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
        }
     }
 
-  if (pointer || dimension == 0)
+  if (dimension == 0)
     return SUCCESS;
 
   /* Make sure the next-to-last reference node is an array specification.  */
index 37f04001d3bb68d788708337ce7ad3c2f0139067..04275808f2f088b8377d3c6ab3f51b1aa441ae66 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-23  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/49708
+       * gfortran.dg/allocate_error_3.f90: New.
+
 2011-07-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR debug/47393
diff --git a/gcc/testsuite/gfortran.dg/allocate_error_3.f90 b/gcc/testsuite/gfortran.dg/allocate_error_3.f90
new file mode 100644 (file)
index 0000000..7616caa
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do compile }
+!
+! PR 49708: [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
+!
+! Contributed by <fnordxyz@yahoo.com>
+
+  real, pointer :: x(:)
+  allocate(x)            ! { dg-error "Array specification required" }
+end