[fortran] ICE assign character pointer to non target PR93714
authorMark Eggleston <markeggleston@gcc.gnu.org>
Tue, 18 Feb 2020 15:54:13 +0000 (15:54 +0000)
committerMark Eggleston <markeggleston@gcc.gnu.org>
Tue, 18 Feb 2020 15:54:13 +0000 (15:54 +0000)
commit06119d691e27e25fd4f4486467ad95f7b545fde3
treeb9c03f0e0c5fb9d25dbba9d92efb98427e8c8bd8
parentfa1160f6e50500aa38162fefb43bfb10c25e0363
[fortran] ICE assign character pointer to non target PR93714

An ICE occurred if an attempt was made to assign a pointer to a
character variable that has an length incorrectly specified using
a real constant and does not have the target attribute.

gcc/fortran/ChangeLog

PR fortran/93714
* expr.c (gfc_check_pointer_assign): Move check for
matching character length to after checking the lvalue
attributes for target or pointer.

gcc/testsuite/ChangeLog

PR fortran/93714
* gfortran.dg/char_pointer_assign_6.f90: Look for no target
message instead of length mismatch.
* gfortran.dg/pr93714_1.f90
* gfortran.dg/pr93714_2.f90
gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/char_pointer_assign_6.f90
gcc/testsuite/gfortran.dg/pr93714_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pr93714_2.f90 [new file with mode: 0644]