re PR fortran/89174 (Allocation segfault with CLASS(*) MOLD)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 24 Feb 2019 22:49:47 +0000 (22:49 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 24 Feb 2019 22:49:47 +0000 (22:49 +0000)
commit4afe82523f19171fb0a67fab5ec80c8f645db517
tree15d890f60a78e20ebf11013e77630181130508cf
parent28d08ad204087e2c9e979d8dc94daba7ac4c63a3
re PR fortran/89174 (Allocation segfault with CLASS(*) MOLD)

2019-02-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/89174
* trans-expr.c (gfc_find_and_cut_at_last_class_ref): Add is_mold
to garguments. If we are dealing with a MOLD, call
gfc_expr_to_initialize().
* trans-stmt.c (gfc_trans_allocate): For MOLD, pass is_mold=true
to gfc_find_and_cut_at_last_class_ref.
* trans.h (gfc_find_and_cut_at_last_class_ref): Add optional
argument is_mold with default false.

2019-02-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/89174
* gfortran.dg/allocate_with_mold_3.f90: New test.

From-SVN: r269179
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/allocate_with_mold_3.f90 [new file with mode: 0644]