https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111952
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2025-12-04
--- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #1)
> What is the expected behavior?
>
> $ ./a.out
> At line 22 of file allocator.f90
> Fortran runtime error: Attempting to allocate already allocated variable 'x'
>
> Is it expected that the variable is deallocated upon exit from the
> subroutine?
OH I see now. If I comment out all the DTIO related lines, the error goes away.
I should note that flang accepts it all as you expected.
The definitions of DTIO procedures should not affect automatic deallocation.