Re: [PATCH] Bug 123375 - Fortran ICE in insert_bbt while building crest package since r16-2189

Harald Anlauf <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
Am 18.01.26 um 3:48 AM schrieb Jerry D:
> This patch from Steve regression tested on x86_64.
> 
> Looks good to me. (see the PR)
> 
> I will commit some time tomorrow.
> 
> Regards,
> 
> Jerry
> 
> Author: Steven G. Kargl <[email protected]>
> Date:   Sat Jan 17 18:30:44 2026 -0800
> 
>      Fortran: Fix ICE on invalid code
> 
>      This patch tests whether a symbol imported into an interface
>      is already available in local scope.
> 
>              PR fortran/123375
> 
>      gcc/fortran/ChangeLog:
> 
>              * decl.cc (gfc_match_import): Check that imported entity 
> within
>              a interface is not from local scope.
> 
>      gcc/testsuite/ChangeLog:
> 
>              * gfortran.dg/import.f90: Run code testing for a warning that
>              is now an error.
>              * gfortran.dg/pr123375.f90: New test.
> 

Hi Jerry,

technically speaking, the following error may confuse users as it
is a little misleading:

    module bar3
       implicit none
       interface
          subroutine bah
             use foo
             import aa      ! { dg-error "already in the local scope" }
          end subroutine bah
       end interface
    end module bar3

aa is not available in the host, as detected by other compilers
(e.g. NAG), but I think we can live with it.

Otherwise OK from my side.

Thanks for the patch!

Harald
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.