From 81bcd96bc783c921e866e4e9afcf9c02549ab53c Mon Sep 17 00:00:00 2001 From: Dominique d'Humieres Date: Mon, 1 Jul 2013 09:53:55 +0200 Subject: [PATCH] re PR fortran/54788 (ICE on pointer-array element assignment) 2013-07-01 Dominique d'Humieres PR fortran/54788 * array.c (spec_size): handle the case as==NULL. 2013-07-01 Dominique d'Humieres PR fortran/54788 * gfortran.dg/pointer_remapping_8.f90: New. From-SVN: r200575 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/array.c | 2 +- gcc/testsuite/ChangeLog | 15 ++++++++++----- gcc/testsuite/gfortran.dg/pointer_remapping_8.f90 | 10 ++++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pointer_remapping_8.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 75197255a54..f85e2ebfa6b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2013-07-01 Dominique d'Humieres + + PR fortran/54788 + * array.c (spec_size): handle the case as==NULL. + 2013-06-26 Tobias Burnus PR fortran/29800 diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index c6b8eb9f96a..f07bc64dbca 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -2084,7 +2084,7 @@ spec_size (gfc_array_spec *as, mpz_t *result) mpz_t size; int d; - if (as->type == AS_ASSUMED_RANK) + if (!as || as->type == AS_ASSUMED_RANK) return false; mpz_init_set_ui (*result, 1); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5c09364a80a..2a0fa811282 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-07-01 Dominique d'Humieres + + PR fortran/54788 + * gfortran.dg/pointer_remapping_8.f90: New. + 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net> * g++.dg/cpp0x/udlit-nospace-neg.C: Adjust. @@ -38,11 +43,11 @@ 2013-06-28 Kirill Yukhin - * gcc.target/i386/bmi-1.c: Extend with new instrinsic. - Fix scan patterns. - * gcc.target/i386/bmi-1.c: Ditto. - * gcc.target/i386/bmi-bextr-4.c: New. - * gcc.target/i386/bmi-bextr-5.c: Ditto. + * gcc.target/i386/bmi-1.c: Extend with new instrinsic. + Fix scan patterns. + * gcc.target/i386/bmi-1.c: Ditto. + * gcc.target/i386/bmi-bextr-4.c: New. + * gcc.target/i386/bmi-bextr-5.c: Ditto. 2013-06-28 Paolo Carlini diff --git a/gcc/testsuite/gfortran.dg/pointer_remapping_8.f90 b/gcc/testsuite/gfortran.dg/pointer_remapping_8.f90 new file mode 100644 index 00000000000..94fe6c553ef --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pointer_remapping_8.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! +! PR 54788 ICE on pointer-array element assignment +! +program bug + integer, pointer :: a(:) + integer :: b + allocate(a(0:0)) + a(0:0) => b ! { dg-error "Rank remapping target must be rank 1 or simply contiguous" } +end