From patchwork Mon Sep 2 08:24:20 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: 1979560 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=jS6vB7lX; 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 4Wy1zD1KKQz1ygC for ; Mon, 2 Sep 2024 18:25:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0327386480C for ; Mon, 2 Sep 2024 08:25:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id DE2BA385DDF7 for ; Mon, 2 Sep 2024 08:24:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE2BA385DDF7 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 DE2BA385DDF7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265490; cv=none; b=YNqWkPbaQLNXg1eNw8HCHiHKIHbqM/bUt/0VRxMtzQElAARBD/UfSKyo/rEanBoF7cGmliFHAawNx4fMrVwcH7sSqZDadkwG6XqYGzH3vbBCWweaTTbov5vXQkWjT0g01MbA47oEzsHYxCE7P1cUvRXLCtdMtJ1Wz4pY4g+I+84= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265490; c=relaxed/simple; bh=qixLrHK/DgWfBWUduCjlHtstgYMmi7bAKjybLxvdNHg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xMOvKpW0dJj8/aE7nvc3Qp92mzSHPA/iZPNu71S111pKvfhjzUPjcIHESkLENvFLZikjnsm2PkggoYglZ6MxXKLJ7qZDT/4M69LdaD0md6Pi0jcmWPn9lNXjymPh/iOGoln7TcJG02GmLuCGXbzJzuy3KL8VDpDpnCe978qSbgg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-374c6187b6eso685364f8f.0 for ; Mon, 02 Sep 2024 01:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265486; x=1725870286; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QcSa51LtadZEvKfdtRauFSPjcGf1K6x2qr6e/sGTpL4=; b=jS6vB7lX7dfdtpmU8UgGyk27CKdFL1CNpMTT70mZQYH4f10TLOMskw/NhJRxnbQ9xj /y/SFZONgODXv/NQDzCkG+/LIOWZCFApJk2d5mPCYErq+5sxo4+gePsgVXi7UBm9aOlG NZ79CyTz6ESa8OlgCzx5AX/oAnTAVhCwZkQjaGNpMY1e2vHAQlXorA1g0w7p8LGqPgm9 GP/DIUmJa+AeHUby3dVdpVHiq0UDPdGeLNmgIN17ktPtv+4bdvrE1rP9+aFs4b9p+RKa MbbG8o+ewlkIepHcbW3t3OwhvpJHzmOvfxM8v/MdKORpIYmqc3IZ8x18NAbgKYA6KusD J+5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265486; x=1725870286; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QcSa51LtadZEvKfdtRauFSPjcGf1K6x2qr6e/sGTpL4=; b=vs7b3dhrUCseRneWPJbYQ6aEr9tkqVNFJ1fnYeH13MrcrTmJ6f56KTy+9rbAW2DweO e6NByc7UBH57DmMm0zEHfc5c7npmCbuQBA2slYwwcA5nE43DJKphnsdL1DVBaiVto4ty XhIj2h848dtZ3OZMWba914Dhn7BajP3v8CK7icgFvdsRkD7g6s0adu0Q+fQ4akRebgFs xUwD5JoivxQdZuB/0hcEfF6a6FX9QnC+eU6viaPuct9/29IMVKztWbVbx+xnmQKKo522 Va5HQQN5flA9W9+2EZUR9IjVTDCvmytd40BlnEnI71KGKQrTG1ZZA6mZOKevOiLMEdZC E9Og== X-Gm-Message-State: AOJu0YwSJRz2xlfh+f1OEBIXZ0MTwzJgckYK0vgKPS70socqsn+TgJri O1MuSiHLkIqBXbeXj+wNHWc2avBk7t+PxSbxhSFeaUjaBXeGAgoikP8uWQdUlR/EThIlFj9RW7c = X-Google-Smtp-Source: AGHT+IF9cwDh6vsGwSUDKEC7eBCOfRad7voUjaZGi6GYkE1DXk4dheomNQ4CZkqq/o38nMNeXbuIYg== X-Received: by 2002:adf:e98f:0:b0:374:c287:2af9 with SMTP id ffacd0b85a97d-374c2872b74mr2983131f8f.46.1725265485881; Mon, 02 Sep 2024 01:24:45 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:45 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 1/9] ada: Remove repeated guards in validity checks Date: Mon, 2 Sep 2024 10:24:20 +0200 Message-ID: <20240902082430.1863631-1-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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: Piotr Trojanek Routine Insert_Valid_Check only applies checks when Expr_Known_Valid query returns False; there is no need to call this query before inserting checks. Code cleanup; behavior is unaffected. gcc/ada/ * exp_imgv.adb (Expand_User_Defined_Enumeration_Image) (Expand_Image_Attribute): Remove redundant guards. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_imgv.adb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gcc/ada/exp_imgv.adb b/gcc/ada/exp_imgv.adb index e5d84cc52e3..ce052c13c88 100644 --- a/gcc/ada/exp_imgv.adb +++ b/gcc/ada/exp_imgv.adb @@ -896,9 +896,7 @@ package body Exp_Imgv is -- Apply a validity check, since it is a bit drastic to get a -- completely junk image value for an invalid value. - if not Expr_Known_Valid (Expr) then - Insert_Valid_Check (Expr); - end if; + Insert_Valid_Check (Expr); -- Generate: -- P1 : constant Natural := Typ'Pos (Typ?(Expr)); @@ -1249,9 +1247,7 @@ package body Exp_Imgv is -- Apply a validity check, since it is a bit drastic to get a -- completely junk image value for an invalid value. - if not Expr_Known_Valid (Expr) then - Insert_Valid_Check (Expr); - end if; + Insert_Valid_Check (Expr); Enum_Case := True; end if; From patchwork Mon Sep 2 08:24:21 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: 1979561 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=Et8GjLJG; 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 4Wy1zD23W9z1ygs for ; Mon, 2 Sep 2024 18:25:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 13D5F3864831 for ; Mon, 2 Sep 2024 08:25:26 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 33562385EC36 for ; Mon, 2 Sep 2024 08:24:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 33562385EC36 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 33562385EC36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265490; cv=none; b=ZHEGwrjh6YN5D+fJGW4rDq8xi3GY4Et4RDAOytbyLpTY0vCEHfD01dJ2tvzDwG5JX4s3Mj+gV8bsL7YCqQc9KezJ0Nv1CxWwTBXSpzZ1ZQLlCAFGBU3nZ9PIORnXvFFr6cjFcDDLHKgpOROF+zlJusporcdJqi3mRwIktYHerMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265490; c=relaxed/simple; bh=66cl/IXGq5SgbnLauFqY0ybRfcsBhVfldwm4SnTSP5g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XEEzTjd6ZDZT4CMN28SnRwpiQ48hMC4f+P6IIFCquDLTuUS0QIbtzm1QxM/Os7Kdh+qVxN2zKSq3xHubsJLtNMLQ1znLMiF5YDhIAA1Ak+BE/hQ5YoRJVwDRHMbMIAkFpxKLKq2qlNf9eI3zQoPf88Jb9G5ot+I8kjP9zI/ct9o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-374c4c6cb29so1023027f8f.3 for ; Mon, 02 Sep 2024 01:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265487; x=1725870287; 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=tj5hZJsVusNn6aR3zCa3EVUt/i+HyLshapNd/rSwkMs=; b=Et8GjLJG+enCrMbE/Sh8zlG7FtrFLl0aM/nQCK77ptilUOO51oTCenVDK1pW+6qmXF i4TymBCM/UYLetqjROK1iFv8KK04bYCCQ6C9n1j2Yo/FvayNBN2NfK4g5y5sylxB3Edl PU9crEiyhtJ0Ndy7xrT2zXfqYiOtSdZ3mskPIhTQQJAfnZFSD54IipshsBF0TqYYyL8Y R1KVlJMmIO6L6slqFKdZXTbIbjl6zEmAhxM00F6dHv8UPukBkdMWmlJIqI5HBOCBGeKa v6HdOscYQ51iTFBz6Oh/rtpHQcCGBrHyttsEY/TKT1HE2tue3mdu/sDey6U2DUIjaPir IRYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265487; x=1725870287; 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=tj5hZJsVusNn6aR3zCa3EVUt/i+HyLshapNd/rSwkMs=; b=A3OSlMlI5nwY97Y1X7Ndn9cOaBE5EsKZao53e4WFwFoUsvEc6TFLpDbTSgfw48AAQI Cxrzh7iAuExfGPo7Tt0mOOpkf45r4eMBUqxXK5a2ryDiNALoC0Ffs6YBOnXZnx4ZVQJ5 eJuLRQ5gP6/qPiothf5rAC8Rg19uZGkO5d2+ISvdzKhsX5lU97tKAvS1ZulrV1jAUqxa s2dx2d29PR0IFnGEcZSYOUoXo1PyBpo1w352pnujs5/zX/Ipy5m/Jrfdc4fp5D66gWuN QrQo4C3Z/N6kOzR6cQgZgrLMFuz35XDWUPNCX89lQ7ptg6Zu9/RzhUj89YU0gvN4ykD+ y6zA== X-Gm-Message-State: AOJu0Yw0vpsC0/q8qlu6nbqbH5opLFw70AxWTWG/1SYzDQjHzomyitp6 JgArrnAzZvKnvXIuW8od0MqwyDE7t4/KD2JlMMAHPQ8QExy/caFNKNzlrPqq3E+F2+2iZhOLVR4 = X-Google-Smtp-Source: AGHT+IGAwWgwZAao4Y/ZvEZ8GUWJkhukwagmzFxzUnzbuof4pjCxI96j/IUT9rBI4qq3jhNFI9cDgA== X-Received: by 2002:a5d:56d1:0:b0:374:bcdc:6257 with SMTP id ffacd0b85a97d-374bcdc639amr5562517f8f.54.1725265486581; Mon, 02 Sep 2024 01:24:46 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:46 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 2/9] ada: Cleanup expansion of object declarations Date: Mon, 2 Sep 2024 10:24:21 +0200 Message-ID: <20240902082430.1863631-2-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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: Piotr Trojanek Replace repeated calls to Sloc with uses of local constant Loc. Code cleanup; behavior is unaffected. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Replace calls to Sloc with uses of Loc; turn variable Prag into constant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch3.adb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 4f6fa4cf6b7..ff808aadea8 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -7658,11 +7658,9 @@ package body Exp_Ch3 is and then Is_Library_Level_Entity (Def_Id) then declare - Prag : Node_Id; + Prag : constant Node_Id := + Make_Linker_Section_Pragma (Def_Id, Loc, ".persistent.bss"); begin - Prag := - Make_Linker_Section_Pragma - (Def_Id, Sloc (N), ".persistent.bss"); Insert_After (N, Prag); Analyze (Prag); end; @@ -8349,10 +8347,8 @@ package body Exp_Ch3 is -- An Ada 2012 stand-alone object of an anonymous access type declare - Loc : constant Source_Ptr := Sloc (N); - Level : constant Entity_Id := - Make_Defining_Identifier (Sloc (N), + Make_Defining_Identifier (Loc, Chars => New_External_Name (Chars (Def_Id), Suffix => "L")); From patchwork Mon Sep 2 08:24:22 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: 1979565 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=VPyuxi3z; 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 4Wy20l2C6cz1ygC for ; Mon, 2 Sep 2024 18:26:47 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A5BE3851C05 for ; Mon, 2 Sep 2024 08:26:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 20CFC3851C05 for ; Mon, 2 Sep 2024 08:24:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 20CFC3851C05 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 20CFC3851C05 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265491; cv=none; b=Ev603+Bg8QTR4pkpg7geLzLIoC7dqAFBzQ2Rvn1Hr7Xd9QrOo1v+UBHJO3Bbiko8J3k515PllVehEbdkKslZTmvlvD1chYAfBewvVzC2liBhxQGcXT+vcta6OUtGbhuqiZXDfiUT1jAV37AJZIaI/yBnVMLx/sqUcdXUYicYqFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265491; c=relaxed/simple; bh=2bmNbpNTmuEfgPv+zN2A0y7HRXvxxmuPIMH3SEJbAN0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gjtv6fEYDI7q/xMafSxGyBNm1HY1GQs0I4RKW7yjBkXEv5WInQ6M+1ALkK5XXbzfw55FLtdhqK5jeUpvmycsSc2Qx4qqm4dTdBn0KYX+sp1C6kpxbNQugU75cWWN8QuzcL4V1lejSfJnIKq1VY/M075d7t8iVXlc+0GypJkf2NI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-374bfc395a5so867720f8f.0 for ; Mon, 02 Sep 2024 01:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265488; x=1725870288; 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=2PGYpFBhye33DCL6qB091P0KXZz4yvTxHSczQfz0tMs=; b=VPyuxi3zWYYAwGe2rjJzbN7fsGlGH5YytLLiRGyenQDet5pZDjBCLY8y1sk6CdOiBR t3IGyW52A5aNJXfdcESklVfvBE5KofMLK3HhpBxwkiji8c+3LlT81HaebBYPZcR7yM/B XC4792H4Q3+cdynRKmcVlTdyzf6Qg8pvfZtKm8Asn2669Esl0sT7LDN0KvyLqRmEVn+B u6tXsPp0DgxIWNxOf0dLVDQfRaXyBYyK+Tp50d4bdhV2QpkszEMtpxcyUoK3bUMBCc8W vyLSN3dRfMnKYSodD/8CeDxFg2ZX91hYacHvVIIpnkph+ayXDxqPSjZhVmLZwBYZm5Nt NaXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265488; x=1725870288; 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=2PGYpFBhye33DCL6qB091P0KXZz4yvTxHSczQfz0tMs=; b=Ij7cVrpNmq434Lnb7m03cPxxUNLxWpuKklXWyKReg1jSwqz7NnCMAlsfghwGDRcLbz T0zAEe8r97TfkrKizi4KG9urvoJNBB1R7bH4LITZe/9Byb7tUchUsCn+ECcmpBpwFHCy MSFyq1sDiaPdgD0kyyQnSluQQhl17QIIC0/8ntMsXUKyfsIYIUqv6YzwLrxaxITxNmXM Gz8vGDscw0C5U82xyep/5tugFPUvUshGQze/6ViJFilGJtA2c1DMRo+6XwQORnUFn2TZ 0tX5T2DlwSVZtfgMh/ufN9c/khDrCjpG3LXhY7J5AtKOnGMVhMbqjPyZ2Jzq1Yzi9hgD 4cBQ== X-Gm-Message-State: AOJu0YwU1sj8YDz+TU5SYDXYg44PDfFUoeCv357T0hvq2MnqLcNm8Uhk 6FV06u9VSGo7yJA1ZX71R9NHpCVrOidh705NX1ZsyooVwBkVW3w3DyMGkLUGcCrnHJiysC3Nhws = X-Google-Smtp-Source: AGHT+IEpw2rxJu65F4p93HRRPIgjyvSXsYgH7FiqAwYChC9kpZYndfrgxQRXpQ55EWsCuBS9/g1eBg== X-Received: by 2002:adf:f9ce:0:b0:374:cde8:20d9 with SMTP id ffacd0b85a97d-374cde823b6mr562942f8f.23.1725265487351; Mon, 02 Sep 2024 01:24:47 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:46 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED 3/9] ada: Also reset scope for some nested declaration Date: Mon, 2 Sep 2024 10:24:22 +0200 Message-ID: <20240902082430.1863631-3-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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 When changing the scope for entities found in the entry body that is mutated into a procedure, the compiler needs to look deeper than only the top level entities as expansion may produce object declarations which scopes are also the entry. For example, the tree after expansion may look like: procedure This_Is_An_Entry_Proc is ... O1 : Typ := do TMP1 : OTyp := ...; ... in TMP1; O1's scope needs to be reset to This_Is_An_Entry_Proc, but so does TMP1's scope. This change also fix a small oversight where N_Implicit_Label_Declaration scope must be reset and its content skipped. gcc/ada/ * exp_ch9.adb (Reset_Scopes_To): Adjust comment. (Reset_Scopes_To.Reset_Scope): Adjust the scope reset for object declaration. In particular, visit the children nodes if any. Also extend the handling of other declarations to N_Implicit_Label_Declaration. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch9.adb | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 958657f298d..9b82a9fcfdd 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -489,7 +489,8 @@ package body Exp_Ch9 is -- := P.; procedure Reset_Scopes_To (Bod : Node_Id; E : Entity_Id); - -- Reset the scope of declarations and blocks at the top level of Bod to + -- Reset the scope of declarations and blocks at the top level of Bod and + -- of nested object declarations with scope pointing to the entry entity to -- be E. Bod is either a block or a subprogram body. Used after expanding -- various kinds of entry bodies into their corresponding constructs. This -- is needed during unnesting to determine whether a body generated for an @@ -14868,12 +14869,34 @@ package body Exp_Ch9 is Set_Scope (Entity (Identifier (N)), E); return Skip; + -- Reset scope for object declaration which scope is the task entry. + -- + -- Also look inside the declaration (in particular in the expression + -- if present) because we may have expanded to something like: + + -- O1 : Typ := do + -- TMP1 : OTyp := ...; + -- ... + -- in TMP1; + + -- And the scope for TMP1 is Scope (O1). We need to look inside the + -- declaration to also reset such scope. + + elsif Nkind (N) = N_Object_Declaration then + if Present (Scope (Defining_Entity (N))) + and then Ekind (Scope (Defining_Entity (N))) + in E_Entry | E_Entry_Family + then + Set_Scope (Defining_Entity (N), E); + end if; + -- Ditto for a package declaration or a full type declaration, etc. elsif (Nkind (N) = N_Package_Declaration and then N /= Specification (N)) or else Nkind (N) in N_Declaration or else Nkind (N) in N_Renaming_Declaration + or else Nkind (N) in N_Implicit_Label_Declaration then Set_Scope (Defining_Entity (N), E); return Skip; From patchwork Mon Sep 2 08:24:23 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: 1979568 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=ZG0/aXdi; 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 4Wy21r6nsrz1ygC for ; Mon, 2 Sep 2024 18:27:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 319CA3864807 for ; Mon, 2 Sep 2024 08:27:43 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id E8839386075A for ; Mon, 2 Sep 2024 08:24:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E8839386075A 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 E8839386075A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265492; cv=none; b=k4LKS7m7bXP9FokzkOsPCbY9Xx9hezEmfONfUTdvqv4aA+pTOzrqp7TKgSD87WJbVR/8DWH8j6RFEMl6F++x3K+9JZPKZBK/J/oHgplTY9qhEuBuGaRQKUpW8/wxSwog+ROufFdrJf8OY8FgmVH4rQTTjzyvep8IuDvRvSsVvgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265492; c=relaxed/simple; bh=MnzW1bKiyZXIlk8RrTsqbb/Qn/+RKs3EDrFGMt+kOLQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=q2BsbrFj5datsITgFnx/lKtcKa3fEdVNbbb+P5MhTtmLVyepOnGOVoB0c5ha2dsldHRQ3TpNeIv/y1OvDUNfQlq1UB2EuxfGOcrPk8C7vTh0K3XdM3gRshKuvB2NMt185z/NkgI5ZNFcLHxnB00ga1ZvNdhYw8csrgZLayVCMZY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42ba9b47f4eso22468925e9.1 for ; Mon, 02 Sep 2024 01:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265488; x=1725870288; 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=Oxi16Wa2rKU1fhRC4No6iSasFFiSBK67ZCru7iY7hPs=; b=ZG0/aXdiXZedGhOazwippUmoz5M8379UvjMuqpeWs25+W2covsUzwqwqoW0Mc/LD0u 7KyIHmCQ7ydIee1WATTG1jdUqti2NWdLXoOcSsR5gdxy637UgRb5MeED4inFkSVw6okG 1YSlJASK081UouFQoEnAgW2OMCLgsFcUmjiyutVtMWHSOXtMc3YmM0Im2PP1jObTvagM tMVne3zc/MkwrNCMCjjwBLTPmf5r0mskpSjsxQWr+wfWkDGZfwdC6dX921iyvG9xtQ9s hbf08wpD46Z1f5etyZ1A/a8YJ9WeC5Kp9yDDm9F3Bwi7P5rWMUzF4Y2VirsZ1IV4g+gp sBZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265488; x=1725870288; 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=Oxi16Wa2rKU1fhRC4No6iSasFFiSBK67ZCru7iY7hPs=; b=bDmSnoDTzzH/wErzWDgn1EjW/ouPLncgzqaE2Ivwli2gVmHboKGjINaBrpU5taDIhN DD1CaDN+T80IF/OVZFfTELlfqSTABuqypL9wumhqCPhGNBTUSGAG/tfhEKn+evmLecVm NGI8MMfmRFljAdL8yLImWro8qS0Ln/am2l/wh5ZU7OrCUMJXrvOEuUj5ivmnKA9p5Mti e3vEl60PSmzu4aVePDkX6vBidum2L3scbs0r2+x3B8Ew1yP2ymUrJc1NzbyPJzkfopP6 mZjnl30AxezbHbS8AvCe521uuOFEv7fjJoZBBIsMQJXKDGMvu9WQNGxjNbfhwrpzDyUt Lpqg== X-Gm-Message-State: AOJu0YylDsxl9w6Y9mDOcwfZ7oCwCTsMxJ17R2tO8vNX2FhMdnORYKVj +LET0HlKcW6/HQJr+5zeNjpaYJlow+NK51Lz48W7BKD1DixnVfBB64z/j868r6lrWKJ3G5EpB44 = X-Google-Smtp-Source: AGHT+IFwQn/Kej+0q26ycW2gC1D6+GQw0HjCI2U4nRMG/2/TAOL0qpnx/N1J3zXHa3mhbdewQl0UaQ== X-Received: by 2002:a05:600c:4fd6:b0:426:5e32:4857 with SMTP id 5b1f17b1804b1-42bbb4e0de9mr62144615e9.0.1725265488040; Mon, 02 Sep 2024 01:24:48 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:47 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Patrick Bernardi Subject: [COMMITTED 4/9] ada: Small fixes for FreeBSD Date: Mon, 2 Sep 2024 10:24:23 +0200 Message-ID: <20240902082430.1863631-4-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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: Patrick Bernardi Size of pthread data types now need to be defined for FreeBSD ports. Traceback support for AArch64 FreeBSD is now defined. gcc/ada/ * s-oscons-tmplt.c: Define sizes of pthread data types on FreeBSD. * tracebak.c: Use GCC unwinder and adjust PC appropriately on aarch64-freebsd. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/s-oscons-tmplt.c | 9 ++++++--- gcc/ada/tracebak.c | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c index 946da3466f0..96eb99dfdac 100644 --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -1997,8 +1997,10 @@ CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock") CNS(CLOCK_RT_Ada, "") #endif -#if defined (__APPLE__) || defined (__linux__) || defined (__ANDROID__) \ - || defined (__QNX__) || defined (__rtems__) || defined (DUMMY) +#if defined (__APPLE__) || defined (__ANDROID__) || defined (DUMMY) \ + || defined (__FreeBSD__) || defined (__linux__) \ + || defined (__QNX__) || defined (__rtems__) + /* -- Sizes of pthread data types @@ -2041,7 +2043,8 @@ CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t") CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t") CND(PTHREAD_ONCE_SIZE, "pthread_once_t") -#endif /* __APPLE__ || __linux__ || __ANDROID__ || __rtems__ */ +#endif /* __APPLE__ || __ANDROID__ || __FreeBSD ||__linux__ + || __QNX__|| __rtems__ */ /* diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 13ab70718ce..da940d1c77e 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -564,9 +564,10 @@ is_return_from(void *symbol_addr, void *ret_addr) #error Unhandled QNX architecture. #endif -/*------------------- aarch64-linux or aarch64-rtems -----------------*/ +/*------------------- aarch64 FreeBSD, Linux, RTEMS -----------------*/ -#elif (defined (__aarch64__) && (defined (__linux__) || defined (__rtems__))) +#elif (defined (__aarch64__) && (defined (__FreeBSD__) || \ + defined (__linux__) || defined (__rtems__))) #define USE_GCC_UNWINDER #define PC_ADJUST -4 From patchwork Mon Sep 2 08:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1979567 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=gWLMsl4J; 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 4Wy21603z2z1ygC for ; Mon, 2 Sep 2024 18:27:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3905A386180C for ; Mon, 2 Sep 2024 08:27:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id B6900385EC33 for ; Mon, 2 Sep 2024 08:24:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6900385EC33 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 B6900385EC33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265495; cv=none; b=ft6a32kuHy0XL2aeDDcRU2ntpkIRzfFA8FgWEtKh8qR7EK52i3fCboPHo+OIBsp9wzEp56sz1E56p2rw+Ap70hnVV27oU0cnnOdcLe2kUAetKWwF2tprVE8va2OAQmPX9CZ4AR8gUEvbpJBvlYw22BAK7X8ArI0vMMOl8wBhOdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265495; c=relaxed/simple; bh=tQrZqwU1fbxk1st+r49kA7QdIU3b8Yu8j7wWSHPDoRA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JbC1unH91Os1HuCv4SpQ60Bp97KWn1nsXCLpyUAqT7uukYGnQvL6pnH9Yt2kY2ZqUHTsAfZt93wSSXYje+EZvz+/3FYdyW0oHSK46/62BbgzS+qC/5woDTvno1wQIkyR78EEMPwjXXPPzDkJyaexjBdtWgNazSq8xq6r2A2l9n0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-371b97cfd6fso2635519f8f.2 for ; Mon, 02 Sep 2024 01:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265489; x=1725870289; 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=CWm86Ls9hxzMEA6we+NrlYxLSQ1nOpTy2f08i3D1EgE=; b=gWLMsl4JxPl33FWleWARLGXXtXgv/ZWBfpxRPjjyjACAkO74raBnFmPdw4DeefO/V1 o8BeUQQghXPDYkxpiPwRTOCgNfIl7x1feFn5zUH0bIvpUkY/mHgIRxkIiwAr/lYQ6Rt+ oG6S9t4q8dkxs0d55xqAZ3TLQyNvkJ5sx+DZLuIeM4LF3UZGWf93lYzHMGHY/pzFWH8Q 28gOl5SBs+q/EdVby49pkYy5gjLryYY5ndVC8CUUzpJZiTSvfzQcrYglCUV/JNUr+OnO ZnOBwr+TyiuYGC5vqQNjSSs2M88qadrwLSmxuUvv9cc49Ss4YKMk+8l+JbzPQf9ofBP9 8tHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265489; x=1725870289; 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=CWm86Ls9hxzMEA6we+NrlYxLSQ1nOpTy2f08i3D1EgE=; b=Y3+8DPemruGFpTQL6UAaFT2+GS9yFYFUcoseFmha0WCxSEvHE7Ujo5lml6eYmUxfya ftdkOSzJTLuu2mFLe0fWmmfbsqM16+W+v2OoeTeTg4psnZ7RV3KJgM+Xzd8tJZGwI5pk tWi/+oOeBOcvaKrILiAo+/nOviD0+/QFTa2Po4Gu5PK6yx1P/J9A8kpUyAUWRB66PYep cZ7zO44qjkyd+nFmgfOIikf/wCnR0ey7trUbpFZD3EKemQnYVE//DV/uwQXMa0PBiSTH UEqyw7mbWxkN9Topx2FyfzuiLgissSy/i4Ud3qDQSBwezS4WczFXK/f0jo6TPj/Eit5U Bpeg== X-Gm-Message-State: AOJu0YzSWO/q0xp9xdUH0zIO0L6meJ5Yxaw71uOihNFb1OP6ltcObjo7 T2MY7OG1lfGuHiIiW/3U96oeLj1omkFCiFTCRUDz8BagbUIqgZf0FbOY5kii+Cj4uKUOnEg8jVs = X-Google-Smtp-Source: AGHT+IEWXnGFBaf4MqQC6tU+RNd6sl40fBcOFTLmGnRIm5wQ0+9L3zlv2bt6TAOc5+thFyGtomiddg== X-Received: by 2002:adf:f487:0:b0:374:c3a2:2b5e with SMTP id ffacd0b85a97d-374c3a22c2emr2976505f8f.37.1725265488808; Mon, 02 Sep 2024 01:24:48 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:48 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [COMMITTED 5/9] ada: Documentation for generic type inference Date: Mon, 2 Sep 2024 10:24:24 +0200 Message-ID: <20240902082430.1863631-5-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Bob Duff ...plus minor improvements to existing documentation. gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: I assume "extended set of extensions" was a typo for "experimental set of extensions", because "extended extensions" is repetitive and redundant. "in addition" clarifies that the one subsumes the other. Add a reminder at the start of each subsection about what switch/pragma enables what extensions. Add new section about "Inference of Dependent Types in Generic Instantiations". * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_rm/gnat_language_extensions.rst | 80 ++++++++- gcc/ada/gnat_rm.texi | 157 ++++++++++++++---- 2 files changed, 202 insertions(+), 35 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst index 27be5e0c3d5..e7cd73fbf9d 100644 --- a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst +++ b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst @@ -35,7 +35,8 @@ file, or in a ``.adc`` file corresponding to your project. * The ``-gnatX`` option, that you can pass to the compiler directly, will activate the curated subset of extensions. -.. attention:: You can activate the extended set of extensions by using either +.. attention:: You can activate the experimental set of extensions + in addition by using either the ``-gnatX0`` command line flag, or the pragma ``Extensions_Allowed`` with ``All_Extensions`` as an argument. However, it is not recommended you use this subset for serious projects; it is only meant as a technology preview @@ -46,6 +47,9 @@ file, or in a ``.adc`` file corresponding to your project. Curated Extensions ================== +Features activated via ``-gnatX`` or +``pragma Extensions_Allowed (On)``. + Local Declarations Without Block -------------------------------- @@ -356,6 +360,9 @@ https://github.com/AdaCore/ada-spark-rfcs/blob/master/considered/rfc-oop-first-c Experimental Language Extensions ================================ +Features activated via ``-gnatX0`` or +``pragma Extensions_Allowed (All_Extensions)``. + Conditional when constructs --------------------------- @@ -662,3 +669,74 @@ Example: Link to the original RFC: https://github.com/AdaCore/ada-spark-rfcs/blob/topic/finalization-rehaul/considered/rfc-generalized-finalization.md + +Inference of Dependent Types in Generic Instantiations +------------------------------------------------------ + +If a generic formal type T2 depends on another formal type T1, +the actual for T1 can be inferred from the actual for T2. +That is, you can give the actual for T2, and leave out the one +for T1. + +For example, ``Ada.Unchecked_Deallocation`` has two generic formals: + +.. code-block:: ada + + generic + type Object (<>) is limited private; + type Name is access Object; + procedure Ada.Unchecked_Deallocation (X : in out Name); + +where ``Name`` depends on ``Object``. With this language extension, +you can leave out the actual for ``Object``, as in: + +.. code-block:: ada + + type Integer_Access is access all Integer; + + procedure Free is new Unchecked_Deallocation (Name => Integer_Access); + +The compiler will infer that the actual type for ``Object`` is ``Integer``. +Note that named notation is always required when using inference. + +The following inferences are allowed: + +- For a formal access type, the designated type can be inferred. + +- For a formal array type, the index type(s) and the component + type can be inferred. + +- For a formal type with discriminats, the type(s) of the discriminants + can be inferred. + +Example for arrays: + +.. code-block:: ada + + generic + type Element_Type is private; + type Index_Type is (<>); + type Array_Type is array (Index_Type range <>) of Element_Type; + package Array_Operations is + ... + end Array_Operations; + + ... + + type Int_Array is array (Positive range <>) of Integer; + + package Int_Array_Operations is new Array_Operations (Array_Type => Int_Array); + +The index and component types of ``Array_Type`` are inferred from +``Int_Array``, so that the above instantiation is equivalent to +the following standard-Ada instantiation: + +.. code-block:: ada + + package Int_Array_Operations is new Array_Operations + (Element_Type => Integer, + Index_Type => Positive, + Array_Type => Int_Array); + +Link to the original RFC: +https://github.com/AdaCore/ada-spark-rfcs/blob/topic/generic_instantiations/considered/rfc-inference-of-dependent-types.md diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index f901b0e133e..4ef631f965b 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -19,7 +19,7 @@ @copying @quotation -GNAT Reference Manual , Aug 26, 2024 +GNAT Reference Manual , Aug 30, 2024 AdaCore @@ -912,6 +912,7 @@ Experimental Language Extensions * Case pattern matching:: * Mutably Tagged Types with Size’Class Aspect:: * Generalized Finalization:: +* Inference of Dependent Types in Generic Instantiations:: Security Hardening Features @@ -28925,7 +28926,8 @@ activate the curated subset of extensions. @cartouche @quotation Attention -You can activate the extended set of extensions by using either +You can activate the experimental set of extensions +in addition by using either the @code{-gnatX0} command line flag, or the pragma @code{Extensions_Allowed} with @code{All_Extensions} as an argument. However, it is not recommended you use this subset for serious projects; it is only meant as a technology preview @@ -28938,6 +28940,9 @@ for use in playground experiments. @section Curated Extensions +Features activated via @code{-gnatX} or +@code{pragma Extensions_Allowed (On)}. + @menu * Local Declarations Without Block:: * Fixed lower bounds for array types and subtypes:: @@ -29370,6 +29375,9 @@ Link to the original RFC: @section Experimental Language Extensions +Features activated via @code{-gnatX0} or +@code{pragma Extensions_Allowed (All_Extensions)}. + @menu * Conditional when constructs:: * Storage Model:: @@ -29378,6 +29386,7 @@ Link to the original RFC: * Case pattern matching:: * Mutably Tagged Types with Size’Class Aspect:: * Generalized Finalization:: +* Inference of Dependent Types in Generic Instantiations:: @end menu @@ -29683,7 +29692,7 @@ subcomponents, among others detailed in the RFC. Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/topic/rfc-finally/considered/rfc-class-size.md} -@node Generalized Finalization,,Mutably Tagged Types with Size’Class Aspect,Experimental Language Extensions +@node Generalized Finalization,Inference of Dependent Types in Generic Instantiations,Mutably Tagged Types with Size’Class Aspect,Experimental Language Extensions @anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{454} @subsection Generalized Finalization @@ -29715,8 +29724,88 @@ procedure Initialize (Obj : in out Ctrl); Link to the original RFC: @indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/topic/finalization-rehaul/considered/rfc-generalized-finalization.md} +@node Inference of Dependent Types in Generic Instantiations,,Generalized Finalization,Experimental Language Extensions +@anchor{gnat_rm/gnat_language_extensions inference-of-dependent-types-in-generic-instantiations}@anchor{455} +@subsection Inference of Dependent Types in Generic Instantiations + + +If a generic formal type T2 depends on another formal type T1, +the actual for T1 can be inferred from the actual for T2. +That is, you can give the actual for T2, and leave out the one +for T1. + +For example, @code{Ada.Unchecked_Deallocation} has two generic formals: + +@example +generic + type Object (<>) is limited private; + type Name is access Object; +procedure Ada.Unchecked_Deallocation (X : in out Name); +@end example + +where @code{Name} depends on @code{Object}. With this language extension, +you can leave out the actual for @code{Object}, as in: + +@example +type Integer_Access is access all Integer; + +procedure Free is new Unchecked_Deallocation (Name => Integer_Access); +@end example + +The compiler will infer that the actual type for @code{Object} is @code{Integer}. +Note that named notation is always required when using inference. + +The following inferences are allowed: + + +@itemize - + +@item +For a formal access type, the designated type can be inferred. + +@item +For a formal array type, the index type(s) and the component +type can be inferred. + +@item +For a formal type with discriminats, the type(s) of the discriminants +can be inferred. +@end itemize + +Example for arrays: + +@example +generic + type Element_Type is private; + type Index_Type is (<>); + type Array_Type is array (Index_Type range <>) of Element_Type; +package Array_Operations is + ... +end Array_Operations; + +... + +type Int_Array is array (Positive range <>) of Integer; + +package Int_Array_Operations is new Array_Operations (Array_Type => Int_Array); +@end example + +The index and component types of @code{Array_Type} are inferred from +@code{Int_Array}, so that the above instantiation is equivalent to +the following standard-Ada instantiation: + +@example +package Int_Array_Operations is new Array_Operations + (Element_Type => Integer, + Index_Type => Positive, + Array_Type => Int_Array); +@end example + +Link to the original RFC: +@indicateurl{https://github.com/AdaCore/ada-spark-rfcs/blob/topic/generic_instantiations/considered/rfc-inference-of-dependent-types.md} + @node Security Hardening Features,Obsolescent Features,GNAT language extensions,Top -@anchor{gnat_rm/security_hardening_features doc}@anchor{455}@anchor{gnat_rm/security_hardening_features id1}@anchor{456}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} +@anchor{gnat_rm/security_hardening_features doc}@anchor{456}@anchor{gnat_rm/security_hardening_features id1}@anchor{457}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} @chapter Security Hardening Features @@ -29738,7 +29827,7 @@ change. @end menu @node Register Scrubbing,Stack Scrubbing,,Security Hardening Features -@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{457} +@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{458} @section Register Scrubbing @@ -29774,7 +29863,7 @@ programming languages, see @cite{Using the GNU Compiler Collection (GCC)}. @c Stack Scrubbing: @node Stack Scrubbing,Hardened Conditionals,Register Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{458} +@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{459} @section Stack Scrubbing @@ -29918,7 +30007,7 @@ Bar_Callable_Ptr. @c Hardened Conditionals: @node Hardened Conditionals,Hardened Booleans,Stack Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{459} +@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{45a} @section Hardened Conditionals @@ -30008,7 +30097,7 @@ be used with other programming languages supported by GCC. @c Hardened Booleans: @node Hardened Booleans,Control Flow Redundancy,Hardened Conditionals,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{45a} +@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{45b} @section Hardened Booleans @@ -30069,7 +30158,7 @@ and more details on that attribute, see @cite{Using the GNU Compiler Collection @c Control Flow Redundancy: @node Control Flow Redundancy,,Hardened Booleans,Security Hardening Features -@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{45b} +@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{45c} @section Control Flow Redundancy @@ -30237,7 +30326,7 @@ see @cite{Using the GNU Compiler Collection (GCC)}. These options can be used with other programming languages supported by GCC. @node Obsolescent Features,Compatibility and Porting Guide,Security Hardening Features,Top -@anchor{gnat_rm/obsolescent_features doc}@anchor{45c}@anchor{gnat_rm/obsolescent_features id1}@anchor{45d}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} +@anchor{gnat_rm/obsolescent_features doc}@anchor{45d}@anchor{gnat_rm/obsolescent_features id1}@anchor{45e}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} @chapter Obsolescent Features @@ -30256,7 +30345,7 @@ compatibility purposes. @end menu @node pragma No_Run_Time,pragma Ravenscar,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{45e}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{45f} +@anchor{gnat_rm/obsolescent_features id2}@anchor{45f}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{460} @section pragma No_Run_Time @@ -30269,7 +30358,7 @@ preferred usage is to use an appropriately configured run-time that includes just those features that are to be made accessible. @node pragma Ravenscar,pragma Restricted_Run_Time,pragma No_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id3}@anchor{460}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{461} +@anchor{gnat_rm/obsolescent_features id3}@anchor{461}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{462} @section pragma Ravenscar @@ -30278,7 +30367,7 @@ The pragma @code{Ravenscar} has exactly the same effect as pragma is part of the new Ada 2005 standard. @node pragma Restricted_Run_Time,pragma Task_Info,pragma Ravenscar,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id4}@anchor{462}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{463} +@anchor{gnat_rm/obsolescent_features id4}@anchor{463}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{464} @section pragma Restricted_Run_Time @@ -30288,7 +30377,7 @@ preferred since the Ada 2005 pragma @code{Profile} is intended for this kind of implementation dependent addition. @node pragma Task_Info,package System Task_Info s-tasinf ads,pragma Restricted_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id5}@anchor{464}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{465} +@anchor{gnat_rm/obsolescent_features id5}@anchor{465}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{466} @section pragma Task_Info @@ -30314,7 +30403,7 @@ in the spec of package System.Task_Info in the runtime library. @node package System Task_Info s-tasinf ads,,pragma Task_Info,Obsolescent Features -@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{466}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{467} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{467}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{468} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -30324,7 +30413,7 @@ to support the @code{Task_Info} pragma. The predefined Ada package standard replacement for GNAT’s @code{Task_Info} functionality. @node Compatibility and Porting Guide,GNU Free Documentation License,Obsolescent Features,Top -@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{468}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{469} +@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{469}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{46a} @chapter Compatibility and Porting Guide @@ -30346,7 +30435,7 @@ applications developed in other Ada environments. @end menu @node Writing Portable Fixed-Point Declarations,Compatibility with Ada 83,,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{46a}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{46b} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{46b}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{46c} @section Writing Portable Fixed-Point Declarations @@ -30468,7 +30557,7 @@ If you follow this scheme you will be guaranteed that your fixed-point types will be portable. @node Compatibility with Ada 83,Compatibility between Ada 95 and Ada 2005,Writing Portable Fixed-Point Declarations,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{46c}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{46d} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{46d}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{46e} @section Compatibility with Ada 83 @@ -30496,7 +30585,7 @@ following subsections treat the most likely issues to be encountered. @end menu @node Legal Ada 83 programs that are illegal in Ada 95,More deterministic semantics,,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{46e}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{46f} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{46f}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{470} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -30596,7 +30685,7 @@ the fix is usually simply to add the @code{(<>)} to the generic declaration. @end itemize @node More deterministic semantics,Changed semantics,Legal Ada 83 programs that are illegal in Ada 95,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{470}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{471} +@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{471}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{472} @subsection More deterministic semantics @@ -30624,7 +30713,7 @@ which open select branches are executed. @end itemize @node Changed semantics,Other language compatibility issues,More deterministic semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{472}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{473} +@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{473}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{474} @subsection Changed semantics @@ -30666,7 +30755,7 @@ covers only the restricted range. @end itemize @node Other language compatibility issues,,Changed semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{474}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{475} +@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{475}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{476} @subsection Other language compatibility issues @@ -30699,7 +30788,7 @@ include @code{pragma Interface} and the floating point type attributes @end itemize @node Compatibility between Ada 95 and Ada 2005,Implementation-dependent characteristics,Compatibility with Ada 83,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{476}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{477} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{477}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{478} @section Compatibility between Ada 95 and Ada 2005 @@ -30771,7 +30860,7 @@ can declare a function returning a value from an anonymous access type. @end itemize @node Implementation-dependent characteristics,Compatibility with Other Ada Systems,Compatibility between Ada 95 and Ada 2005,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{478}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{479} +@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{479}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{47a} @section Implementation-dependent characteristics @@ -30794,7 +30883,7 @@ transition from certain Ada 83 compilers. @end menu @node Implementation-defined pragmas,Implementation-defined attributes,,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{47a}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{47b} +@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{47b}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{47c} @subsection Implementation-defined pragmas @@ -30816,7 +30905,7 @@ avoiding compiler rejection of units that contain such pragmas; they are not relevant in a GNAT context and hence are not otherwise implemented. @node Implementation-defined attributes,Libraries,Implementation-defined pragmas,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{47c}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{47d} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{47d}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{47e} @subsection Implementation-defined attributes @@ -30830,7 +30919,7 @@ Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and @code{Type_Class}. @node Libraries,Elaboration order,Implementation-defined attributes,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{47e}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{47f} +@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{47f}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{480} @subsection Libraries @@ -30859,7 +30948,7 @@ be preferable to retrofit the application using modular types. @end itemize @node Elaboration order,Target-specific aspects,Libraries,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{480}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{481} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{481}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{482} @subsection Elaboration order @@ -30895,7 +30984,7 @@ pragmas either globally (as an effect of the `-gnatE' switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{482}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{483} +@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{483}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{484} @subsection Target-specific aspects @@ -30908,10 +30997,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005 and Ada 2012) are sometimes incompatible with typical Ada 83 compiler practices regarding implicit packing, the meaning of the Size attribute, and the size of access values. -GNAT’s approach to these issues is described in @ref{484,,Representation Clauses}. +GNAT’s approach to these issues is described in @ref{485,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{485}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{486} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{486}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{487} @section Compatibility with Other Ada Systems @@ -30954,7 +31043,7 @@ far beyond this minimal set, as described in the next section. @end itemize @node Representation Clauses,Compatibility with HP Ada 83,Compatibility with Other Ada Systems,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{487}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{484} +@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{488}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{485} @section Representation Clauses @@ -31047,7 +31136,7 @@ with thin pointers. @end itemize @node Compatibility with HP Ada 83,,Representation Clauses,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{488}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{489} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{489}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{48a} @section Compatibility with HP Ada 83 @@ -31077,7 +31166,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license doc}@anchor{48a}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{48b} +@anchor{share/gnu_free_documentation_license doc}@anchor{48b}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{48c} @chapter GNU Free Documentation License From patchwork Mon Sep 2 08:24:25 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: 1979562 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=KZeD5+42; 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 4Wy1zd1xf4z1ygC for ; Mon, 2 Sep 2024 18:25:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 197ED3864C56 for ; Mon, 2 Sep 2024 08:25:47 +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 1F2A8385EC22 for ; Mon, 2 Sep 2024 08:24:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F2A8385EC22 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 1F2A8385EC22 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=1725265493; cv=none; b=KEJ6xXWc1g1d3znMyjAVViX0I8lck3/CSD7nvgIlJ6+tHHn8vE/R1JgRDyJ3kdLoww36C4DpuTRzObsuzPGsH7hmL0/VugEIBpjrVv0rScb4RDTAiGKAQOeHU0PgbeMlSjl0oEbkzwqrwrAQTs3z6+YdcEXURQpuBivCittJC3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265493; c=relaxed/simple; bh=ehRUiaBhqmEMobx30NxggWDcViPncGcjdKW+JzJjl0s=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sLa3iDk6dM7iH6D6o4qzPvprKWLyjiSgJs3HGWZxbyuZs9SwAY7LO8u5n/DJjm8tO6Rn0PTXNQd/hhMxvSeIASJh/BL6MdHN4muuS+neB+gIRiOtC48GZUQOYjcZycvyRsynyLKby/EyWpL31hRn7+wgx+IFNhXPYND/EQ7rGfU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-374c3eef39eso890892f8f.0 for ; Mon, 02 Sep 2024 01:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265490; x=1725870290; 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=RGlzS1HApShTgv/T+NGhX5SBVPoKLeqqF9U71P13QBc=; b=KZeD5+42p3CgiEtPQ7262863OOmBb/XwvstVvYZkH/McNB5l4aqMLPmVWgMu8mOcvv 2VpOCn7w4TvvzmkJ2lWPDuE5sL6aS4JEELO6g9r/vxKzgRTOMBaqoMHKFkn7tt3eKcsW QBfLgkLLiTeWusSE7+4jSgz+5lqJed6NMbInJluA4dtJXWNVRGDh3zdVHOn9C0HC8Y7F +ScAafCQAjntKLP1pe46SGHOCq1eJ8pwYByz46iU17DQYAWR8LLdSWl/07E3s1te6zg3 aZL4JBFnEcqM1nfBGoGnyW9MPgiVf2Jg2TEE68cd04rtcwTHJvpH966smu8twh+arn7l lShg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265490; x=1725870290; 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=RGlzS1HApShTgv/T+NGhX5SBVPoKLeqqF9U71P13QBc=; b=DmJ9EXyo/Oq0wowtyrUUsryUOvHZMDHGu08d5/gzklpibETX8sUcckOtAodUpEQekl KljBojHcniHZ99E2IJOO9Suk1D9TAhVCAaOHGjYyAHF5FkMEWOYxeWTdWsGZyfFqpu5s qEaFqhK5XNA2GoqjtaYMenEQzpc51WkxZ4I9rjxODpXjuAKXvqDupUet00MPodUfHa03 fMN9dD+mo2Or/pdxMCQr0dj9mCYF3GXMgzPi2gasZdxZRRvkMC3HR6zh/Y2kARYqJsRC 8fgE93yqT4xY19v7+NSH1PMZvte9g/GWIKevMx/av4ClIwsF9Ud5vf3/+a2rvadkkKl0 9p+g== X-Gm-Message-State: AOJu0YzRDugWwxza/U7anP5e4rE91BBD9tij0NKSM5iRSZd4IJtw8k+Y f5JmrWC7kmlLRGGvZKxpl2gLgma9KPm4Mu204xEXqIe62yI+rVpMT1x2TUunnOO5+aEvEcCfTbs = X-Google-Smtp-Source: AGHT+IFBFpQk1QlcfpCxIqHEmSccb8Gm69eE/UeEBgGkM8H/3hXxrIs/IhPAPIQ4aVh/JlpWw7OfnA== X-Received: by 2002:a05:6000:1a88:b0:374:c79b:ca56 with SMTP id ffacd0b85a97d-374c94785f7mr1572346f8f.53.1725265489493; Mon, 02 Sep 2024 01:24:49 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:49 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 6/9] ada: Fix minor issues in -gnaty0's documentation Date: Mon, 2 Sep 2024 10:24:25 +0200 Message-ID: <20240902082430.1863631-6-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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: Ronan Desplanques Before this patch, the documentation of -gnaty0 used 0-based indexing for column numbers while 1-based indexing is used everywhere else. This patch makes this documentation use 1-based indexing, and also adds a missing parenthesis. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix minor issues. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_ugn/building_executable_programs_with_gnat.rst | 6 +++--- gcc/ada/gnat_ugn.texi | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 07ca2ea22c3..4576009bc52 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -4783,7 +4783,7 @@ checks to be performed. The following checks are defined: then proper indentation is checked, with the digit indicating the indentation level required. A value of zero turns off this style check. The rule checks that the following constructs start on a column that is - a multiple of the alignment level: + one plus a multiple of the alignment level: * beginnings of declarations (except record component declarations) and statements; @@ -4794,10 +4794,10 @@ checks to be performed. The following checks are defined: or body or that completes a compound statement. Full line comments must be - aligned with the ``--`` starting on a column that is a multiple of + aligned with the ``--`` starting on a column that is one plus a multiple of the alignment level, or they may be aligned the same way as the following non-blank line (this is useful when full line comments appear in the middle - of a statement, or they may be aligned with the source line on the previous + of a statement), or they may be aligned with the source line on the previous non-blank line. .. index:: -gnatya (gcc) diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 27c705e3bbd..375f39f8560 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -19,7 +19,7 @@ @copying @quotation -GNAT User's Guide for Native Platforms , Aug 26, 2024 +GNAT User's Guide for Native Platforms , Aug 30, 2024 AdaCore @@ -13481,7 +13481,7 @@ in the string after @code{-gnaty} then proper indentation is checked, with the digit indicating the indentation level required. A value of zero turns off this style check. The rule checks that the following constructs start on a column that is -a multiple of the alignment level: +one plus a multiple of the alignment level: @itemize * @@ -13499,10 +13499,10 @@ or body or that completes a compound statement. @end itemize Full line comments must be -aligned with the @code{--} starting on a column that is a multiple of +aligned with the @code{--} starting on a column that is one plus a multiple of the alignment level, or they may be aligned the same way as the following non-blank line (this is useful when full line comments appear in the middle -of a statement, or they may be aligned with the source line on the previous +of a statement), or they may be aligned with the source line on the previous non-blank line. @end table From patchwork Mon Sep 2 08:24:26 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: 1979566 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=H3+mP1Gk; 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 4Wy20z1zdSz1ygC for ; Mon, 2 Sep 2024 18:26:59 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B3BF384DD04 for ; Mon, 2 Sep 2024 08:26:57 +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 E0C8A385DDD3 for ; Mon, 2 Sep 2024 08:24:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E0C8A385DDD3 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 E0C8A385DDD3 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=1725265493; cv=none; b=us7IfAbK/xXlPq2/NSf0JlB21RkkBlrpq3RFTni8VZ4ZgmvQmGvyqRwYfJVnsS7Y2s1TTOKI/todbzsIsa8qxLLwXZzlfuDEO5c4ZRZSXEIy8xXhfRYwnf1TFyyQRDKWIR8v1nAoOUBxqY3hpqPEQY5oOD9lmoDGLxp6+SW3sCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265493; c=relaxed/simple; bh=DwHvWZOkvMjtFyUVYKDkEpoz8K9ZlIxINslC0wfWBxY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=N9a11t7FnBNA8Kmn+oPmnjMlCLWo1TkXfXmnawi7AfygbUxTaYjGIjxJkfu094cH5XTGoyib13nPhiKxo8SlxDET/sSHf4NPFENxjTXdoD6xv2pnrdQE6TUlhxneQtrSnlCrtILkgdncs8Xh8fhQ0fN06Ln4wjlvVLFKZfdnpTk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42bbe908380so21424775e9.2 for ; Mon, 02 Sep 2024 01:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265490; x=1725870290; 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=2d7onScqRNc9tFPlIkum3pXSUFGIhsxCYCYTRx39BEM=; b=H3+mP1Gkd+5+Q6Is73S3BwYpK17z/rkqy0EVn7CzydyHiYyxncuUrnYgchxdkUbqBX vjgqNSWNk+6Gya1Il7NPZraV6t5H6hsDcVURhML+VxG9KXmPLQCFlrRSWHtdcjJTEFeU tZwkf+/8sfkvLrwVOzeyAD/xqrFSi1Hllv9AU4FMslWq4p/c5KkQF5SSA+QQIaLZNgW6 ClXD0+Nvp1IrTSg74/I4xj3bmNcw0hK30ivy9CyVYGGNG2TeI4uq65+ByEEs/RTMmuxk ZKWm+G5gp/QVxjJzf7YcR5mHiagMffQJo5D/llc+NlRkPV//TSot8crvNi/bETRz/h/o N7Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265490; x=1725870290; 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=2d7onScqRNc9tFPlIkum3pXSUFGIhsxCYCYTRx39BEM=; b=TJEX3zWuPnq6vUige3dckgOACPUbfWUOhua4ogvOmVCifgpxkNY2woxGyvhWQM+uJM 2fc5RYyKJE818ExjYkLYMQl2Us96ah4FwaysHf6NRBklYielCNnY1otTVqCbYfUTDyBu h6sw6+EtmDwGqZ+Q0NV+FTnM9XMll604iA97LbEgMeUgkjyDZbGWawjkLZND+20pxZL5 Z27gQyV3lAUFTJJIgGlqadfFhFaf6tVu/7XrWG9ZdIjPLvE90G80IwYwFlvVxy2sTzSr j2ZajUAICk/73wqZ0kLTFAGSR3VwoLCp/vz4P/Myh4SwrZjrqVyF25YysW9tjiZZEfHk Knfg== X-Gm-Message-State: AOJu0YyAReNRBzVpyCU8H490QMtMBfKUdsf9uwLAH1utfU3V0f/cw6sA 9Qe4ovaRrXXF8bocAQORYwi+k+FzihxYQrI80r3iONtWSYeP0FuJ+QXDXShFVHcl+P/4BivFWj4 = X-Google-Smtp-Source: AGHT+IHoi0+1UxTz8i4Fi2md9cQii/P/FMvZlevgiYetxbhBPHe/Nclu/yUzoNXw1RtcAuObV1PbRA== X-Received: by 2002:adf:ed4a:0:b0:371:8eb3:603a with SMTP id ffacd0b85a97d-374bceb3750mr4524897f8f.27.1725265490244; Mon, 02 Sep 2024 01:24:50 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:49 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 7/9] ada: Fix standard output stream for gnatcmd output Date: Mon, 2 Sep 2024 10:24:26 +0200 Message-ID: <20240902082430.1863631-7-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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: Ronan Desplanques Before this patch, the gnat command sent to standard error pieces of information that are a better match for standard output. This patch makes this information go to standard output. gcc/ada/ * gnatcmd.adb (GNATCmd): Fix standard output stream. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gnatcmd.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index c1b817bd786..ed37a348103 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -278,7 +278,8 @@ procedure GNATCmd is -- Start of processing for GNATCmd begin - -- All output from GNATCmd is debugging or error output: send to stderr + -- Almost all output from GNATCmd is debugging or error output: send to + -- stderr. Set_Standard_Error; @@ -349,6 +350,7 @@ begin elsif Command_Arg <= Argument_Count and then Argument (Command_Arg) = Ada_Help_Switch then + Set_Standard_Output; Usage; Exit_Program (E_Success); @@ -364,6 +366,7 @@ begin -- Add the following so that output is consistent with or without the -- --help flag. + Set_Standard_Output; Write_Eol; Write_Line ("Report bugs to report@adacore.com"); return; From patchwork Mon Sep 2 08:24:27 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: 1979563 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=lfV+rTcj; 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 4Wy1zg2jrKz1ygC for ; Mon, 2 Sep 2024 18:25:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DE9D38654B3 for ; Mon, 2 Sep 2024 08:25:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 9E7F53860756 for ; Mon, 2 Sep 2024 08:24:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E7F53860756 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 9E7F53860756 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::434 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265494; cv=none; b=RaYk4REizqfBJp9RKopiH2nSVIeCZadev6qVq/cXzIttl4iwPm/hpgzGKDzlk5odmemRiQmvGXaDwus68utJBGYtJmjTpLipPG0N604RL9u1wK8fE+k6WQIcYIPG1jrI9MWMAtO0yXFA0v17cS3vAbt9dIN7Q56TKZeIH87iHe0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265494; c=relaxed/simple; bh=qIK8TbbQs5IxAVkvgcp9Julp6ohI0+tOw6/iexKMubs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lDDwaHow+l1tigaNpR4pZJeizJkU8keukw74tbq/cHHE91U+8HaqcXuxabXX8ayUO8iksjQzFH1vshBD6jzqRRZy/JldWhbiGutshVZ7P2mPRv9gdsN9i7sbNivED4IP1rrcTMIaYrCpezaeD386WpGIVrdcRGzxfG9Gf3gxp+A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-371ba7e46easo2618749f8f.0 for ; Mon, 02 Sep 2024 01:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265491; x=1725870291; 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=XvzJEZf/UZSwwE0C+rqNQZJL6xnSgdRnVhAEfqQ53Jo=; b=lfV+rTcjx6Fof4MyIm7YnEb+voMzMI8KTxHzzEG2/74uuZwwS3fA3UZ6g2GkNaxxtQ 7Dw/GFqqJYTrn2K2VFpaj+SqXCnKjzZJFymiFtz0XxxXBCWIpknVIjjzK4fIrBO0AGAW LBd4kul3R81EmTj9nnJOkvNKhi3npFn7z2k/g6iEpvFsOZmGa4Xm5gqf/p7I2PLwlPxs ssOz9WR10OApU497bD6rli98iNU7BL2T1QqEjyDZp39KzztgFqJ2Wp+xI4giunztDMc9 C2SL0oO968XTrPz/U8JI6kybvpJTyET3gVNGo/e8JrPr0JXihtGAeHC+Xti630S7cWAl qOmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265491; x=1725870291; 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=XvzJEZf/UZSwwE0C+rqNQZJL6xnSgdRnVhAEfqQ53Jo=; b=Y1uVrww2OIkWZpvHMeG3EIhS/qDCXsIWlI7VVY/I7RnlyO0FSoCc5iFrX8OwO76gp8 TbIf6W+5X2Ehumy+5u7NLy5YolIVsBd1VVf8USWxDU9EZ9k5mvMS/bcxAEYbkIUqYSCn 8v+1HYIXZam8AJXswUlw944dyHBi1CYEd6d1CEs9DrHsVwFmmwF4xcjw/YoItPSjcf7T 64QHOfPlREFht5bmU5ASZ1llkncaSlL8aac9M3rezJvnBAdiWql9ipiSpaVB5lAPFmCX Kqf+6orbeUfpY8HJkq4abgpVxX1W61bTw96//cUSR7j4KtHSRxpZ+6IWmAhExu8gbeeS 4IKg== X-Gm-Message-State: AOJu0YxJxKx4jipp7KI4ui2ZDGXQa/+/fLz15F31I/y8JMNUc6EVU3FI EfhEtw93d6/mHfDwquuB0TbWtdo+2JzTMYqQ6+LEWwnWmrSosNNZtjJxaeHmzM2iQmktB6D1MsY = X-Google-Smtp-Source: AGHT+IHRn1lx6ffLuk+8mGdyVRzBMAxa8EHwKsEwSyBtOVDNJTM/p+CG3k6SSeNA0evXh9F4riDndA== X-Received: by 2002:a5d:69c9:0:b0:371:8ec6:f2f0 with SMTP id ffacd0b85a97d-374bcea525bmr4188208f8f.16.1725265491008; Mon, 02 Sep 2024 01:24:51 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:50 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 8/9] ada: Create usage entry for -gnatw_l Date: Mon, 2 Sep 2024 10:24:27 +0200 Message-ID: <20240902082430.1863631-8-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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: Viljar Indus gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: update documentation for the -gnatw_l switch. * usage.adb: Add -gnatw_l entry. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_ugn/building_executable_programs_with_gnat.rst | 6 +++--- gcc/ada/gnat_ugn.texi | 8 ++++---- gcc/ada/usage.adb | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 4576009bc52..d8501b2357d 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -3433,7 +3433,7 @@ of the pragma in the :title:`GNAT_Reference_manual`). .. index:: -gnatw_l (gcc) :switch:`-gnatw_l` - *Activate warnings on inheritely limited types.* + *Activate warnings on implicitly limited types.* This switch causes the compiler trigger warnings on record types that do not have a limited keyword but contain a component that is a limited type. @@ -3442,9 +3442,9 @@ of the pragma in the :title:`GNAT_Reference_manual`). .. index:: -gnatw_L (gcc) :switch:`-gnatw_L` - *Suppress warnings on inheritely limited types.* + *Suppress warnings on implicitly limited types.* - This switch suppresses warnings on inheritely limited types. + This switch suppresses warnings on implicitly limited types. .. index:: -gnatwm (gcc) diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 375f39f8560..e59ee9f7819 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -11678,7 +11678,7 @@ This switch suppresses listing of inherited aspects. @item @code{-gnatw_l} -`Activate warnings on inheritely limited types.' +`Activate warnings on implicitly limited types.' This switch causes the compiler trigger warnings on record types that do not have a limited keyword but contain a component that is a limited type. @@ -11691,9 +11691,9 @@ have a limited keyword but contain a component that is a limited type. @item @code{-gnatw_L} -`Suppress warnings on inheritely limited types.' +`Suppress warnings on implicitly limited types.' -This switch suppresses warnings on inheritely limited types. +This switch suppresses warnings on implicitly limited types. @end table @geindex -gnatwm (gcc) @@ -29695,8 +29695,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{d1}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index 5b7743703c5..38a82beb615 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -538,6 +538,8 @@ begin Write_Line (" L* turn off warnings for elaboration problems"); Write_Line (" .l turn on info messages for inherited aspects"); Write_Line (" .L* turn off info messages for inherited aspects"); + Write_Line (" _l turn on warnings for implicitly limited types"); + Write_Line (" _L* turn off warnings for implicitly limited types"); Write_Line (" m+ turn on warnings for variable assigned " & "but not read"); Write_Line (" M* turn off warnings for variable assigned " & From patchwork Mon Sep 2 08:24:28 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: 1979564 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=Ah0z8DHk; 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 4Wy1zn1WwZz1ygC for ; Mon, 2 Sep 2024 18:25:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1278D3865C23 for ; Mon, 2 Sep 2024 08:25:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 48109386182F for ; Mon, 2 Sep 2024 08:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48109386182F 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 48109386182F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265494; cv=none; b=S1l6K2ZaZUZb/A1zx9RTJgB8a0BURMiodQxJHnWuejAkK07OBadxou5H1fyCaQ1Z9Low60GJrGvEQpRsNbaTFPr8X69nOVTaPocno+Xe42QHEo9WmJkqckQb/ZYr8goJ/wNJvc6B4jPGwyAGrJaZOmoNqOBAf7/LEWhDUY98Q6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265494; c=relaxed/simple; bh=Ay5n0pVqo41n2Hl0YyIptc73PuVgxzt0tErgtN3a2Oc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=q0OII2y23ObYa5V6/0Bxd87Im/bRGn4iA/B/IOs8rxeiIBDMjuA9/el0L2deJzzgFxvAWYyGqiAB5JmyMgfdoq9AxDpLSdvHCUjTptW+RnV5AhYuaOO+dvRw0ipOw8UEHFqBHAkh1VbKAacojFb0gYY6CvuPebzQ0w9hSSsoDv4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42ba9b47f4eso22469235e9.1 for ; Mon, 02 Sep 2024 01:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265492; x=1725870292; 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=a4Ln9hVyxfqRvzRlQHizB+vO6iLpy4+VKmdenCB8tZs=; b=Ah0z8DHk0fr2Ul1y/V6akKhqsWb26sfALkZ9CEKqL17YsXJtQh6PuRLTtQnY/LIqwh oKZGIS/HtqcKuO114YoRbWPwse8ObE+AOMzMxDFIgcqjprHE7KB4DQj1XjKtfeUUTJWF T5oY3fvfaZliKvXN2sDAADK0+gyWLUv6ctnMGVxzxhDkuQjXmXzKFSS3dx6nt2cnr8es U8hEzB3dPO/PfQeiVT1DrHug32VpqFAHuTu3nyK2lH3p5otn37cgMI4qyPNnUfldqgxE Sq204/6LNOOQVem/VoHm1/h3zpeQqDJ3FNuLq0RfaHpumgZq6dFbsk6F6UnrD7qGkXM9 y+8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265492; x=1725870292; 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=a4Ln9hVyxfqRvzRlQHizB+vO6iLpy4+VKmdenCB8tZs=; b=C7A+PI2uLfeEJIBb06nHUZPDrcffnyz9C+5YBib1MkKbyQ/Y6Zg6y/xhwbm+m6yZim wxdTuS7dUWUjX/MA+gTgtmzteYsl+0Y/egCGd+iTsIOeWv+sU9iRjrChx5L46/uY3cjh DBnUNKsnde0vMz4MgiWeLVo6oaofeTb/5CZwkPiOQfuHQ410WdseiqpRAZ00GwjgAyV3 hgyCSMY/Hymjr4QfwqF046APIv/c2ONJUdlaenpWhk/P8/nyTvLK1x1rBVIA8joEbChH 2cEufAKvQWrFKjzw/jeZodVeO7+qDq9q6s+xSnimV3mdEugwyJqOm7hLP+vwAiQAnpwQ kCjw== X-Gm-Message-State: AOJu0YwwlE2AC5vEUFiWKLJpMPobnonbMG2NlPvK1xOtC0czsWgh3XlL sGFzzERb9UYdB6d0XqChtIiufKGwRwVsZ2cB0RvIrWyoSaluPnA6Gvw16Rper6UmAqmy3yMy4Co = X-Google-Smtp-Source: AGHT+IFjdsulcaX51x5p+XtBknhqbsGVxjoeS+4otaBj/hbrvmwrBxbC06uIIhUavV4WmQadgLVXIQ== X-Received: by 2002:a05:600c:1c83:b0:424:8dbe:817d with SMTP id 5b1f17b1804b1-42bb4c5e500mr77969495e9.10.1725265491742; Mon, 02 Sep 2024 01:24:51 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:51 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 9/9] ada: Diagnose too large size clause on floating-point type Date: Mon, 2 Sep 2024 10:24:28 +0200 Message-ID: <20240902082430.1863631-9-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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, T_SCC_BODY_TEXT_LINE 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 The problem is that the size clause changes the floating-point format used for the type, but it must not when this format is the widest format that is supported in hardware on the target. Instead a padding type must be built and the associated warning given. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Cap the Esize of a floating-point type to the size of the widest format supported in hardware if it is explicity defined. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index d7c17238bbc..398e01521a3 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -521,8 +521,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) esize = UI_To_Int (Esize (gnat_entity)); if (IN (kind, Float_Kind)) +#ifdef WIDEST_HARDWARE_FP_SIZE + max_esize = fp_prec_to_size (WIDEST_HARDWARE_FP_SIZE); +#else max_esize = fp_prec_to_size (TYPE_PRECISION (long_double_type_node)); +#endif else if (IN (kind, Access_Kind)) max_esize = POINTER_SIZE * 2; else