Fix failures with -m32 and some memory leaks.
authorPaul Thomas <pault@gcc.gnu.org>
Sat, 26 Dec 2020 15:08:11 +0000 (15:08 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sat, 26 Dec 2020 15:08:11 +0000 (15:08 +0000)
commit0175d45d14b1f9ebc4c15ea5bafcda655c37fc35
tree90de4c38ecc0351f94f38bab0097c74a633596e8
parent9d426e4dbccf1548f2d11866fe18af04af4109de
Fix failures with -m32 and some memory leaks.

2020-12-23  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/83118
* trans-array.c (gfc_alloc_allocatable_for_assignment): Make
sure that class expressions are captured for dummy arguments by
use of gfc_get_class_from_gfc_expr otherwise the wrong vptr is
used.
* trans-expr.c (gfc_get_class_from_gfc_expr): New function.
(gfc_get_class_from_expr): If a constant expression is
encountered, return NULL_TREE;
(gfc_trans_assignment_1): Deallocate rhs allocatable components
after passing derived type function results to class lhs.
* trans.h : Add prototype for gfc_get_class_from_gfc_expr.
gcc/fortran/trans-array.c
gcc/fortran/trans-expr.c
gcc/fortran/trans.h