On Thu, 14 Sep 2023 17:13:02 +0200 Bernhard Reutner-Fischer via Gcc-patches <gcc-patc...@gcc.gnu.org> wrote:
> On Tue, 5 Sep 2023 12:28:28 -0700 > Julian Brown <jul...@codesourcery.com> wrote: > > > + static bool > > + equal (const omp_name_type<gfc_typespec *> &a, > > + const omp_name_type<gfc_typespec *> &b) > > + { > > + if (a.name == NULL_TREE && b.name == NULL_TREE) > > + return a.type == b.type; > > I'm curious if (and why) the type comparison above is safe and does > not use gfc_compare_types () ? > > thanks, Probably ignorance on my part! It works for (derived, class) types which are canonicalized to exactly the same gfc_typespec, but you're likely right that a more Fortran-ish notion of type equality should be used here instead when comparing "declare mapper"s. Or maybe using gfc_compare_types would smush too many types together into one? E.g. if b.type is an extension of a.type, do we want those types to be able to have separate mappers? I'll have a look at addressing this when it's time to reroll these patches. Thanks, Julian