[Bug fortran/103508] [PDT] ICE in gfc_find_symtree, at fortran/symbol.c:2979
kargls at comcast dot net
gcc-bugzilla@gcc.gnu.org
Sun Sep 21 16:29:16 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103508
--- Comment #5 from kargls at comcast dot net ---
(In reply to kargls from comment #4)
> (In reply to Paul Thomas from comment #3)
> > (In reply to G. Steinmetz from comment #1)
> > > This is the working version :
> > >
> > Indeed!
> >
> > 15-branch now emits:
> > pr103508.f90:12:9:
> >
> > 12 | end
> > | 1
> > Error: END BLOCK statement expected at (1)
> > (null):0: confused by earlier errors, bailing out
> >
> > whereas mainline emits the error and goes into an infinite loop.
> >
> > Oddly, this non-PDT version does the same:
> > program p
> > type t
> > integer :: n = 1
> > character(3) :: c
> > end type
> > block
> > block
> > type(t) :: x
> > x%c = 'abc'
> > print *, len(x%c)
> > end
> > end
> > end
>
> The above compiles if one uses labeled block statements.
>
> % cat oi.f90
> program p
> type t
> integer :: n = 1
> character(3) :: c
> end type
> one: block
> two: block
> type(t) :: x
> x%c = 'abc'
> print *, len(x%c)
> end block two
> end block one
> end
>
> % gfcx -o z oi.f90 && ./z
> 3
>
> Likely, getting confused by the nested unlabeled construct.
Gerhard's example with PDT also works with labeled block constructs.
More information about the Gcc-bugs
mailing list