Sorry, I forgot to put the lists in CC.

Paul


---------- Forwarded message ---------
From: Paul Richard Thomas <[email protected]>
Date: Thu, 21 May 2026 at 14:22
Subject: Re: [patch, fortran] Fix PR 125379, ICE with BIND(C) and PRIVATE
To: Thomas Koenig <[email protected]>


Hi Thomas,

I felt sure that an equivalent of gfc_find_symbol_by_name had already
been introduced in another context but I am blowed if I can find it.
It might just be that I did the same for an as yet unfielded patch.

In any case, this looks fine to me and is OK to apply to trunk.

Thanks for sorting this out so promptly.

Regards

Paul


On Thu, 21 May 2026 at 12:06, Thomas Koenig <[email protected]> wrote:
>
> Hello world,
>
> the attached patch regtests cleanly and fixes a recent regression
> introduced by myself and discovered by Jürgen Reuter.
>
> OK for trunk?
>
> Best regards
>
>         Thomas
>
> Fix PR 125379, ICE with BIND(C) and PRIVATE
>
> This fixes a recent regression introduced by my patch for PR 125902. The
> problem was that, for private entities, the symbols cannot be found by
> gfc_find_symbol a gsymbol's namespace.  This patch uses the approach of
> iterating over all the symbols to look for the right name if direct
> lookup fails.
>
> gcc/fortran/ChangeLog:
>
>         * gfortran.h (gfc_find_symbol_by_name): Add prototype.
>         * resolve.cc (gfc_verify_binding_labels): Call gfc_find_symbol_by_name
>         if direct lookup fails.
>         * symbol.cc (compare_target_sym_name): New function.
>         (gfc_find_symbol_by_name): New function.
>
> gcc/testsuite/ChangeLog:
>
>         * gfortran.dg/binding_label_tests_38.f90: New test.

Reply via email to