Message ID | 20240808142948.807190-5-poulhies@adacore.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=aFE1TGRo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WfqJ75cWwz1ybS for <incoming@patchwork.ozlabs.org>; Fri, 9 Aug 2024 00:32:23 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C89F385E82D for <incoming@patchwork.ozlabs.org>; Thu, 8 Aug 2024 14:32:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 05397384DEF1 for <gcc-patches@gcc.gnu.org>; Thu, 8 Aug 2024 14:30:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 05397384DEF1 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 05397384DEF1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723127442; cv=none; b=DJno46bFUoCis688//6ENndWdJyX+SIJBjvVhW3wYfiLUSiiOKskIURXvXfgHwLTJhXd6RQskIzHo/fIvvDKuK+Gkz5bG/9GvJ4hD26GSIVbkJwdZ55Pj+8zdLuInZfV3I8za9O14RgmuWKKLQj1k0rrUa71u7QdLMh6PxkVEDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723127442; c=relaxed/simple; bh=5gPFxGyvH4KKHe6XjnRbDOYuk3P4RxvbcpS8lwzkKSs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QSciiJn5ObnuwrBQwxN0asiy0dbNaUyXuFUETHuAzssGPV62wjI/j4WyQ8Zcv4k4mFS9hiZyRLytFUW9xYCcQZWGqmM5+yr54vt9JhgdPMjhPYpyI+gL/ZpSKKC8++WJW7lIScBMdxOCBUA+78wLBkpy1e4JRrubx8agX0nwBc0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so10440135e9.2 for <gcc-patches@gcc.gnu.org>; Thu, 08 Aug 2024 07:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1723127438; x=1723732238; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BmU54caL5Unn2pU4FyexFZth7i64l1cJYrE192ptySQ=; b=aFE1TGRoIoedjDqsitOfUmQc2iDLGSGMjaespFuMailRgxfcga5Jl2cBZSMh/QNPAF AS/+kp4PgfSkA3sbtnq9zS27tNUC4WG4AYXTFlVz8KX3CLZwTGgKff87poYlG3mgkj84 Isj8/CSRZ3lsqURSxqaFBz9B9esKTZXQeMgWxPiZMIJ7vnz0CC1X1K5wBuDvuJrf7kq+ tHWz+dvNSfK8VmZx31BMq7WQew2bFAIk7eeT7yq4Yj5zMseDEcbaIHiolPVJEQOBVu6M KZaoyxP6gwoxjO+F4YqKtmLzNKTvoh9TfD79gD5P0VtSwUuRloXlfgXuQ+QUEFbg3WF8 oHBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723127438; x=1723732238; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BmU54caL5Unn2pU4FyexFZth7i64l1cJYrE192ptySQ=; b=FO+ojyJ+cUPMirjxfkYAOhjFsUZYW7f2xUwdMR9LF261ySfltvlP1PJ6QCX5B1MATm JOJzYxZZrwahTtN5DSZB2nkSIymtx2CUTW3oJ6Xmdbha3bvHeQex6FV/HI0D6p0/sgnn JIxnBo5XnCVMRbWPRyc2EGVxXizLnQ4yQ3OnRWeh8vm0Gt/+t/sVZSphD62SPn2poHAV PgXXyoNNMoAdiAE141yyuhnJO/dxYXpyeCnYQ/2q5+SMiLkkTtpQHydmPLq4NWDvO35j aZczTfX6ANANAUXXYzBQVtP/Ucnkf1a2jJy8G9dyxI1A1nlnQqKpVcj2mr4V2emkjhYU Xpew== X-Gm-Message-State: AOJu0YzNJpdxD+5vzNjGHQR+VBaxCaY4EDW3+/fGSpU56YmbJ5taGutf XXtt6Q8iK99L7flIDiyb0tLG7ElYyIAz80zVPoo2FYgXNrjbksNx8iNMqe0nfMI9bGv22kkRekA vag== X-Google-Smtp-Source: AGHT+IGqheYGs3h9mVmVuzMVzcVXOp4NZkRldKXqq7gXEcOcZC9wtVY02DosszIkNb+aGUOm/Lg0kw== X-Received: by 2002:adf:f70e:0:b0:368:3b5c:7a5d with SMTP id ffacd0b85a97d-36d274ef60dmr1898759f8f.20.1723127437575; Thu, 08 Aug 2024 07:30:37 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4290c72d6c8sm25992015e9.9.2024.08.08.07.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 07:30:37 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Steve Baird <baird@adacore.com> Subject: [COMMITTED 5/6] ada: Etype missing for raise expression Date: Thu, 8 Aug 2024 16:29:47 +0200 Message-ID: <20240808142948.807190-5-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240808142948.807190-1-poulhies@adacore.com> References: <20240808142948.807190-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[COMMITTED,1/6] ada: Finalization_Size raises Constraint_Error
|
expand
|
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 18ec7125cc1..106305f4636 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -443,8 +443,11 @@ package body Exp_Ch4 is begin if Present (Eq) then if Is_Abstract_Subprogram (Eq) then - return Make_Raise_Program_Error (Loc, - Reason => PE_Explicit_Raise); + return Result : constant Node_Id := + Make_Raise_Program_Error (Loc, Reason => PE_Explicit_Raise) + do + Set_Etype (Result, Etype (Eq)); + end return; else return
From: Steve Baird <baird@adacore.com> If the primitive equality operator of the component type of an array type is abstract, then a call to that abstract function raises Program_Error (when such a call is legal). The FE generates a raise expression to implement this. That raise expression is an expression so it should have a valid Etype. gcc/ada/ * exp_ch4.adb (Build_Eq_Call): In the abstract callee case, copy the Etype of the callee onto the Make_Raise_Program_Error result. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)