From: Janus Weil Date: Sat, 23 Jul 2011 14:44:22 +0000 (+0200) Subject: re PR fortran/49708 (ICE with allocate and no dimensions) X-Git-Tag: releases/gcc-4.5.4~515 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d5c5d031603401901ede330db34fc07e81de299;p=thirdparty%2Fgcc.git re PR fortran/49708 (ICE with allocate and no dimensions) 2011-07-23 Janus Weil PR fortran/49708 * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers. 2011-07-23 Janus Weil PR fortran/49708 * gfortran.dg/allocate_error_3.f90: New. From-SVN: r176688 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4a9037b08bfb..28d574a46765 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2011-07-23 Janus Weil + + PR fortran/49708 + * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers. + 2011-06-02 Thomas Koenig Backport from trunk diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index d102357645f6..1c606a3033cf 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 37f04001d3bb..04275808f2f0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-23 Janus Weil + + PR fortran/49708 + * gfortran.dg/allocate_error_3.f90: New. + 2011-07-22 Rainer Orth 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 index 000000000000..7616caad3809 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/allocate_error_3.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! +! PR 49708: [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions +! +! Contributed by + + real, pointer :: x(:) + allocate(x) ! { dg-error "Array specification required" } +end