Re: [PATCH v3] Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]

Steve Kargl <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
On Fri, Feb 20, 2026 at 08:42:28PM +0100, Harald Anlauf wrote:
> Dear all,
> 
> since Gonzalo asked my off-list to do the honors, I pushed his patch for
> him as r16-7604-g84ef4948609260 .
> 

This breaks FreeBSD.  There are 300 or so regressions.
One such regression is

before commit:

% gfcx --version pr96102.f90
GNU Fortran (GCC) 16.0.1 20260117 (experimental)
% gfcx -c pr96102.f90 
pr96102.f90:14:15:

   14 |    integer :: n = 2                ! { dg-error "is host associated" }
      |               1
......
   17 |       if ( n /= 0 ) stop 1    ! { dg-error "internal procedure of the same name" }
      |           2    
Error: 'n' at (1) is host associated at (2) into a contained procedure with an internal procedure of the same name
pr96102.f90:13:20:

   13 |    type(mytype) :: d = mytype (42) ! { dg-error "is host associated" }
      |                    1
......
   18 |       if ( d%i /= 0 ) stop 2  ! { dg-error "internal procedure of the same name" }
      |           2         
Error: 'd' at (1) is host associated at (2) into a contained procedure with an internal procedure of the same name

after commit:

% gfcx --version pr96102.f90
GNU Fortran (GCC) 16.0.1 20260220 (experimental)
 gfcx -c pr96102.f90
f951: internal compiler error: in set_diagnostic_buffer, at buffering.cc:50
0x2790d8b internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:787
0x9dd0bc fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostics/context.cc:1812
0x9dcdf7 diagnostics::context::set_diagnostic_buffer(diagnostics::buffer*)
        ../../gcc/gcc/diagnostics/buffering.cc:50
0xa33c32 gfc_error_opt
        ../../gcc/gcc/fortran/error.cc:792
0xa3500f gfc_error(char const*, ...)
        ../../gcc/gcc/fortran/error.cc:820
0xb0ca18 gfc_add_procedure(symbol_attribute*, procedure_type, char const*, locus*)
        ../../gcc/gcc/fortran/symbol.cc:1892


-- 
Steve
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.