https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117264
--- Comment #10 from Vladimir Terzi <vterzi1996 at gmail dot com> --- (In reply to anlauf from comment #9) > After some search, I found a gfortran 13.3.0 (openSUSE 15.5, r13-8781), > that fails also for > > program p > type,abstract::t > end type t > type,extends(t)::tt > end type tt > class(t),allocatable::o > o=f() > contains > function f() result(r) ! works > class(t), allocatable :: r > r=tt() > end > end > > the same as for the example in comment#0. > > Note that it works with 12.3.0 and 12.4.1, 13.3.1 (at r13-9145), > 14.2.1 (at r14-10831), and 15-trunk. It looks like a temporary regression. > > Can you update your compiler installation? I updated GCC to version 14.2.0, and got another error for the code in the first post (compiled with `-O0 -g`): ``` In file 'a.f90', around line 8: Error allocating 17510029503779062109 bytes: Cannot allocate memory Error termination. Backtrace: #0 0x400858 in p at a.f90:7 #1 0x4009d1 in main at a.f90:7 ``` And sometimes this error: ``` Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7f80f4a42b7f in ??? #1 0x400810 in p at a.f90:7 #2 0x4009d1 in main at a.f90:7 Segmentation fault (core dumped) ``` It's not deterministic.