re PR fortran/83344 (Use of uninitialized memory with ASSOCIATE and strings)
authorPaul Thomas <pault@gcc.gnu.org>
Mon, 19 Feb 2018 22:09:13 +0000 (22:09 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Mon, 19 Feb 2018 22:09:13 +0000 (22:09 +0000)
commit5c60dbc14b42430d8bcf1d347d3fc655d242b84e
tree6cc61d1ee188ac070aa47e36dba8c05370e5b2bc
parent00b94487352ad836f175eb288fea31d91426b080
re PR fortran/83344 (Use of uninitialized memory with ASSOCIATE and strings)

2018-02-19  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83344
PR fortran/83975
* resolve.c (resolve_assoc_var): Rearrange the logic for the
determination of the character length of associate names. If
the associate name is missing a length expression or the length
expression is not a constant and the target is not a variable,
make the associate name allocatable and deferred length.
* trans-decl.c (gfc_get_symbol_decl): Null the character length
backend_decl for deferred length associate names that are not
variables. Set 'length' to gfc_index_zero_node for character
associate names, whose character length is a PARM_DECL.

2018-02-19  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83344
PR fortran/83975
* gfortran.dg/associate_22.f90: Enable commented out test.
* gfortran.dg/associate_36.f90: New test.

From-SVN: r257827
gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/associate_22.f90
gcc/testsuite/gfortran.dg/associate_36.f90 [new file with mode: 0644]