From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A36553858029; Tue, 9 Jan 2024 10:14:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A36553858029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704795243; bh=DWw/rgkv0A5KyzQDUxa2dbqFrrMZ665bdhGQyNQJsCE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZpA6V2MbfbmwBuomIOmKo5DmvQH5/tbP9TXGUc0om9Ng1xfZ46XZ7dDDychC1R5f9 wRBoTa3gVZKNdepslHc6tzqG0ZBTkH5phj9nwE12m0S1kPuXZEELJn64gQ+PPjddGA xwBeeNFm1XKEfg2RMeb6s3rYs4ooh5nFvRrsPEkc= 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 10:14:03 +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 #7 from GCC Commits --- The releases/gcc-13 branch has been updated by Eric Botcazou : https://gcc.gnu.org/g:36ddb5230f56a30317630a928dd73ed46eda03f1 commit r13-8205-g36ddb5230f56a30317630a928dd73ed46eda03f1 Author: Eric Botcazou Date: Tue Jan 9 11:06:23 2024 +0100 Fix internal error on function call returning extension of limited interface The problem occurs when this function call is the expression of a retur= n in a function returning the limited interface; in this peculiar case, ther= e is a mismatch between the callee, which has BIP formals but is not a BIP c= all, and the caller, which is a BIP function, that is spotted by an assertio= n. This is fixed by restoring the semantics of Is_Build_In_Place_Function_Call, which returns again true only for calls to BIP functions, introducing t= he Is_Function_Call_With_BIP_Formals predicate, which also returns true for calls to functions with BIP formals that are not BIP functions, and mov= ing down the assertion in Expand_Simple_Function_Return. gcc/ada/ PR ada/112781 * exp_ch6.ads (Is_Build_In_Place_Function): Adjust description. * exp_ch6.adb (Is_True_Build_In_Place_Function_Call): Delete. (Is_Function_Call_With_BIP_Formals): New predicate. (Is_Build_In_Place_Function_Call): Restore original semantics. (Expand_Call_Helper): Adjust conditions guarding the calls to Add_Dummy_Build_In_Place_Actuals to above renaming. (Expand_N_Extended_Return_Statement): Adjust to above renaming. (Expand_Simple_Function_Return): Likewise. Move the assertion to after the transformation into an extended return statement. (Make_Build_In_Place_Call_In_Allocator): Remove unreachable cod= e. (Make_Build_In_Place_Call_In_Assignment): Likewise. gcc/testsuite/ * gnat.dg/bip_prim_func2.adb: New test. * gnat.dg/bip_prim_func2_pkg.ads, gnat.dg/bip_prim_func2_pkg.ad= b: New helper package.=