From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E6BF3858C50; Fri, 26 Apr 2024 18:27:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E6BF3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714156045; bh=e/MXumiMsZiHxZH5yya6Ry118yNiILvQk6iQIO8EbU4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rPvZra04VWn4hFk/FubpmG3bjEHUpmq97PUvtShP8aY+1csj9Tvhx3T2DFU9/VVki Ez+5xUAdjFeeHh/CgGcCqBPQpAtLZTJbozxMIEYTJ899GdRErDvqWQes9ozWsJgsez Pyt+g7h1fUs0OvpXPSB9NWD13ShGgm4NOsDbrLbU= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/114859] [14/15 Regression] Seeing new segmentation fault in same_type_as since r14-9752 Date: Fri, 26 Apr 2024 18:27:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114859 --- Comment #10 from Jakub Jelinek --- Ah, the following shows what is happening and shows similar IL changes in t= he *.optimized dump: module m1 type amg_d_base_solver_type contains procedure, pass(sv) :: free =3D> amg_d_base_solver_free end type amg_d_base_solver_type interface subroutine amg_d_base_solver_free(sv,x) import :: amg_d_base_solver_type implicit none class(amg_d_base_solver_type), intent(inout) :: sv integer,intent(inout) :: x end subroutine amg_d_base_solver_free end interface end module m1 module m2 use m1 type amg_d_base_smoother_type class(amg_d_base_solver_type), allocatable :: sv contains procedure, pass(sm) :: free =3D> amg_d_base_smoother_free end type amg_d_base_smoother_type interface subroutine amg_d_base_smoother_free(sm,x) import :: amg_d_base_smoother_type, amg_d_base_solver_type implicit none class(amg_d_base_smoother_type), intent(inout) :: sm integer,intent(inout) :: x end subroutine amg_d_base_smoother_free end interface end module m2 module m3 use m2 type amg_d_onelev_type class(amg_d_base_smoother_type), allocatable :: sm end type amg_d_onelev_type end module m3 subroutine foo (level, save1, info) use m1 use m2 use m3 type(amg_d_onelev_type), intent(inout) :: level class(amg_d_base_smoother_type), allocatable , intent(inout) :: save1 integer,intent(out) :: info info =3D 0 if (allocated(save1)) then call save1%free(info) if (info =3D=3D 0) deallocate(save1,stat=3Dinfo) if (info /=3D 0) return end if allocate(save1, mold=3Dlevel%sm,stat=3Dinfo) end subroutine=