From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1D9A385841B; Tue, 9 Jan 2024 09:49:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1D9A385841B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704793778; bh=vj5pipFybmWEbbTG28eBVsu/u/+gzaYJy1BHjUchIoc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RRGAXPVOuf/rThpccEOPcKuN9kYFHIYDs5V48kiHYFqa7ugRUWybm6VuCC6SVtokn LAbBwlXKgOG7asbJHxJQA6RPjmsJmjjK2yql9RUFx6FbK9g1+47/SnWfDg9e6RHAJJ hLY38oHmST+fBhejQwrNevfvW8ZaPQQePoHwe8J0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/112781] [13/14 regression] internal error on function call returning extension of limited interface Date: Tue, 09 Jan 2024 09:49:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D112781 --- Comment #4 from GCC Commits --- The master branch has been updated by Eric Botcazou : https://gcc.gnu.org/g:436ce7a3510000e0939094592fc12353e17527f1 commit r14-7031-g436ce7a3510000e0939094592fc12353e17527f1 Author: Eric Botcazou Date: Tue Jan 9 10:46:23 2024 +0100 Fix internal error on function call returning extension of limited interface This is a regression present on the mainline and 13 branch, in the form= of a series of internal errors (3) on a function call returning the extensio= n of a limited interface. This is only a partial fix for the first two assertion failures; the th= ird one is the most problematic and will be dealt with separately. The first issue is in Instantiate_Type, where we use Base_Type in a specific case to compute the ancestor of a derived type, which will later trigger the assertion on line 16960 of sem_ch3.adb since Parent_Base and Generic_Ac= tual are the same node. This is changed to use Etype like in other cases around. The second issue is an unprotected use of Designated_Type on type T in Analyze_Explicit_Dereference, while another use in an equivalent context is guarded by Is_Access_Type a few lines above. gcc/ada PR ada/112781 * sem_ch12.adb (Instantiate_Type): Use Etype instead of Base_Ty= pe consistently to retrieve the ancestor for a derived type. * sem_ch4.adb (Analyze_Explicit_Dereference): Test Is_Access_Ty= pe consistently before accessing Designated_Type.=