PR fortran/95544 - Fix ICE in NULL() argument to intrinsics
authorHarald Anlauf <anlauf@gmx.de>
Thu, 11 Jun 2020 18:29:45 +0000 (20:29 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 11 Jun 2020 18:29:45 +0000 (20:29 +0200)
commit7fd614ee818983274eb5e47cbb8ec68b20994963
treeaea6cae53ec66c1965fd4e11cfe0d8396fcb63e2
parent1c140cfbfa4b465a29ef26f1fdfef04c671e3c9c
PR fortran/95544 - Fix ICE in NULL() argument to intrinsics

Fortran 2018: An argument to an intrinsic procedure other than ASSOCIATED,
NULL, or PRESENT shall be a data object.  An EXPR_NULL is not a data
object.  Add checks for intrinsics.

2020-06-11  Steven G. Kargl  <kargl@gcc.gnu.org>
    Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
PR fortran/95544
* check.c (invalid_null_arg): Rename to gfc_invalid_null_arg.
(gfc_check_associated, gfc_check_kind, gfc_check_merge)
(gfc_check_shape, gfc_check_size, gfc_check_spread)
(gfc_check_transfer): Adjust.
(gfc_check_len_lentrim, gfc_check_trim): Check for NULL() argument.
* gfortran.h: Declare gfc_invalid_null_arg ().
* intrinsic.c (check_arglist): Check for NULL() argument.
gcc/fortran/check.c
gcc/fortran/gfortran.h
gcc/fortran/intrinsic.c
gcc/testsuite/gfortran.dg/pr95544.f90 [new file with mode: 0644]