The problem is that inside the main program, y = f(z) where the the result of z is type(t) :: z(size(x%a)) and 'x' is a dummy argument. 'x' looses the attr.dummy in gfc_add_interface_mapping and this leads to an additional indirect ref in gfc_maybe_dereference_var - but after the first indirect ref, TREE_TYPE is alread a RECORD_TYPE ... The simple fix is to simply punt when the argument is not a pointer or reference. This patch additionally fixes a comment in conv_parent_component_references. Those parts are obvious. The only potentially risky change is the comparison change from a name-wise comparison to a pointer-based comparison. I think it is fine and the testsuite did not find any issue, but you prefer, I can also exclude it. OK for mainline? How about GCC 10/11 backports? (I think leaving out the last change, it should be very safe to do.) Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955