From patchwork Fri Aug 2 07:11:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1968198 Return-Path: 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=VX0PqiF1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4WZxvQ174zz1yYq for ; Fri, 2 Aug 2024 17:16:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5849C385F018 for ; Fri, 2 Aug 2024 07:16:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 628233860743 for ; Fri, 2 Aug 2024 07:12:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 628233860743 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 628233860743 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582762; cv=none; b=BkMuLnuEHpkGHxFc4N8rMXozxppwrSG/FdotmyawF/CH5ae94W8DNzp1CV8QIMyUv5CYbtO82E+6NTjzAIIYOarHXLBkfvzs7mLau4RuGOSz0pIJrFNKCKqP2uJGfI3yKKZYWuyDOzTaFNsELMYqpealVqxl4b9rkrfDXXrsYQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722582762; c=relaxed/simple; bh=h/AE+ts9NzHs3mEGp18ezGSY+m5+VZZFf2gJVMhDl7c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gcQ1iM1hI/iHOz8R7oricftGTyC7AO8mmLjNengii+cFtG/JzrJjMgoEsgVFOsTb0Ipt76gwtwCOEtSlXcQ1vBM2grfq9HmMWkjel0MJUv6G+SC1GlW/c4RDpcrQXhDKukA7Przbn2MTBK27f4TWEwRZXkVkapfypUUokZNfiAs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-367ab76d5e1so3160118f8f.3 for ; Fri, 02 Aug 2024 00:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722582759; x=1723187559; 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=A6aWcGJUhBDN7Ejl8TU0EtYVfCju+bRK5HqCtDRezM8=; b=VX0PqiF1KnjJsYHeAn4Gs7NikprZ3SNJWKYENNDIscI9AdDzVVIL3Lt8rYE/crK+Jo yHLkukDInEPPxTBTPGJvV0qSofZ90ED8ADJW8m8864xEwNICb7RiYN6hNaloxHdyhVwZ Rwhy7TO4/J9BqYohTn8PunQj2bB1SHuk1dGKN8zo4tNBS2zLCTBYmkaOkTNEIxLC/VA7 ys5zaRLlzOM/sgUBm0MJtJK/PT/K0To/t8wNkOTRlTpNeVOchAQcMRwLriwuOmznBt7K De38RFybwgg/tms5CySXjQn+RzWGm7fUybXgwMaUIcrjKWe7ftiaQpjUh6OwRX5triH2 QVPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722582759; x=1723187559; 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=A6aWcGJUhBDN7Ejl8TU0EtYVfCju+bRK5HqCtDRezM8=; b=fZeoFwpf82cGUYaroaPyI6IPLuK81ORujgtMRh1Ffryy53UJv4VUQElwPBIF1UKvpB zerNkvH1OTLhNZNgFdYb3vKhGqnuq+XAFz4r65r/j2ts57fyppkVujBzm2NtDWtgfLa1 Qk5mIUnb7oLoYiDFi0fq6tgOFjCUVybGMDHxP2NQwrOMfYNwicRgSQotBXJ+mLfYr6g9 atzuF3YG7Knn28n0xHmkdTrJJ4fKzG5j3KP3riindFF74eyZTgv5oqYhJ5goa59JY8+t zQ/1Y0QEV+zYkOMd2GfOttGR5kSU0JcHcO0HgygGePE4T/UPfMRqe/62NPXzVIT3pKA2 mlNQ== X-Gm-Message-State: AOJu0YzsW9SBdpZRlA6RyJKRBCn0pzhbCPllmZ/mUyrfnvCT3mshe8yi dFTDQQrNVxBZwmrPOKRp9Df9PDPQCqOcwvLlgGqFwPTJYGJ4ALYm63PEIeh4cptqXufjJsxtEqi pTA== X-Google-Smtp-Source: AGHT+IEgm8fAAY9cwnuTPCGqWZ+E0c2X83gEfuJ2EKHJcf1rU9WNLnX3KWF1dQE0+Gm+8J4ojn4tmg== X-Received: by 2002:adf:f2c9:0:b0:368:c700:758d with SMTP id ffacd0b85a97d-36bbc10ccddmr1424777f8f.28.1722582758819; Fri, 02 Aug 2024 00:12:38 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd059932sm1195770f8f.69.2024.08.02.00.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 00:12:38 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 19/26] ada: Plug loophole in handling of No_Raise pragma Date: Fri, 2 Aug 2024 09:11:36 +0200 Message-ID: <20240802071210.413366-19-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240802071210.413366-1-poulhies@adacore.com> References: <20240802071210.413366-1-poulhies@adacore.com> MIME-Version: 1.0 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Eric Botcazou Unlike the aspect, the pragma needs to be propagated explicitly from a generic subprogram to its instances. gcc/ada/ * sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate the No_Raise flag like the No_Return flag. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch12.adb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 6b98343aeeb..25821cb7695 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -6069,9 +6069,16 @@ package body Sem_Ch12 is Set_Has_Pragma_No_Inline (Anon_Id, Has_Pragma_No_Inline (Gen_Unit)); - -- Propagate No_Return if pragma applied to generic unit. This must - -- be done explicitly because pragma does not appear in generic - -- declaration (unlike the aspect case). + -- Propagate No_Raise if pragma applied to generic unit. This must + -- be done explicitly because the pragma does not appear in generic + -- declarations (unlike the aspect). + + if No_Raise (Gen_Unit) then + Set_No_Raise (Act_Decl_Id); + Set_No_Raise (Anon_Id); + end if; + + -- Likewise for No_Return if No_Return (Gen_Unit) then Set_No_Return (Act_Decl_Id);