diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2013-02-09 09:49:49 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2013-02-09 09:49:49 +0000 |
commit | 52880d11ce08fc59999823524667a7f135e7dbac (patch) | |
tree | 1eff89f0fe9ef46f3f6294a4a5a54bf040ab4708 /gcc | |
parent | 59ac9a555ea3a6fde282e135a7dc7546a6e06b5f (diff) | |
download | gcc-52880d11ce08fc59999823524667a7f135e7dbac.zip gcc-52880d11ce08fc59999823524667a7f135e7dbac.tar.gz gcc-52880d11ce08fc59999823524667a7f135e7dbac.tar.bz2 |
re PR fortran/55362 (ICE with size() on character pointer)
2013-02-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55362
* check.c (array_check): It is an error if a procedure is
passed.
2013-02-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55362
* gfortran.dg/intrinsic_size_4.f90 : New test.
From-SVN: r195915
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/check.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/intrinsic_size_4.f90 | 18 |
4 files changed, 31 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 6505704..52b610d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-02-09 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/55362 + * check.c (array_check): It is an error if a procedure is + passed. + 2013-02-08 Mikael Morin <mikael@gcc.gnu.org> PR fortran/54107 @@ -8,7 +14,7 @@ 2013-02-07 Tobias Burnus <burnus@net-b.de> - PR fortran/54339 + PR fortran/54339 * gfortran.texi (Standards): Mention TS29113. (Varying Length Character): Mention deferred-length strings. diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 8bd0645..0e71b95 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -256,7 +256,7 @@ array_check (gfc_expr *e, int n) return SUCCESS; } - if (e->rank != 0) + if (e->rank != 0 && e->ts.type != BT_PROCEDURE) return SUCCESS; gfc_error ("'%s' argument of '%s' intrinsic at %L must be an array", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 557c8fe..69d7a15 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-02-09 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/55362 + * gfortran.dg/intrinsic_size_4.f90 : New test. + 2013-02-09 Jakub Jelinek <jakub@redhat.com> PR target/56256 diff --git a/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90 b/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90 new file mode 100644 index 0000000..6d8e1c0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90 @@ -0,0 +1,18 @@ +! { dg-do compile } +! Test the fix for PR55362; the error below was missed and an ICE ensued. +! +! ! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr> +! +program ice_test + implicit none + write(*,*) 'message: ', & + size(Error_Msg),Error_Msg() ! { dg-error "must be an array" } + write(*,*) 'message: ', & + size(Error_Msg ()),Error_Msg() ! OK of course +contains + function Error_Msg() result(ErrorMsg) + character, dimension(:), pointer :: ErrorMsg + character, dimension(1), target :: str = '!' + ErrorMsg => str + end function Error_Msg +end program ice_test |