From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 324343858D20; Wed, 17 Apr 2024 07:10:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 324343858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713337817; bh=rvAVNPjK+lkLtRZ0yR1DHS6ZomSGb34pQ2q8OhXbIQU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=blzIesmlQDKAlRyxXWX5JYkKX7q5YGdmYP14HpdNkK+kJA5DV5CJskTb65dfiQIQx TOFtZ4Ay3rjsE9Wa2CcDaZYyqwA8pNni0SKYLYy2i0CC6oAIzrwhglEjGiUIou/FiJ v70hbRMJyUfUSscZNOGQ+Q8rAA9gfOcCOTo0kPuI= From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/103312] [11/12/13/14 Regression] ICE in gfc_find_component since r9-1098-g3cf89a7b992d483e Date: Wed, 17 Apr 2024 07:10:15 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pault at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc assigned_to attachments.created 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=3D103312 Paul Thomas changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gn= u.org --- Comment #6 from Paul Thomas --- Created attachment 57969 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57969&action=3Dedit Partial fix for the PR The supplied testcase generates completely blank derived type symbols for t= he _vptr component of 'this' in 'func'. The chunk in resolve.cc fixes that. The rest of the patch allows the full testcase below to blast through to translation, where it dies in trans-decl.cc - again with blanks symbols in = the default initializer this time. Of the compilers to which I have access, only NAG succeeds with the full testcase. If this%size() is replaced with a constant expression or an integ= er dummy argument, all compilers succeed, including current versions of gfortr= an. I have taken it but need to get on with daytime work for a few days. Paul module example type, abstract :: foo integer :: i contains procedure(foo_size), deferred :: size procedure(foo_func), deferred :: func end type interface function foo_func (this) result (string) import :: foo class(foo) :: this character(this%size()) :: string end function pure integer function foo_size (this) import foo class(foo), intent(in) :: this end function end interface end module module extension use example implicit none type, extends(foo) :: bar ! integer :: i contains procedure :: size procedure :: func end type contains pure integer function size (this) class(bar), intent(in) :: this size =3D this%i end function function func (this) result (string) class(bar) :: this character(this%size()) :: string string =3D repeat ("x", len (string)) end function end module use example use extension type(bar) :: a a%i =3D 5 print *, a%func() end=