From: Janus Weil Date: Tue, 19 Jul 2011 12:38:59 +0000 (+0200) Subject: re PR fortran/49708 (ICE with allocate and no dimensions) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b21a544bb1a94f29adc4fc812cda0766b9a048e9;p=gcc.git re PR fortran/49708 (ICE with allocate and no dimensions) 2011-07-19 Janus Weil PR fortran/49708 * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers. 2011-07-19 Janus Weil PR fortran/49708 * gfortran.dg/allocate_error_3.f90: New. From-SVN: r176447 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a469ac9aa57..5d8cc6476c1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2011-07-19 Janus Weil + + PR fortran/49708 + * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers. + 2011-07-18 Tobias Burnus * trans-decl.c (gfc_build_qualified_array): Make coarray's diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 53f45e85b8d..71e0ba062f5 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6886,7 +6886,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code) gfc_find_derived_vtab (ts.u.derived); } - if (pointer || (dimension == 0 && codimension == 0)) + if (dimension == 0 && codimension == 0) goto success; /* Make sure the last reference node is an array specifiction. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d87ce8d7464..4e77decb5b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-19 Janus Weil + + PR fortran/49708 + * gfortran.dg/allocate_error_3.f90: New. + 2011-07-19 Richard Guenther * gcc.dg/tree-ssa/bool-10.c: Adjust expected pattern. 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 00000000000..7616caad380 --- /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