The attached code produces a segmentation fault when including the non_overridable attribute in t2. $ gfortran --version GNU Fortran (GCC) 4.10.0 20140508 (experimental) $ ./bhg Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7F46D0A23797 #1 0x7F46D0A23D64 #2 0x7F46CFF5453F #3 0x0 module m implicit none type, abstract :: t1 integer :: i contains procedure(i_f), pass(u), deferred :: ff end type t1 type, abstract, extends(t1) :: t2 contains procedure, non_overridable, pass(u) :: ff => f ! Segmentation fault !procedure, pass(u) :: ff => f ! works end type t2 type, extends(t2) :: t3 end type t3 abstract interface subroutine i_f(u) import :: t1 class(t1), intent(inout) :: u end subroutine i_f end interface contains subroutine f(u) class(t2), intent(inout) :: u u%i = 3*u%i end subroutine f end module m program p use m implicit none class(t1), allocatable :: v allocate(t3::v) v%i = 2 call v%ff() write(*,*) v%i end program p
Confirmed from 4.7 up to trunk (4.10). Likely related to pr61115.
I think this is the same problem as PR78443. The fix posted there also fixes the test case here. *** This bug has been marked as a duplicate of bug 78443 ***