Restrict host association symbol skipping to derived types.
Fixes PR126210 by ensuring host association symbol skipping only applies to derived types.
The recent fix for PR126170 in read_module() incorrectly skipped re-importing any symbol already visible via host association from the same module, if matched by name. This commit refines that behavior, ensuring that symbol skipping now only occurs when the matched symbol is specifically a derived type, thus resolving PR126210 and preventing unintended omissions of other symbol types.
In Details
The read_module function in gcc/fortran/module.cc was modified to ensure that symbols already visible via host association from the same module are only skipped for re-import if they are derived types. This change rectifies an overzealous application of PR126170's fix, which had incorrectly broadened the scope of symbol skipping beyond its intended target.
- host association
- A Fortran feature where entities declared in a host program unit (e.g., a main program or module) are accessible within a contained subprogram or derived type definition without requiring explicit argument passing or procedure calls.
- derived type
- A user-defined composite data type in Fortran, analogous to a struct or class in other languages. It can contain components of various intrinsic or other derived types.
- PR126170
- A bug report identifier. These are used internally by the GCC project to track specific issues, bugs, or feature requests. This commit addresses a related issue, PR126210.