PR fortran/100154 - ICE in gfc_conv_procedure_call, at fortran/trans-expr.c:6131
authorHarald Anlauf <anlauf@gmx.de>
Sat, 24 Apr 2021 18:51:41 +0000 (20:51 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sat, 24 Apr 2021 18:51:41 +0000 (20:51 +0200)
commitd0e7833b94953ba6b4a915150666969ad9fc66af
tree1f8b3e8bce8cbe30efc499db4d766df4e36cc1f4
parent32c4d970ea3a9fc330d6aa8fd83f9dae0b9afc64
PR fortran/100154 - ICE in gfc_conv_procedure_call, at fortran/trans-expr.c:6131

Add appropriate static checks for the character and status arguments to
the GNU Fortran intrinsic extensions fget[c], fput[c].  Extend variable
check to allow a function reference having a data pointer result.

gcc/fortran/ChangeLog:

PR fortran/100154
* check.c (variable_check): Allow function reference having a data
pointer result.
(arg_strlen_is_zero): New function.
(gfc_check_fgetputc_sub): Add static check of character and status
arguments.
(gfc_check_fgetput_sub): Likewise.
* intrinsic.c (add_subroutines): Fix argument name for the
character argument to intrinsic subroutines fget[c], fput[c].

gcc/testsuite/ChangeLog:

PR fortran/100154
* gfortran.dg/pr100154.f90: New test.
gcc/fortran/check.c
gcc/fortran/intrinsic.c
gcc/testsuite/gfortran.dg/pr100154.f90 [new file with mode: 0644]