https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99219
Bug ID: 99219 Summary: Possible wrong code for finalizator call with class via trans_scalar_class_assign ? Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: pault at gcc dot gnu.org Target Milestone: --- [Disclaimer: Not properly checked – but just observed when looking for something else in the code.] class.c has for generate_finalization_wrapper: The generated function has the form _final(assumed-rank array, stride, skip_corarray) But the call in trans-expr.c has in trans_scalar_class_assign: fcn = gfc_vptr_final_get (gfc_class_vptr_get (rse_expr)); ... tmp = build_call_expr_loc (input_location, fcn, 1, class_data); I have not checked more deeply, but it looks as if the second and third arguments are missing? By contrast, trans.c's gfc_add_finalizer_call has: tmp = build_call_expr_loc (input_location, final_fndecl, 3, array, size, fini_coarray ? boolean_true_node : boolean_false_node);