https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110618
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Mikael Morin <mik...@gcc.gnu.org>: https://gcc.gnu.org/g:1a46400e5ac0f21eead74b10752f69ebc7a8be27 commit r14-2579-g1a46400e5ac0f21eead74b10752f69ebc7a8be27 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Mon Jul 17 14:14:18 2023 +0200 fortran: Use pre-evaluated class container if available [PR110618] Add the possibility to provide a pre-evaluated class container argument to gfc_add_finalizer to avoid repeatedly evaluating data reference expressions in the generated code. PR fortran/110618 gcc/fortran/ChangeLog: * trans.h (gfc_add_finalizer_call): Add class container argument. * trans.cc (gfc_add_finalizer_call): Ditto. Pass down new argument to get_final_proc_ref, get_elem_size, get_var_desc, and get_vptr. (get_elem_size): Add class container argument. Use provided class container if it's available. (get_var_descr): Same. (get_vptr): Same. (get_final_proc_ref): Same. Add boolean telling the class container argument is used. Set it. Don't try to use final_wrapper if class container argument was used.