From patchwork Mon Jan 13 10:53:34 2025 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: 104670 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 61F773857718 for ; Mon, 13 Jan 2025 10:57:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61F773857718 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=AQGdOWv7 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 3CA563858C98 for ; Mon, 13 Jan 2025 10:54:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3CA563858C98 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 3CA563858C98 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=1736765645; cv=none; b=n6JgJLfq0OBEbLzHE+ArRBJ3IIO0MQRqT5jMJ1LurJBoz2p1AG+bhgy80SB3vpckrTPxpJRtA5K5mFpp6cB/DULkX5x8KzosYIN5V4Q+3CRN8Y2FzSra2eV6/wpMFi4JoFzsDa4lsa/O2VKdoFEwgpyGKoGFvQSXW/rgUDPRYnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765645; c=relaxed/simple; bh=iR36aKxpbjYNxUA4Ckp0CUN6bvnd+VMFQa0P30ihOHk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VkfbRkE3h0T5J2O4A2WhQ0KjmygtiCmDXnFRc0Qmg8dnjDgeJZwikROzmEQ9lY40+qQHVH6SvOgT8Ia/xcpdJxt1G0qFB31dU3Ql/J7M0xdhJRHh4olhwyvp62oysl4qBj7FoRTkIXRO4RTwxV4afeXAj88pHApFGadM0rjR6Ho= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CA563858C98 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38a88ba968aso3415179f8f.3 for ; Mon, 13 Jan 2025 02:54:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765643; x=1737370443; 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=sFM2FXb7qfpOqZ0pC8uRbRa3MUlbjP5La0Vqnao49sw=; b=AQGdOWv7Bjb6B5Lnw6w0xjw3JkbgEGCThzzAlJdRIb8aMsc3dxjYXWfP8PYCNThu4M B0NsE6jXMmRORHG66kfy5eBy+GSSE7GNgGOKkyA2fMzUmGYFxGDyVMBBeMqe3qrQGQaw Sa7acgfQN8onJXsgBjVZgPGDBaaG9Qy8xlfwVOzivAX18l6vgnZbhgMcvLenm8dwLx7p KBtU3LzDmCkmUjnaUKbKQSruvS4rdLfFf13XPakMTMNhxh+XYVGwHUrIaag+wH1WhatD RGbPhfOap6EOjOeF1DCr8Vd+LkgWRXWkP7LFm6/rth+WrdNvIwqZNgmkHgh7iRQhXV9D VVwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765643; x=1737370443; 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=sFM2FXb7qfpOqZ0pC8uRbRa3MUlbjP5La0Vqnao49sw=; b=QB8IgVyv9DX/qg314DfKKHYin1yB3wps0x+ZjbHgoKqfABZsYYG10Tq2dBzqm4ixzg PoFnwWcklGsGRtxuDV1vw4VjyD3JiKwv7BthE/+KRH7mlc/FMJIPAQizHtCL8YrMnUZ9 qd4ZMuhFYvst1HrcQj/dZBOUU1IkDRk/bwB006p0u3ZldyPICspMvabafPIZ8GzIDZUp j+r2Z9iY+fzpBxmNxc1oYFhiVTykfc+QcWofyc+4dmuI0tEUO7nQ0lUr7IjZSH+msVQY 7WU0OEleRJsKNtmtUuCnZd1fYtDBiuJj/dh/DYTv0M6Rr03L2BjpPc928CFL2DCePonc ye/Q== X-Gm-Message-State: AOJu0YxR6KJndl9x0li47zcQvjGw2PIDkx2ZYkmmHO3wy3p95jLmxZ+R MqiCENfENQgu6n9JpYMyapm2vkTP8HGMUmaL1AcFbIeovLcgUHQQzmSzU/bf4N8RnDlxEW/EWhI = X-Gm-Gg: ASbGncud599RZDS1TtANV6+KwyOuYxV2a7+iy6HeJNJOoI8iY+vtxG8eBfYdBgiCuBP ktxC0g90ItGLE2zqslhzfV6PdxKIGQBZ+cR+ulZOEs4fUN5hDLGzf4P78XnPGerYbb/O0EEy+JU /xuH3lqQ7UxJ1ncaXxNdMoc8cQYUWBa4wjv1c8fiPhjE9mxaHRoHiZN1xObH9GDN4B9/g1DOgbG RabPfxPW/E47xnO3qGTcJQvbQt++mITDitgpPJiGsIe94sXbQ4OPhceIVsKyuNOIOlqOsNgxuOq Fwgh4krqLrcR0GLU2lniiiWpM8384yBDWFI6Vtt8uQaauCZBMhIuwYwcCiR2WN1nfb6kQPMO X-Google-Smtp-Source: AGHT+IEZIz0OnW475cWKlDYQoSLJ+DgekyHR7gXFa/9WfvlBCSkf89n5eajm/E4V4Kd8hootb1596Q== X-Received: by 2002:a05:6000:470d:b0:382:4ab4:b3e5 with SMTP id ffacd0b85a97d-38a87087028mr19735700f8f.0.1736765643534; Mon, 13 Jan 2025 02:54:03 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:02 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 01/14] ada: Fix parsing of raise expressions with no parens Date: Mon, 13 Jan 2025 11:53:34 +0100 Message-ID: <20250113105349.928779-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek According to Ada grammar, raise expression is an expression, but requires parens to be a simple_expression. We wrongly classified raise expressions as expressions, because we mishandled a global state variable in the parser. This patch causes some illegal code to be rejected. gcc/ada/ChangeLog: * par-ch4.adb (P_Relation): Prevent Expr_Form to be overwritten when parsing the raise expression itself. (P_Simple_Expression): Fix manipulation of Expr_Form. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch4.adb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 97f9b7ddeb2..3f8d1f1d2e3 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -2181,8 +2181,9 @@ package body Ch4 is -- First check for raise expression if Token = Tok_Raise then + Node1 := P_Raise_Expression; Expr_Form := EF_Non_Simple; - return P_Raise_Expression; + return Node1; end if; -- All other cases @@ -2415,6 +2416,8 @@ package body Ch4 is Node1 := P_Term; end if; + Expr_Form := EF_Simple; + -- In the following, we special-case a sequence of concatenations of -- string literals, such as "aaa" & "bbb" & ... & "ccc", with nothing -- else mixed in. For such a sequence, we return a tree representing @@ -2530,11 +2533,6 @@ package body Ch4 is end; end if; end; - - -- All done, we clearly do not have name or numeric literal so this - -- is a case of a simple expression which is some other possibility. - - Expr_Form := EF_Simple; end if; -- If all extensions are enabled and we have a deep delta aggregate From patchwork Mon Jan 13 10:53:35 2025 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: 104669 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D86A385782C for ; Mon, 13 Jan 2025 10:56:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D86A385782C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=a8tgTfsY X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id B12C53858D21 for ; Mon, 13 Jan 2025 10:54:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B12C53858D21 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 B12C53858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765646; cv=none; b=C+nX/96gYVe+/EcqZIwXulRpFJBGAMa6D8txKgzBqP277jo9tNCfK+1dZoHD9v8ZLgJSio3FYObk/is/lS0btRTu/MFSxU5PutXdwAcrOiOqRbi8qz7fkdnB9I87MqeVpOHZqsfxq9EqZDOO/VLLExGLoJOAlLhXWL5Jefzv6ZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765646; c=relaxed/simple; bh=FkV7WBwTbt1WuiXFIUa08IImkUHZX6bQBPSL3mP9qZs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xt975EychiAM08g8x33HAjzeNIzOflrFswABMxV9Qk7eYHuTkXvlQepp5ntAew5/5mFg4bZqxVjPhHDkXkoe56aO4ImTt0JTQ4hxPzReaSwKl+A8r1AUwOiiatO+aWgG/ENDL76AYVqvYYMgt8b/ypeWSyoYPABGsYSmeTpSnc8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B12C53858D21 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361f664af5so47415905e9.1 for ; Mon, 13 Jan 2025 02:54:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765644; x=1737370444; 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=VCUJ31KFVPFWIANAhYJyblrsaNjEVtNmGyqp0KFEFWY=; b=a8tgTfsYUd9+C3FhFJKtg2D9QXvGoAJOK+4UX5A6ot7iOEPgtX9DvVHVk1cXSDYrVU Y+i7xk4LCBcH5dZBIeDBiXqrX6IsQmWyK9XuCg1ygM0t/fMHc+dzbg8dLnY81p+qS1O4 DdLSiiMFFE38sDcffY9jItrmic8VQBAkDXx4rQqdr94YNl4Bu3Yz/aP39jYRqwPwE360 xP3hCyhqRHfkpZS0VDMoC9IUOp/0ksFoeuEgmNrmEyl4XMrNFSVEjoIQ1uQTYmaG/Vqs hm4URPaheZ9xKyymZkk6vBMLC7BLUdHFe84P5HvGUW8SyCRM2dczagnPant/O4oUoC5X D8Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765644; x=1737370444; 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=VCUJ31KFVPFWIANAhYJyblrsaNjEVtNmGyqp0KFEFWY=; b=gtmvFfikk2gIxU+u09JN8h/eGnQY2mqXxlrCEkN1Yh1mUCS9G8vCZ8HLc+Uyesyi1q kTvcMhSVDRLxb5idE8LbFsWvakGmZHenFqM9rSw39GZO8Klre77kaWIFJhHkTzUvFRw1 GCJiYPhMkaO9q/hGhlbfwEHKsdqWCf/qfblzPv9bRH+r/is1n8ODR9PCJTna41VIwVdz Z8DnpwE3qqVGte0ptPRr8JUsKnKgdbwGMLrFONOgL0Vm8rubztpcfXIv71RBilppr1Jy soDl+MZ75960EbIgs0c9d2AdZS0dhSrmHdvcO5b+wRQNCNdF4wLAmdoXsg9w0eMu7Ogf vc9w== X-Gm-Message-State: AOJu0Yz4vxo4p1Uf2QRibxnWrS9qH0lC34M045of8dlQU169dv63LSiw WGxObX8VnNTSRv30MFPnE252EUkKrLjPkI+X6JIzoaSRqf/jLL+11F55OTFqgaOvpb7rnamXKWc = X-Gm-Gg: ASbGnctSLGOz2ScgvxhSVyr6nh2Q9HCsM5jTOzklHqSiBH7qy2+WZ2hStC+ov3NXob/ RWcjxQrk8y/ieFk+emcNQEzlN43/fLZtRzxEsvqi91Fighoadb/Uw+Z46Q5EqI/R1FI4LO9Pzim m2TEPwWfy98s7LlLirj4z/nnLwbNzxaXIsj8N1m58VfLunzteMHIrbACVaYP/2CCcvKbMBiGAPi HVaWnDqTjZx207I42EsnZcrmcu+xYQSmNJoM9wOPgF01ZU1iUQ5vZPvO/easGCXS/WBviLAHy3c zZP4O6YjWw6kVaF/jNycHztJfE047D4DHQZY/XbY5g7or2jmyMcxAYSEW1djC2tHJSlUBLM3 X-Google-Smtp-Source: AGHT+IGz1gyCGFw5VSoxL4NTjS2c5fNjMwAdG/yuzMZx+ZxSOq/qt1EZkMPR4gEqpTomKWEeAAL8mg== X-Received: by 2002:a5d:5f82:0:b0:385:e1a8:e28e with SMTP id ffacd0b85a97d-38a872faed5mr18590972f8f.10.1736765644300; Mon, 13 Jan 2025 02:54:04 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:03 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 02/14] ada: Add more commentary to System.Val_Real.Large_Powfive Date: Mon, 13 Jan 2025 11:53:35 +0100 Message-ID: <20250113105349.928779-2-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou gcc/ada/ChangeLog: * libgnat/s-valrea.adb (Large_Powfive) [2 parameters]: Add a couple of additional comments. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-valrea.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/libgnat/s-valrea.adb b/gcc/ada/libgnat/s-valrea.adb index ed22366840f..aff694dd721 100644 --- a/gcc/ada/libgnat/s-valrea.adb +++ b/gcc/ada/libgnat/s-valrea.adb @@ -396,6 +396,9 @@ package body System.Val_Real is begin pragma Assert (Exp > Maxexp); + -- This routine supports any type but it is not necessary to invoke it + -- for large types because the above one is sufficient for them. + pragma Warnings (Off, "-gnatw.a"); pragma Assert (not Is_Large_Type); pragma Warnings (On, "-gnatw.a"); @@ -407,6 +410,8 @@ package body System.Val_Real is -- its final value does not overflow but, if it's too large, then do not -- bother doing it since overflow is just fine. The scaling factor is -3 -- for every power of 5 above the maximum, in other words division by 8. + -- Note that Maxpow is an upper bound of the span of exponents for which + -- scaling is needed, but it's OK to apply it even if it is not needed. if Exp - Maxexp <= Maxpow then S := 3 * (Exp - Maxexp); From patchwork Mon Jan 13 10:53:36 2025 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: 104668 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3BA3A385770D for ; Mon, 13 Jan 2025 10:56:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BA3A385770D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=BZv0ZzHX X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 6B40F3857707 for ; Mon, 13 Jan 2025 10:54:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B40F3857707 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 6B40F3857707 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765646; cv=none; b=h+ap5u1fjhuTj7VdUprPTzhK/JVltAzFmk64rUIuh0BF1cFgqn5kCXrZPtt+JmNmoHMNPQp25qmn7DjqtugJPPj54Tzgufwk9Mq9QPtQJKu7Pk/baGpZaHZyZJ4C6z8pgfdPQOc1kNuBz0/EFMYSRmSmbWCPrwc888vETw/r0KQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765646; c=relaxed/simple; bh=quQxeL853sAw6UTabc+y0uZfYRgVvebGfhPZx7dEIag=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CjcGmENXjzmNFUbV6VlJ3aipDv3E/HAT/35uBFxzIO4y3Jy+Mn7zA3N2hbKj2SJMrNjIaIr23X6PdUilHtM8+lJFydH8b8w29P3axu2YoghzgKuonWSefynICJr7emn7D++ZgiSDUDhyGDS553MLncWd4cECH7qEuXBCcA07DXE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B40F3857707 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43690d4605dso28439235e9.0 for ; Mon, 13 Jan 2025 02:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765645; x=1737370445; 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=zczLzNpd5+PevUb+AvnuzW0i2YhU02W8Lxu22JwDsyw=; b=BZv0ZzHXkwjlvfwdYeqPsXGBAuwGE0QSg9DzKhaGTWNaeO0DOj9Y2YJWItDRK4FPRA qw/tv4JPRjv/Fnya56kDTAHPKsgnTF2NOsqer4msKMaBbhMDPoxktdTm10J4qzkCoG7S 8os7nI6BvXyXFyQPk/rzEet1N/6/wUqgKQU2Ew+uajZTWG3sn7ohXiVfKx7dNtujDrIx tvmNWt5lcA6op9OL662uDi8+x/55hWBv6+YyDmclzbM5l9meUYeQKGfTnsr+p0Kx9qbj WBelCFDxQlWTUv1mEX4jB6319jhhK37l27BuIlMFp7u0hAt5xZuJKLCaP0othSFL2SSV jKuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765645; x=1737370445; 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=zczLzNpd5+PevUb+AvnuzW0i2YhU02W8Lxu22JwDsyw=; b=VKr7VL3SQC6uB7nbGs4joUqaXs6m0etSyWxlXnL1wgjwzNJUUsjQukamMeCBIPYlCV msPH7+AUIv9lAPc0qQ3p/hgWnobdi6DF05PjK2vBHCINxld4GnpKXZ0OwLZJdMQEpCGr 0RkgdZD65taA1XV4XR6lzLyH8wKeLEyMY4GHhMSyRWL+bC5i2lTs6mocLVvwY7DN6DIw SkjFxO8rooPwGoSeZdWWl2Xn44ybZ71k2Vcq2y9V7HsJaKiTWT6V790cmBsePz97i1R1 6o/lJ02RbEjO9gGzroglUg94HiNsOakzsKOBN7D1JLaAVLiDKffKHsAYSJn5KQ3vUcIH Irsg== X-Gm-Message-State: AOJu0Yx51U7x2zidSpX8K4YfnDB4cVBDr0mdtqPRfoIe1mrbDZCSN/Mg vUhRwYfxtW5LslL0SHJLb9HYI3NuABYwuLLrHgqV9IaGTf43zh6xcTjG3E3yQtCF0s1uDhTMN90 = X-Gm-Gg: ASbGncv8nmt+E5HYjobhHwySNXaSa4fWpidkvSaWWT7OJKBFxcNgbZ3K35ihSPbe462 Yj4h6tCEAxp8OjViAgoGbFyrTlfGRIodg0xPHdYSQ/B8oJ17nBP0NJvudPdFxpqPHYJ/YrD3d2w 3cKCorIfu2wvaGOG5a7j6GemI++nn3rXXE48Oogr65mJwVhKSEHFlXe88opy5eIhDXBCzANMplG s2jNdiGYexcUcZIKbS3x9UpVQ+IbL/kWJOp/ctQLGFcqMyVDs7K+D74iflwwYJyLu517Zxxg8iq H67ozF658CglD/HehSDKAj5K//f4BCrvTWjVRFBm3ZNkSg0/Gsqh5AQdXtBuGCl+21pHBFJj X-Google-Smtp-Source: AGHT+IEBA7OiezNF6MbLLt9vahnlTkBNAq7ckg66Su8E1+ZlHBSUQiOrYGLiGgBYx3jbANP0UJiijg== X-Received: by 2002:a05:600c:4f4e:b0:434:a902:97cd with SMTP id 5b1f17b1804b1-436e26935cbmr167093345e9.12.1736765645036; Mon, 13 Jan 2025 02:54:05 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:04 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 03/14] ada: Warn about redundant parentheses in upper range bounds Date: Mon, 13 Jan 2025 11:53:36 +0100 Message-ID: <20250113105349.928779-3-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Fix a glitch in condition that effectively caused detection of redundant parentheses in upper range bounds to be dead code. gcc/ada/ChangeLog: * par-ch3.adb (P_Discrete_Range): Replace N_Subexpr, which was catching all subexpressions, with kinds that catch nodes that require parentheses to become "simple expressions". Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch3.adb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index edea6785512..e58e2a2342b 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -3070,11 +3070,15 @@ package body Ch3 is Check_Simple_Expression (Expr_Node); Set_High_Bound (Range_Node, Expr_Node); - -- If Expr_Node (ignoring parentheses) is not a simple expression - -- then emit a style check. + -- If the upper bound doesn't require parentheses, then emit a style + -- check. Parentheses that make "expression" syntax nodes a "simple + -- expression" are required; we filter those nodes both here and + -- inside Check_Xtra_Parens itself. if Style_Check - and then Nkind (Expr_Node) not in N_Op_Boolean | N_Subexpr + and then Nkind (Expr_Node) not in N_Membership_Test + | N_Op_Boolean + | N_Short_Circuit then Style.Check_Xtra_Parens (Expr_Node); end if; From patchwork Mon Jan 13 10:53:37 2025 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: 104675 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6EBFC385770A for ; Mon, 13 Jan 2025 11:07:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 30B6A385828B for ; Mon, 13 Jan 2025 10:54:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30B6A385828B 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 30B6A385828B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765647; cv=none; b=hUxlgCoBUKeiHyuoe8nghq87cB+ZVU6eliOpsihkWQr+tJzzVZ7FhUtM3kxBPVsZfyca0kyiZFyEcE5JMkYnpXCu0dLHOeBmgB2dxmV5u4irJX5kAIhTs74QdyE95g6Va1DCrHiZCY9a0TMwAuayAwEuV4tX+E1i4JQk+hcr2OE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765647; c=relaxed/simple; bh=Djz2k3U9RC+kX/4CXoyli//crFytR3WcaDVigy9EIv4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=d53QGxh9F9uGFNe0s6Ybuy7Ahbm7CVtobJEsWZ3XkoTU61cXBP3HPMQwehESrsgYXKuqqQb4gmex+dLSnZhh8+KO2sD9afVnKcOcTI0f/gDFYMpZWAlpJAEAXmCBH/9bVpkrUaJJVRDQ0QAbeApfgBc4vESSQN5erNSbHqhxl3k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30B6A385828B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=aexpUMfR Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-436202dd730so28993015e9.2 for ; Mon, 13 Jan 2025 02:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765646; x=1737370446; 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=cFxp0zifwMyezf3hM3J+hIIwDMER5OGR5kuBT8ZYC0k=; b=aexpUMfR82IwwY5pIjxAnctlfYYc9c4As+ZWQk0N4zHBspsWzqQ+iJMjGq0l440ipP 6706G11TmsNZ5IlTaTJfSmXVvaDUUEFseZZMaFFisHKd5yrbpYI7yi0vu1w3o/MLeWtY bbFBCd09krHp0hjOnAAYdBoQwFEEIYYqqCUpEVXHR3FbH8+W/O64ubeDP4QpZbFfCZyU 0HuQ1V5QacvlJmYstd89WEr4gZBdiUov3R1Rz3xYmtpe493QEJRUHIyhV++yxNeCj6/3 6ZK92b3IAEim45WhGjzYGNOtnSNTHNf6t1ERHYwlA77WZJtoW6DkN4XKwo2Z4up70dvr FeUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765646; x=1737370446; 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=cFxp0zifwMyezf3hM3J+hIIwDMER5OGR5kuBT8ZYC0k=; b=thzwpQ1qwqC9unIvhuV/LxqL/seStRU2G/w1BxrIq5vuMWHfnBF0ch8asi/D70gnMk j6bbVARZH6haNXYmoqFjg/jy07Z1J4AvkalRlX2sBMW3whJakQoe1EJ7Tn+NyxKLhYVa bQIWY7f/JhN9FXVHFN1MLrmgkF9dUO/QcB4RHeHTF88APIiYrWpvFcTYoCZh55ZGSI8t PUgnpcExxNuJtS+tFB6rJn8SiGwxp9vKSy9SujKHKpGR0Otmw2AmpT7WHeEr3Z4Epmam efZsP0WBCxegqy4uKUSDm/OAOknv4EZJYInxtcsz/vyOOcRvCbVkCHkq4sMKJWhNlxEa JPKg== X-Gm-Message-State: AOJu0YyW4xgnNFin5wuVbcfpFg6PI3rhSp3jJMZfvhG6YkDbzRfM7Wip pwCdLs1FSyrAngCjxXvVZNUtt/530ScghsgWI4sGJ8rk+dQYKdpUzGUvYuIIhHz/mvZKk7xozWM = X-Gm-Gg: ASbGncvqRIdW4uPeCuYUUgFiObCvwiyWrLizj/fvi51pg58twNxzF5SWvHZPq5Nhy3R 8S6qfeO5xyQJKA+ujWZTw3XNjkBKEEOhwNTgxcaCJcLQJUcp3ntWMWxqvk9PrCARraNluYtvSr9 j9PfyROaXpN3IwiHMAUkvK+Vdqg5ONkrIh628PqAvXF4vB7piYPrXF6bUPAXatLjnwUimOyXVBr XB2PkP/ev1VBs3C8oKl5edIQ/9FUYOXXwpKegoCJ1gX4+HsqNHWfPiwvj92NV1thkmHg2/2S7OJ zKOM4oeo2iCmcnB/XpWzIPwwZXnUn/JV7veU/h+NNUjpp7k/ChbsxTmgfULwalMbomSAxqyC X-Google-Smtp-Source: AGHT+IEmpOPMXVCvl/ewFIg6j+8wrflEbYoFr9vBLL78t9a+IpsTvVkKgzSDPGyxP2DArDQYWIQLHg== X-Received: by 2002:a05:600c:4fc2:b0:434:f3d8:62d0 with SMTP id 5b1f17b1804b1-436e26803f4mr174076975e9.3.1736765645749; Mon, 13 Jan 2025 02:54:05 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:05 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 04/14] ada: Simplify expansion of negative membership operator Date: Mon, 13 Jan 2025 11:53:37 +0100 Message-ID: <20250113105349.928779-4-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_ch4.adb: (Expand_N_Not_In): Preserve Alternatives in expanded membership operator just like preserving Right_Opnd (though only one of these fields is present at a time). * par-ch4.adb (P_Membership_Test): Remove redundant setting of fields to their default values. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 9 +++------ gcc/ada/par-ch4.adb | 4 +--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index a7f759fc8a5..82978c775cf 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -7727,12 +7727,9 @@ package body Exp_Ch4 is Make_Op_Not (Loc, Right_Opnd => Make_In (Loc, - Left_Opnd => Left_Opnd (N), - Right_Opnd => Right_Opnd (N)))); - - -- If this is a set membership, preserve list of alternatives - - Set_Alternatives (Right_Opnd (N), Alternatives (Original_Node (N))); + Left_Opnd => Left_Opnd (N), + Right_Opnd => Right_Opnd (N), + Alternatives => Alternatives (N)))); -- We want this to appear as coming from source if original does (see -- transformations in Expand_N_In). diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 3f8d1f1d2e3..648a4cf6464 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -3926,7 +3926,6 @@ package body Ch4 is if Token = Tok_Vertical_Bar then Error_Msg_Ada_2012_Feature ("set notation", Token_Ptr); Set_Alternatives (N, New_List (Alt)); - Set_Right_Opnd (N, Empty); -- Loop to accumulate alternatives @@ -3940,8 +3939,7 @@ package body Ch4 is -- Not set case else - Set_Right_Opnd (N, Alt); - Set_Alternatives (N, No_List); + Set_Right_Opnd (N, Alt); end if; end P_Membership_Test; From patchwork Mon Jan 13 10:53:38 2025 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: 104673 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 94FB73857836 for ; Mon, 13 Jan 2025 11:04:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94FB73857836 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Uq7I+3IC 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 CC517385783B for ; Mon, 13 Jan 2025 10:54:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC517385783B 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 CC517385783B 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=1736765648; cv=none; b=lkEEGk/hv8xYLZxrXIAxwrwNqvUYd45qrvIrD8zoK/Lo4q4A+sZwONHy3La/RuoRHgCzxXPNnRdgMEaTnYGcSpydv5K7RgGtxdf90JX+R5UsnqgjrXC+41lhvUjb3inoeOYImofqEqVC6UEq0Gu83/R1/aj6cpSbXcvJmmX0qgY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765648; c=relaxed/simple; bh=4zpgdgjyWv8fXeRVY62KKwRh1IT7iiDyU5IjX1j0AJQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jG+VVvpZdIEx3SKi3z0lWAyajjenurq6/ZmS1dHbFCY6YvhdNDkbT4FDz3KX+tXt3pFVA+bm/LTAGzHyLNBt0PL6iSR36JHkx2tOnfsLBR3wZbFFVp4nF3bGuB/iibq83rOGJSgAe4T5pWe+iaUQOFvQ2O+7vdmSNrXhiTnIbxY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC517385783B Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so2111604f8f.0 for ; Mon, 13 Jan 2025 02:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765646; x=1737370446; 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=XP0IUpaZcu/0Z0ARc9f4PJKf43GIG6ozSigKrK43jNY=; b=Uq7I+3IC6okeyZ0qW+HOssDwM+3jACLhsDcnq1ZQtFhJ3BpcKDnE3efXLHpoqG4u7Z oP0GdJxV6wDLadVaen2eCn1ObGzhzN7N7he/ZIHIRBbKv7rM3AkMpd6kd4/ivTG4vvIN d8vfvTlBOB6jWYNhv+oTNElGaMTEk899iKOEXqXmtm6oBA+GcygsUx+MhX7qAqGKdqxi /4fg/MlSle3jixxVqJ+/lkVZ2f8Y5KmgiRIHmO9PZA5qiPk5uCyMWeUzST0jkI9+6quF xeQR8aXzyqu37BdptCq3hEv3GprqsLfzOE6VYTa0iG2CDVRlNYXPm0DHcC4/vF4uB7QE 7/2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765646; x=1737370446; 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=XP0IUpaZcu/0Z0ARc9f4PJKf43GIG6ozSigKrK43jNY=; b=YWeSHdE+rq2iLfjcs4VZmsDw98Xs/gjH0ttgnwvrwdam5P2qM1vwu3QxKodu8Pbp2q hzR5/8RJ5q6WYYjs/IGz3mAxejP/IX6+jrju4SV/iUvyo6nDiveUJO7NEPzz+MND2fid cb9N95NR8jEGJ6heiF9T+RKM+OZJVvV/mOq5ESuKeR4xZgUzJfBzb7LoQE+mxAwRkHgK LVHbMRFSgfpywL+QMUnEEXO9pSjjvH03DR6uGwMcXnBfQW5905hhrMN9ohb/AkyG/Yrw tLZepYZel2RCU/M5tfuliHUZjh+sUxFTaK4KTN1iPsx123rrXSwsotdseiBWwjqUFNxt CBkg== X-Gm-Message-State: AOJu0Yz0mxDExHSrZ4wevZhJHezSQEbxgqzFeSS28WQeYgYGQIQJDuwT pg1EjvS6EK9o+HVMYTKxQFQL7xZ56TD1LTsgVER+fS+uOq4fKkNqtyiuYLxUBCH45XbRM7CZdUY = X-Gm-Gg: ASbGncvEGfZPdxEpLYcdIk2UjP+poukPkZ7HFvoGLfSJ6d4bKO+SB27MYMGaDnY4wT5 FLkT2wOHHUfCp8gbUAYk6k82FGWoaKWs4XV7/Z4Ytb3Du0Nn+i26hUf4X/PaFubScLvs7pMrYbn faL30h+MpSaQSXzD/IKlE2DMkEkIli5VrPfncl/gtCml7tm9YLb5Zz9Fl/zBc1PecCP3zWQDBpB 40lsPeXK+HeO6x7i1DIV0PD3yjcjzcgqs6zS+BqLD66pzLmrrq4nD+TxSnydYTPV2Z46S0gxUjm shl9VRTmc/x82TWxIXYzMVkvCORx2YEGK1+uyP7aVjeiZhtDQW4JMvfZn4lwhty2Q1X3w3+U X-Google-Smtp-Source: AGHT+IFSmc3RlG5HeivzMmA2RFWaLdlIwPaBd/+GDj0j25EmzgvM8vX0N+OZsJv3Bz1hxn1FBapPOA== X-Received: by 2002:a5d:6da6:0:b0:385:e3d3:be1b with SMTP id ffacd0b85a97d-38a872e8f19mr18844552f8f.28.1736765646505; Mon, 13 Jan 2025 02:54:06 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:06 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Gary Dismukes Subject: [COMMITTED 05/14] ada: Unbounded recursion on character aggregates with predicated component subtype Date: Mon, 13 Jan 2025 11:53:38 +0100 Message-ID: <20250113105349.928779-5-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Gary Dismukes The compiler was recursing endlessly when analyzing an aggregate of an array type whose component subtype has a static predicate and the component expressions are static, repeatedly transforming the aggregate first into a string literal and then back into an aggregate. This is fixed by suppressing the transformation to a string literal in the case where the component subtype has predicates. gcc/ada/ChangeLog: * sem_aggr.adb (Resolve_Aggregate): Add another condition to prevent rewriting an aggregate whose type is an array of characters, testing for the presence of predicates on the component type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 095093cc76b..f6db5cb97a4 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1382,11 +1382,11 @@ package body Sem_Aggr is -- Do not perform this transformation if this was a string literal -- to start with, whose components needed constraint checks, or if - -- the component type is non-static, because it will require those - -- checks and be transformed back into an aggregate. If the index - -- type is not Integer the aggregate may represent a user-defined - -- string type but the context might need the original type so we - -- do not perform the transformation at this point. + -- the component type is nonstatic or has predicates, because it will + -- require those checks and be transformed back into an aggregate. + -- If the index type is not Integer, then the aggregate may represent + -- a user-defined string type but the context might need the original + -- type, so we do not perform the transformation at this point. if Number_Dimensions (Typ) = 1 and then Is_Standard_Character_Type (Component_Type (Typ)) @@ -1396,6 +1396,7 @@ package body Sem_Aggr is and then not Is_Bit_Packed_Array (Typ) and then Nkind (Original_Node (Parent (N))) /= N_String_Literal and then Is_OK_Static_Subtype (Component_Type (Typ)) + and then not Has_Predicates (Component_Type (Typ)) and then Base_Type (Etype (First_Index (Typ))) = Base_Type (Standard_Integer) and then not Has_Static_Empty_Array_Bounds (Typ) From patchwork Mon Jan 13 10:53:39 2025 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: 104671 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4101385781B for ; Mon, 13 Jan 2025 10:58:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4101385781B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=KmXU0yVy 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 A81643857820 for ; Mon, 13 Jan 2025 10:54:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A81643857820 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 A81643857820 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=1736765648; cv=none; b=iWRIcmGxARlik+aVm9t5bAdGF3KtclZG3nMou6/6NRZAoKekMLcc/cuH5+eyFjVEELa5Fn3WPWYZTE2iaKkQ/9Vng3pgVdtwsrnX2D+3PgIGXIoyMkK2O47Zi+aXnLzkE8PxOBRYrjeTGBvov1JiDT5pPGjgVUJkdw85nSTJRdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765648; c=relaxed/simple; bh=OeZ1x0UasS1qs7qIUjqQrV5h36/RMB+18GqFsl/4ZEU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kvuCQOIO5cpmhz7JcRaWr2m09qmLJx46PhAuYH9FJG+0KyLS8u3T3rceUWuAgTyAKs5lU8PthUh0Ut4PD4jsbqRGhrzXe5qra/sBI3HvbOElkNF1DaDpoXLTXgwstYIOe8ilLgHcwBYkoGK10fGmU/S04GlGyPSW1L9y0veRY4s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A81643857820 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38a34e8410bso2029987f8f.2 for ; Mon, 13 Jan 2025 02:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765647; x=1737370447; 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=jVoH+rS8um5A0PlZpohmH2T5ZJDwLoNtTB9nmI28nZ0=; b=KmXU0yVy3uLN4etnFHsNuRfLvaD0UiOHukYeQEVxsbxG9wpOKWXo2+VOVEtKr9mM0q hsifkA9akYQ/Ywf74R3y4V8HpFHAC++PJT70a2VtAiDyr09OGBWPBJxpshYJXmwPE+Yv BAYnPwIdtboD5c38mv6FlrvTYqyq2CKx6xkXnDnWNkZxuZunzGdwvN6qfzekOSZD9jGf vR6vLf17NdqJT09z8UjDcxwvGqp61ETeWYv8f051NJukZJjvcWPwQi/sSKq1pDRfXaP9 blzaeAqpw5gChB93praTClesGGrxOmPq2rL+X4EZkqfRnjaMsoU+xWDcLN+n2RlDQDXF pIzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765647; x=1737370447; 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=jVoH+rS8um5A0PlZpohmH2T5ZJDwLoNtTB9nmI28nZ0=; b=ZEx4wb1cIITmN7bfn8Ao1UTa48QWsbEOgQ66YRSsCjYa2IS8WELV9uTrBT1J8ex7mb dgxOhdwMUl4mu3zqilrZe/rxfZmSk1ku7IBoJu2nw7inyNazzOt/jyyhxoa4v9WnX70E 7k6iwo9MJS8rslHrC47KOMUNl17DJNcOY9NfNnXs2lx3TZ+FnPC6PycdmVFtd/uLQY/j W4venT523Pi2QsssRcGWzt+37zuQssxaxPUyGo2uq3pKCLWYFxHSTdvRRaIZFF6WKRm1 xFbsEQYvqEWH+fGh+jhNkhk8VnX1kiSDqMLOdKQ7qe4PobXZfKZHiqgTmlmRtpY6fQOk /E4g== X-Gm-Message-State: AOJu0Yy/Kgas/cA32+9eU54ZUR4NumTfqdJxeO8tkZ/eWNNZzeYMSg0d ixH/IHnJf6/LmXI5CWGcd8HuIE7c4ko8E6vQJ+PnQw+He8ANT0v1Hqm6bF8i/yfpi2/KBBKnFrg = X-Gm-Gg: ASbGncsprzqVd0F2h6H+f79Qo0rIdGxiMznXrLeTDZYC85fabAjmqIxRA2AH+Ol/Vfs Rn0FZLcbC3w5ngu9/0C3ALEr44ScQJq5ETCQjlJ5ze42eIFRYp7F8BqywMJoxv7gu/NwpcotcCU sFhMSmff+i80wrkHxjwc7Aur3yvCg/xQwQmdBO9+jURx4QVtXIof9adyuhgl5h2KumpMB42MCST RBdoZ6D38hby+B+QQGZ3LmAa+mt7bN7BKGvhyPROdu26EUg98/5+4ias6eQq2pQp7QtsMNfrFab x/BwMYoqwQVvq/zjg8GwDbYj+YMMhOK2lg4cciPj+KK6j48DMLRWwp9ysgAklwFECPMallNq X-Google-Smtp-Source: AGHT+IFYthz/hwW/LG4VnMWUiZfibIOdkQQL48faAKW0Epll/nE1/BgW/3oGcFrSFjDAoZQ07+TOsQ== X-Received: by 2002:a05:6000:1fa8:b0:38a:a083:9200 with SMTP id ffacd0b85a97d-38aa083947dmr5545431f8f.44.1736765647346; Mon, 13 Jan 2025 02:54:07 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:06 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 06/14] ada: Fix spurious warning about redundant parentheses in range bound Date: Mon, 13 Jan 2025 11:53:39 +0100 Message-ID: <20250113105349.928779-6-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Use the same logic for warning about redundant parentheses in lower and upper bounds of a discrete range. This fixes a spurious warning that, if followed, would render the code illegal. gcc/ada/ChangeLog: * par-ch3.adb (P_Discrete_Range): Detect redundant parentheses in the lower bound like in the upper bound. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch3.adb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index e58e2a2342b..fe727d7c094 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -3061,7 +3061,16 @@ package body Ch3 is Range_Node := New_Node (N_Range, Token_Ptr); Set_Low_Bound (Range_Node, Expr_Node); - if Style_Check then + -- If the bound doesn't require parentheses, then emit a style + -- check. Parentheses that change an "expression" syntax node into a + -- "simple expression" are required; we filter those nodes both here + -- and inside Check_Xtra_Parens itself. + + if Style_Check + and then Nkind (Expr_Node) not in N_Membership_Test + | N_Op_Boolean + | N_Short_Circuit + then Style.Check_Xtra_Parens (Expr_Node); end if; @@ -3070,10 +3079,7 @@ package body Ch3 is Check_Simple_Expression (Expr_Node); Set_High_Bound (Range_Node, Expr_Node); - -- If the upper bound doesn't require parentheses, then emit a style - -- check. Parentheses that make "expression" syntax nodes a "simple - -- expression" are required; we filter those nodes both here and - -- inside Check_Xtra_Parens itself. + -- Check for extra parentheses like for the lower bound if Style_Check and then Nkind (Expr_Node) not in N_Membership_Test From patchwork Mon Jan 13 10:53:40 2025 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: 104672 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B7A403858288 for ; Mon, 13 Jan 2025 11:03:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7A403858288 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=QTbuiVUq 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 10A0F385781B for ; Mon, 13 Jan 2025 10:54:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10A0F385781B 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 10A0F385781B 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=1736765650; cv=none; b=r8pmj6KIpgUH0j77F/G+LBgsLYGKNmF2rIZN9UuDMs6bjgpXokrm3M4kn40sxPW6kaIC6Z1BZNyTlOUQXtZa1x53xTb01pATp2aO+qj9Dp7PD4EopqOJP/1EXJ0Q5EVkL/tgeJKFpXAlrab6+RxuUWn28DlhZh9jEq11pXG/OI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765650; c=relaxed/simple; bh=y+hdnrUP26VixIgq7KcH81Z5rtoA0mJnHlzJNXv7M3w=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HffqHy1jyT/PaQ7EwFCJfURtSQ5cbYqxKBeeNBdbf5oxrHD/YYc5yJ8/GlSBeBXvAw5AavCX5BuDCSQv/UMs6PgIyXF+6DCk2LpQY5D9yP/f4gkK/zRNmGR8jkbvT+mq4lGb9ajjkoALc+J5lz8ghOD0nU+7HmVWOQ/kWfNy3zA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10A0F385781B Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361f796586so42210685e9.3 for ; Mon, 13 Jan 2025 02:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765649; x=1737370449; 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=vVBTVIMPhZ+xTwU9tnraCZz8WxTc7wb+npzW4Ps/3JM=; b=QTbuiVUq9kpjfRPmhgpg2dYt55MYMLv3OwMUnQf7RY5cSpp1mM26CAjFzzuuI7jnMh UaDpx7LNOBTVnuBlatcrG96rl+ion2vFB16WFXSNr2BDZpzV1Oli9YGJBiOmGqV0MAj2 00KSjtF+nWaRGiSzNTf0BXSib/pFg9FYyFdE5kFk62i1ISdsC0TquNU6c52xJxsHe1MA EH/eMiRxoZ+s8jsDc/qul4VRwS3zaPANDoDck68dt7dCRpL5/5n4MuvtWtrHw+eC/dyH MrrrROyQ/ovmePYwDL7oIuUMlrjaPBTcpXDeZOB/d26AcL5xcxXKD4dij27iSLg0qO1L 0J7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765649; x=1737370449; 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=vVBTVIMPhZ+xTwU9tnraCZz8WxTc7wb+npzW4Ps/3JM=; b=KY2Wka1NEH2vNyYiN48yeFVRjGDnSQRl4w8Z0IfNXuUgnGoqfjAb04ppY0obTZlxiS 8NAdYbIezG8zuBGXjJFEI6ThmrHfAZUe4zvu4raW6zZArnKlNVI7KEZAhWviNRCnKpix 4AVHjxUooPG4O6fB6cUVbmphp7HyVyUDvo8TSy8s9asIWDJAgG3vUMpPUsev8thYY7yK hVyvyu4LDNNaX+PZmuUWHx/kiyQsJfLjtxDxk1A2DXadu9ZZtSp8PioOwqfzZ3vdBYEW aXLF4MB8gSh6THmVWKeJmLANo7L+PvK9c5gRmO2gcmGJNN63XDpRbzwl9kc5IZvUu577 z7zA== X-Gm-Message-State: AOJu0YyxoZg3//hQ5x00avtufH1uwrGATgFO/mJKzbEzH/jrlfc9jbWw tnz6t8nMebsulwe0XzIGMlu29LQah/zEujRE9pR4fW6rL98YHSYZY5bR1rX1D0ddwMYYD57A1VQ = X-Gm-Gg: ASbGncskHLDsDmKFjwtiXW63JHx7b2Lp289I6hPGGbw+c+LGNq7lu1DSR1yHtC0I1Eb 3INAxK+Nm/2JPspKs2nx3e9aeOn759EdKFMv6ELw/QmyWr4FQJxapqOwEEBDmsB1FaBvZBZHlha UbNd0rDjBVYu9fQrhvXPX0IOYOygkcggtkoz4HVGe/f+zrwoiSUVVfvYisRoKG5foZpLbHwlF3r fmD/eYMWuQ4fPZ7OpF2Wb+S+TX9IuNn6JdZR3LSl0H/Y2TuTqX5Tt5946aJ2Lj0Jja36rEp43bz NT7HrME1zB0y0F66LuUbYvbQgiNAeqjKgi3GdQaPG6Pt6nOREJidyRvyXRyKdAFkiGPwkMcc X-Google-Smtp-Source: AGHT+IFVasvA/D0xYZPUhiHc7O7/nt9iW7mOOswUBRSMKdBGJyRLhjtElw6rskCafrBYzsHnW0DmPQ== X-Received: by 2002:a05:600c:3c85:b0:436:18d0:aa6e with SMTP id 5b1f17b1804b1-436e2679a7cmr209054845e9.5.1736765648260; Mon, 13 Jan 2025 02:54:08 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:07 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 07/14] ada: Remove redundant parentheses inside unary operators Date: Mon, 13 Jan 2025 11:53:40 +0100 Message-ID: <20250113105349.928779-7-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning will be soon emitted for unary operators as well. This patch removes the redundant parentheses to avoid future build errors. gcc/ada/ChangeLog: * checks.adb, exp_dist.adb, exp_imgv.adb, exp_util.adb, libgnarl/a-reatim.adb, libgnat/a-coinve.adb, libgnat/a-nbnbre.adb, libgnat/a-ngcoty.adb, libgnat/a-ngelfu.adb, libgnat/a-ngrear.adb, libgnat/a-strbou.ads, libgnat/a-strfix.ads, libgnat/a-strsea.adb, libgnat/a-strsea.ads, libgnat/a-strsup.ads, libgnat/a-strunb__shared.ads, libgnat/g-alleve.adb, libgnat/g-spitbo.adb, libgnat/s-aridou.adb, libgnat/s-arit32.adb, libgnat/s-dourea.ads, libgnat/s-genbig.adb, libgnat/s-imager.adb, libgnat/s-statxd.adb, libgnat/s-widthi.adb, sem_attr.adb, sem_ch10.adb, sem_ch3.adb, sem_ch6.adb, sem_ch7.adb, sem_dim.adb, sem_prag.adb, sem_res.adb, uintp.adb: Remove redundant parentheses inside NOT and ABS operators. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/checks.adb | 6 +++--- gcc/ada/exp_dist.adb | 2 +- gcc/ada/exp_imgv.adb | 4 ++-- gcc/ada/exp_util.adb | 2 +- gcc/ada/libgnarl/a-reatim.adb | 2 +- gcc/ada/libgnat/a-coinve.adb | 6 +++--- gcc/ada/libgnat/a-nbnbre.adb | 4 ++-- gcc/ada/libgnat/a-ngcoty.adb | 22 +++++++++++----------- gcc/ada/libgnat/a-ngelfu.adb | 2 +- gcc/ada/libgnat/a-ngrear.adb | 2 +- gcc/ada/libgnat/a-strbou.ads | 16 ++++++++-------- gcc/ada/libgnat/a-strfix.ads | 16 ++++++++-------- gcc/ada/libgnat/a-strsea.adb | 26 +++++++++++++------------- gcc/ada/libgnat/a-strsea.ads | 8 ++++---- gcc/ada/libgnat/a-strsup.ads | 16 ++++++++-------- gcc/ada/libgnat/a-strunb__shared.ads | 16 ++++++++-------- gcc/ada/libgnat/g-alleve.adb | 8 ++++---- gcc/ada/libgnat/g-spitbo.adb | 4 ++-- gcc/ada/libgnat/s-aridou.adb | 10 +++++----- gcc/ada/libgnat/s-arit32.adb | 2 +- gcc/ada/libgnat/s-dourea.ads | 2 +- gcc/ada/libgnat/s-genbig.adb | 4 ++-- gcc/ada/libgnat/s-imager.adb | 2 +- gcc/ada/libgnat/s-statxd.adb | 6 +++--- gcc/ada/libgnat/s-widthi.adb | 8 ++++---- gcc/ada/sem_attr.adb | 4 ++-- gcc/ada/sem_ch10.adb | 2 +- gcc/ada/sem_ch3.adb | 2 +- gcc/ada/sem_ch6.adb | 4 ++-- gcc/ada/sem_ch7.adb | 2 +- gcc/ada/sem_dim.adb | 4 ++-- gcc/ada/sem_prag.adb | 2 +- gcc/ada/sem_res.adb | 2 +- gcc/ada/uintp.adb | 12 ++++++------ 34 files changed, 115 insertions(+), 115 deletions(-) diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 7a5bc71f36b..dcfcaa33bcc 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -2076,7 +2076,7 @@ package body Checks is Lo := Succ (Expr_Type, UR_From_Uint (Ifirst - 1)); Lo_OK := True; - elsif abs (Ifirst) < Max_Bound then + elsif abs Ifirst < Max_Bound then Lo := UR_From_Uint (Ifirst) - Ureal_Half; Lo_OK := (Ifirst > 0); @@ -2120,7 +2120,7 @@ package body Checks is Hi := Pred (Expr_Type, UR_From_Uint (Ilast + 1)); Hi_OK := True; - elsif abs (Ilast) < Max_Bound then + elsif abs Ilast < Max_Bound then Hi := UR_From_Uint (Ilast) + Ureal_Half; Hi_OK := (Ilast < 0); else @@ -6243,7 +6243,7 @@ package body Checks is -- do the corresponding optimizations later on when applying the checks. if Mode in Minimized_Or_Eliminated then - if not (Overflow_Checks_Suppressed (Etype (N))) + if not Overflow_Checks_Suppressed (Etype (N)) and then not (Is_Entity_Name (N) and then Overflow_Checks_Suppressed (Entity (N))) then diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb index f3cc4b4f9af..694fbe47dab 100644 --- a/gcc/ada/exp_dist.adb +++ b/gcc/ada/exp_dist.adb @@ -8626,7 +8626,7 @@ package body Exp_Dist is -- The RACW case is taken care of by Exp_Dist.Add_RACW_From_Any pragma Assert - (not (Is_Remote_Access_To_Class_Wide_Type (Typ))); + (not Is_Remote_Access_To_Class_Wide_Type (Typ)); Use_Opaque_Representation := False; diff --git a/gcc/ada/exp_imgv.adb b/gcc/ada/exp_imgv.adb index a8c0fa0c1e6..c7cf06ba444 100644 --- a/gcc/ada/exp_imgv.adb +++ b/gcc/ada/exp_imgv.adb @@ -1615,9 +1615,9 @@ package body Exp_Imgv is end if; elsif Is_Decimal_Fixed_Point_Type (Rtyp) then - if Esize (Rtyp) <= 32 and then abs (Scale_Value (Rtyp)) <= 9 then + if Esize (Rtyp) <= 32 and then abs Scale_Value (Rtyp) <= 9 then Vid := RE_Value_Decimal32; - elsif Esize (Rtyp) <= 64 and then abs (Scale_Value (Rtyp)) <= 18 then + elsif Esize (Rtyp) <= 64 and then abs Scale_Value (Rtyp) <= 18 then Vid := RE_Value_Decimal64; else Vid := RE_Value_Decimal128; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index d36df94e62b..b8c6a9f8848 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -6100,7 +6100,7 @@ package body Exp_Util is if not Found and then Present (Interfaces (Typ)) - and then not (Is_Empty_Elmt_List (Interfaces (Typ))) + and then not Is_Empty_Elmt_List (Interfaces (Typ)) then -- Skip the tag associated with the primary table diff --git a/gcc/ada/libgnarl/a-reatim.adb b/gcc/ada/libgnarl/a-reatim.adb index f475ab5f265..6df99c96a77 100644 --- a/gcc/ada/libgnarl/a-reatim.adb +++ b/gcc/ada/libgnarl/a-reatim.adb @@ -216,7 +216,7 @@ is -- Special-case for Time_First, whose absolute value is anomalous, -- courtesy of two's complement. - T_Val := (if T = Time_First then abs (Time_Last) else abs (T)); + T_Val := (if T = Time_First then abs Time_Last else abs T); -- Extract the integer part of T, truncating towards zero diff --git a/gcc/ada/libgnat/a-coinve.adb b/gcc/ada/libgnat/a-coinve.adb index 68bb6a49a00..7d259db671c 100644 --- a/gcc/ada/libgnat/a-coinve.adb +++ b/gcc/ada/libgnat/a-coinve.adb @@ -1023,8 +1023,8 @@ is while Source.Last >= Index_Type'First loop pragma Assert (Source.Last <= Index_Type'First - or else not (Is_Less (SA (Source.Last), - SA (Source.Last - 1)))); + or else not Is_Less (SA (Source.Last), + SA (Source.Last - 1))); if I < Index_Type'First then declare @@ -1041,7 +1041,7 @@ is pragma Assert (I <= Index_Type'First - or else not (Is_Less (TA (I), TA (I - 1)))); + or else not Is_Less (TA (I), TA (I - 1))); declare Src : Element_Access renames SA (Source.Last); diff --git a/gcc/ada/libgnat/a-nbnbre.adb b/gcc/ada/libgnat/a-nbnbre.adb index 66fd136e9b3..60e49ba703f 100644 --- a/gcc/ada/libgnat/a-nbnbre.adb +++ b/gcc/ada/libgnat/a-nbnbre.adb @@ -132,7 +132,7 @@ package body Ada.Numerics.Big_Numbers.Big_Reals is function To_Big_Real (Arg : Num) return Valid_Big_Real is - A : constant Num'Base := abs (Arg); + A : constant Num'Base := abs Arg; E : constant Integer := Num'Exponent (A); F : constant Num'Base := Num'Fraction (A); M : constant Natural := Num'Machine_Mantissa; @@ -229,7 +229,7 @@ package body Ada.Numerics.Big_Numbers.Big_Reals is -- Local variables - V : Big_Real := abs (Arg); + V : Big_Real := abs Arg; E : Integer := 0; L : Integer; diff --git a/gcc/ada/libgnat/a-ngcoty.adb b/gcc/ada/libgnat/a-ngcoty.adb index 206737617d9..a8b1ffc19e2 100644 --- a/gcc/ada/libgnat/a-ngcoty.adb +++ b/gcc/ada/libgnat/a-ngcoty.adb @@ -67,7 +67,7 @@ package body Ada.Numerics.Generic_Complex_Types is -- their operands could overflow. Given that all operations on NaNs -- return false, the test can only be written thus. - if not (abs (X) <= R'Last) then + if not (abs X <= R'Last) then pragma Annotate (CodePeer, Intentional, "test always false", "test for infinity"); @@ -76,7 +76,7 @@ package body Ada.Numerics.Generic_Complex_Types is (Left.Im / Scale) * (Right.Im / Scale)); end if; - if not (abs (Y) <= R'Last) then + if not (abs Y <= R'Last) then pragma Annotate (CodePeer, Intentional, "test always false", "test for infinity"); @@ -599,7 +599,7 @@ package body Ada.Numerics.Generic_Complex_Types is exception when Constraint_Error => pragma Assert (X.Re /= 0.0); - return R (abs (X.Re)) + return R (abs X.Re) * Aux.Sqrt (1.0 + (R (X.Im) / R (X.Re)) ** 2); end; @@ -614,7 +614,7 @@ package body Ada.Numerics.Generic_Complex_Types is exception when Constraint_Error => pragma Assert (X.Im /= 0.0); - return R (abs (X.Im)) + return R (abs X.Im) * Aux.Sqrt (1.0 + (R (X.Re) / R (X.Im)) ** 2); end; @@ -625,29 +625,29 @@ package body Ada.Numerics.Generic_Complex_Types is if Re2 = 0.0 then if X.Re = 0.0 then - return abs (X.Im); + return abs X.Im; elsif Im2 = 0.0 then if X.Im = 0.0 then - return abs (X.Re); + return abs X.Re; else - if abs (X.Re) > abs (X.Im) then - return R (abs (X.Re)) + if abs X.Re > abs X.Im then + return R (abs X.Re) * Aux.Sqrt (1.0 + (R (X.Im) / R (X.Re)) ** 2); else - return R (abs (X.Im)) + return R (abs X.Im) * Aux.Sqrt (1.0 + (R (X.Re) / R (X.Im)) ** 2); end if; end if; else - return abs (X.Im); + return abs X.Im; end if; elsif Im2 = 0.0 then - return abs (X.Re); + return abs X.Re; -- In all other cases, the naive computation will do diff --git a/gcc/ada/libgnat/a-ngelfu.adb b/gcc/ada/libgnat/a-ngelfu.adb index 8f89cb0e525..7ce2a4c87ce 100644 --- a/gcc/ada/libgnat/a-ngelfu.adb +++ b/gcc/ada/libgnat/a-ngelfu.adb @@ -116,7 +116,7 @@ is return Sqrt (Left); else - A_Right := abs (Right); + A_Right := abs Right; -- If exponent is larger than one, compute integer exponen- -- tiation if possible, and evaluate fractional part with more diff --git a/gcc/ada/libgnat/a-ngrear.adb b/gcc/ada/libgnat/a-ngrear.adb index 6dc78ef8adf..e7b1bcd0b94 100644 --- a/gcc/ada/libgnat/a-ngrear.adb +++ b/gcc/ada/libgnat/a-ngrear.adb @@ -88,7 +88,7 @@ package body Ada.Numerics.Generic_Real_Arrays is -- Return True iff A is symmetric, see RM G.3.1 (90). function Is_Tiny (Value, Compared_To : Real) return Boolean is - (abs Compared_To + 100.0 * abs (Value) = abs Compared_To); + (abs Compared_To + 100.0 * abs Value = abs Compared_To); -- Return True iff the Value is much smaller in magnitude than the least -- significant digit of Compared_To. diff --git a/gcc/ada/libgnat/a-strbou.ads b/gcc/ada/libgnat/a-strbou.ads index 4df499f59b1..c849dbea07e 100644 --- a/gcc/ada/libgnat/a-strbou.ads +++ b/gcc/ada/libgnat/a-strbou.ads @@ -784,8 +784,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Length (Source) - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -837,8 +837,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Length (Source) - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -943,8 +943,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -1007,8 +1007,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned diff --git a/gcc/ada/libgnat/a-strfix.ads b/gcc/ada/libgnat/a-strfix.ads index aed0851493b..b959464ad2e 100644 --- a/gcc/ada/libgnat/a-strfix.ads +++ b/gcc/ada/libgnat/a-strfix.ads @@ -162,8 +162,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Ada.Strings.Search.Match - (Source, Pattern, Mapping, J)))), + then not Ada.Strings.Search.Match + (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -225,8 +225,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Ada.Strings.Search.Match - (Source, Pattern, Mapping, J)))), + then not Ada.Strings.Search.Match + (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -294,8 +294,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Source'Last - Pattern'Length) - then not (Ada.Strings.Search.Match - (Source, Pattern, Mapping, J)))), + then not Ada.Strings.Search.Match + (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -349,8 +349,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Source'Last - Pattern'Length) - then not (Ada.Strings.Search.Match - (Source, Pattern, Mapping, J)))), + then not Ada.Strings.Search.Match + (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned diff --git a/gcc/ada/libgnat/a-strsea.adb b/gcc/ada/libgnat/a-strsea.adb index 85fdb9ed9e4..45fb68297c9 100644 --- a/gcc/ada/libgnat/a-strsea.adb +++ b/gcc/ada/libgnat/a-strsea.adb @@ -71,7 +71,7 @@ package body Ada.Strings.Search with SPARK_Mode is is (if Test = Inside then Is_In (Element, Set) - else not (Is_In (Element, Set))); + else not Is_In (Element, Set)); ----------- -- Count -- @@ -125,7 +125,7 @@ package body Ada.Strings.Search with SPARK_Mode is if Pattern (K) /= Value (Mapping, Source (Ind + (K - Pattern'First))) then - pragma Assert (not (Match (Source, Pattern, Mapping, Ind))); + pragma Assert (not Match (Source, Pattern, Mapping, Ind)); goto Cont; end if; @@ -188,7 +188,7 @@ package body Ada.Strings.Search with SPARK_Mode is pragma Annotate (GNATprove, False_Positive, "call via access-to-subprogram", "function Mapping must always terminate"); - pragma Assert (not (Match (Source, Pattern, Mapping, Ind))); + pragma Assert (not Match (Source, Pattern, Mapping, Ind)); goto Cont; end if; @@ -280,7 +280,7 @@ package body Ada.Strings.Search with SPARK_Mode is pragma Loop_Invariant (for all K in Integer'Max (From, Source'First) .. J => - not (Belongs (Source (K), Set, Test))); + not Belongs (Source (K), Set, Test)); end loop; -- Here if no token found @@ -323,7 +323,7 @@ package body Ada.Strings.Search with SPARK_Mode is pragma Loop_Invariant (for all K in Source'First .. J => - not (Belongs (Source (K), Set, Test))); + not Belongs (Source (K), Set, Test)); end loop; -- Here if no token found @@ -380,7 +380,7 @@ package body Ada.Strings.Search with SPARK_Mode is pragma Loop_Invariant (for all J in Source'First .. Ind => - not (Match (Source, Pattern, Mapping, J))); + not Match (Source, Pattern, Mapping, J)); end loop; -- Mapped forward case @@ -406,7 +406,7 @@ package body Ada.Strings.Search with SPARK_Mode is <> pragma Loop_Invariant (for all J in Source'First .. Ind => - not (Match (Source, Pattern, Mapping, J))); + not Match (Source, Pattern, Mapping, J)); null; end loop; end if; @@ -425,7 +425,7 @@ package body Ada.Strings.Search with SPARK_Mode is pragma Loop_Invariant (for all J in Ind .. Source'Last - PL1 => - not (Match (Source, Pattern, Mapping, J))); + not Match (Source, Pattern, Mapping, J)); end loop; -- Mapped backward case @@ -451,7 +451,7 @@ package body Ada.Strings.Search with SPARK_Mode is <> pragma Loop_Invariant (for all J in Ind .. Source'Last - PL1 => - not (Match (Source, Pattern, Mapping, J))); + not Match (Source, Pattern, Mapping, J)); null; end loop; end if; @@ -515,7 +515,7 @@ package body Ada.Strings.Search with SPARK_Mode is <> pragma Loop_Invariant (for all J in Source'First .. Ind => - not (Match (Source, Pattern, Mapping, J))); + not Match (Source, Pattern, Mapping, J)); null; end loop; @@ -546,7 +546,7 @@ package body Ada.Strings.Search with SPARK_Mode is <> pragma Loop_Invariant (for all J in Ind .. Source'Last - PL1 => - not (Match (Source, Pattern, Mapping, J))); + not Match (Source, Pattern, Mapping, J)); null; end loop; end if; @@ -574,7 +574,7 @@ package body Ada.Strings.Search with SPARK_Mode is pragma Loop_Invariant (for all C of Source (Source'First .. J) => - not (Belongs (C, Set, Test))); + not Belongs (C, Set, Test)); end loop; -- Backwards case @@ -587,7 +587,7 @@ package body Ada.Strings.Search with SPARK_Mode is pragma Loop_Invariant (for all C of Source (J .. Source'Last) => - not (Belongs (C, Set, Test))); + not Belongs (C, Set, Test)); end loop; end if; diff --git a/gcc/ada/libgnat/a-strsea.ads b/gcc/ada/libgnat/a-strsea.ads index 1e6fd9c7a4b..92b8069b22f 100644 --- a/gcc/ada/libgnat/a-strsea.ads +++ b/gcc/ada/libgnat/a-strsea.ads @@ -148,7 +148,7 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Source'Last - Pattern'Length) - then not (Match (Source, Pattern, Mapping, J)))), + then not Match (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -195,7 +195,7 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Source'Last - Pattern'Length) - then not (Match (Source, Pattern, Mapping, J)))), + then not Match (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -295,7 +295,7 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Match (Source, Pattern, Mapping, J)))), + then not Match (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -353,7 +353,7 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Match (Source, Pattern, Mapping, J)))), + then not Match (Source, Pattern, Mapping, J))), -- Otherwise, 0 is returned diff --git a/gcc/ada/libgnat/a-strsup.ads b/gcc/ada/libgnat/a-strsup.ads index a575b2f32c2..65d13ed2cbe 100644 --- a/gcc/ada/libgnat/a-strsup.ads +++ b/gcc/ada/libgnat/a-strsup.ads @@ -852,8 +852,8 @@ is then J <= Super_Index'Result - 1 else J - 1 in Super_Index'Result .. Super_Length (Source) - Pattern'Length) - then not (Search.Match - (Super_To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (Super_To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -906,8 +906,8 @@ is then J <= Super_Index'Result - 1 else J - 1 in Super_Index'Result .. Super_Length (Source) - Pattern'Length) - then not (Search.Match - (Super_To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (Super_To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -1012,8 +1012,8 @@ is then J in From .. Super_Index'Result - 1 else J - 1 in Super_Index'Result .. From - Pattern'Length) - then not (Search.Match - (Super_To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (Super_To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -1075,8 +1075,8 @@ is then J in From .. Super_Index'Result - 1 else J - 1 in Super_Index'Result .. From - Pattern'Length) - then not (Search.Match - (Super_To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (Super_To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned diff --git a/gcc/ada/libgnat/a-strunb__shared.ads b/gcc/ada/libgnat/a-strunb__shared.ads index 9fac78a71b9..b731183df06 100644 --- a/gcc/ada/libgnat/a-strunb__shared.ads +++ b/gcc/ada/libgnat/a-strunb__shared.ads @@ -418,8 +418,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Length (Source) - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -471,8 +471,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Length (Source) - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -577,8 +577,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -641,8 +641,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned diff --git a/gcc/ada/libgnat/g-alleve.adb b/gcc/ada/libgnat/g-alleve.adb index 896786015dc..ae6b4920729 100644 --- a/gcc/ada/libgnat/g-alleve.adb +++ b/gcc/ada/libgnat/g-alleve.adb @@ -377,7 +377,7 @@ package body GNAT.Altivec.Low_Level_Vectors is begin for K in Varray_Type'Range loop D (K) := (if A (K) /= Component_Type'First - then abs (A (K)) else Component_Type'First); + then abs A (K) else Component_Type'First); end loop; return D; @@ -392,7 +392,7 @@ package body GNAT.Altivec.Low_Level_Vectors is begin for K in Varray_Type'Range loop - D (K) := Saturate (abs (SI64 (A (K)))); + D (K) := Saturate (abs SI64 (A (K))); end loop; return D; @@ -1583,7 +1583,7 @@ package body GNAT.Altivec.Low_Level_Vectors is begin if Bits (VSCR, NJ_POS, NJ_POS) = 1 - and then abs (X) < 2.0 ** (-126) + and then abs X < 2.0 ** (-126) then D := (if X < 0.0 then -0.0 else +0.0); else @@ -1959,7 +1959,7 @@ package body GNAT.Altivec.Low_Level_Vectors is begin for J in Varray_float'Range loop - D (J) := abs (VA.Values (J)); + D (J) := abs VA.Values (J); end loop; return To_Vector ((Values => D)); diff --git a/gcc/ada/libgnat/g-spitbo.adb b/gcc/ada/libgnat/g-spitbo.adb index 736b0d29282..88df3460e8c 100644 --- a/gcc/ada/libgnat/g-spitbo.adb +++ b/gcc/ada/libgnat/g-spitbo.adb @@ -255,7 +255,7 @@ package body GNAT.Spitbol is function S (Num : Integer) return String is Buf : String (1 .. 30); Ptr : Natural := Buf'Last + 1; - Val : Natural := abs (Num); + Val : Natural := abs Num; begin loop @@ -748,7 +748,7 @@ package body GNAT.Spitbol is function V (Num : Integer) return VString is Buf : String (1 .. 30); Ptr : Natural := Buf'Last + 1; - Val : Natural := abs (Num); + Val : Natural := abs Num; begin loop diff --git a/gcc/ada/libgnat/s-aridou.adb b/gcc/ada/libgnat/s-aridou.adb index b12307fabe5..e4140e83779 100644 --- a/gcc/ada/libgnat/s-aridou.adb +++ b/gcc/ada/libgnat/s-aridou.adb @@ -128,7 +128,7 @@ is (if X = Double_Int'First then Double_Uns'(2 ** (Double_Size - 1)) else Double_Uns (Double_Int'(abs X))) - with Post => abs (Big (X)) = Big ("abs"'Result), + with Post => abs Big (X) = Big ("abs"'Result), Annotate => (GNATprove, Hide_Info, "Expression_Function_Body"); -- Convert absolute value of X to unsigned. Note that we can't just use -- the expression of the Else since it overflows for X = Double_Int'First. @@ -209,7 +209,7 @@ is procedure Lemma_Abs_Commutation (X : Double_Int) with Ghost, - Post => abs (Big (X)) = Big (Double_Uns'(abs X)); + Post => abs Big (X) = Big (Double_Uns'(abs X)); procedure Lemma_Abs_Div_Commutation (X, Y : Big_Integer) with @@ -226,8 +226,8 @@ is with Ghost, Pre => In_Double_Int_Range (X), - Post => abs (X) <= Big_2xxDouble_Minus_1 - and then In_Double_Int_Range (-abs (X)); + Post => abs X <= Big_2xxDouble_Minus_1 + and then In_Double_Int_Range (-abs X); procedure Lemma_Abs_Rem_Commutation (X, Y : Big_Integer) with @@ -1760,7 +1760,7 @@ is + Big (Double_Uns (Lo (T1)))); pragma Assert (Mult <= Big_2xxDouble_Minus_1); Lemma_Mult_Commutation (X, Y); - pragma Assert (Mult = abs (Big (X * Y))); + pragma Assert (Mult = abs Big (X * Y)); Lemma_Word_Commutation (Lo (T2)); pragma Assert (Mult = Big (Double_Uns'(2 ** Single_Size) * Double_Uns (Lo (T2))) diff --git a/gcc/ada/libgnat/s-arit32.adb b/gcc/ada/libgnat/s-arit32.adb index 3ab2955626f..91082e7692a 100644 --- a/gcc/ada/libgnat/s-arit32.adb +++ b/gcc/ada/libgnat/s-arit32.adb @@ -132,7 +132,7 @@ is procedure Lemma_Abs_Commutation (X : Int32) with Ghost, - Post => abs (Big (X)) = Big (Uns32'(abs X)); + Post => abs Big (X) = Big (Uns32'(abs X)); procedure Lemma_Abs_Div_Commutation (X, Y : Big_Integer) with diff --git a/gcc/ada/libgnat/s-dourea.ads b/gcc/ada/libgnat/s-dourea.ads index 7e6759c0917..48b163ec1e4 100644 --- a/gcc/ada/libgnat/s-dourea.ads +++ b/gcc/ada/libgnat/s-dourea.ads @@ -53,7 +53,7 @@ package System.Double_Real is -- Convert a double to a single real function Quick_Two_Sum (A, B : Num) return Double_T - with Pre => A = 0.0 or else abs (A) >= abs (B); + with Pre => A = 0.0 or else abs A >= abs B; -- Compute A + B and its rounding error exactly, but assume |A| >= |B| function Two_Sum (A, B : Num) return Double_T; diff --git a/gcc/ada/libgnat/s-genbig.adb b/gcc/ada/libgnat/s-genbig.adb index 73164dabff1..82bf3f76fc2 100644 --- a/gcc/ada/libgnat/s-genbig.adb +++ b/gcc/ada/libgnat/s-genbig.adb @@ -754,8 +754,8 @@ package body System.Generic_Bignums is (Y.Len <= 1 or else (Y.Len = 2 and then Y.D (1) < 2**31)) then declare - A : constant LLI := abs (From_Bignum (X)); - B : constant LLI := abs (From_Bignum (Y)); + A : constant LLI := abs From_Bignum (X); + B : constant LLI := abs From_Bignum (Y); begin if not Discard_Quotient then Quotient := To_Bignum (A / B); diff --git a/gcc/ada/libgnat/s-imager.adb b/gcc/ada/libgnat/s-imager.adb index 3d20669b6e7..d8aaf63dcb4 100644 --- a/gcc/ada/libgnat/s-imager.adb +++ b/gcc/ada/libgnat/s-imager.adb @@ -394,7 +394,7 @@ package body System.Image_R is Digs (1) := (if Is_Negative (V) then '-' else ' '); Ndigs := 1; - X := Double_Real.To_Double (abs (V)); + X := Double_Real.To_Double (abs V); -- If X is zero, we are done diff --git a/gcc/ada/libgnat/s-statxd.adb b/gcc/ada/libgnat/s-statxd.adb index d2d035ed941..744f3888f6e 100644 --- a/gcc/ada/libgnat/s-statxd.adb +++ b/gcc/ada/libgnat/s-statxd.adb @@ -1254,7 +1254,7 @@ package body System.Stream_Attributes.XDR is -- Compute Sign Is_Positive := (0.0 <= Item); - F := abs (Item); + F := abs Item; -- Signed zero @@ -1400,7 +1400,7 @@ package body System.Stream_Attributes.XDR is -- Compute Sign Is_Positive := (0.0 <= Item); - F := abs (Item); + F := abs Item; -- Signed zero @@ -1747,7 +1747,7 @@ package body System.Stream_Attributes.XDR is -- Compute Sign Is_Positive := (0.0 <= Item); - F := abs (Item); + F := abs Item; -- Signed zero diff --git a/gcc/ada/libgnat/s-widthi.adb b/gcc/ada/libgnat/s-widthi.adb index c8219b1e4b2..959579047d1 100644 --- a/gcc/ada/libgnat/s-widthi.adb +++ b/gcc/ada/libgnat/s-widthi.adb @@ -126,8 +126,8 @@ function System.Width_I (Lo, Hi : Int) return Natural is Pow : Big_Integer := 1 with Ghost; T_Init : constant Int := - Int'Max (abs (Int'Max (Lo, Int'First + 1)), - abs (Int'Max (Hi, Int'First + 1))) + Int'Max (abs Int'Max (Lo, Int'First + 1), + abs Int'Max (Hi, Int'First + 1)) with Ghost; -- Start of processing for System.Width_I @@ -145,8 +145,8 @@ begin -- negative number (note that First + 1 has same digits as First) T := Int'Max ( - abs (Int'Max (Lo, Int'First + 1)), - abs (Int'Max (Hi, Int'First + 1))); + abs Int'Max (Lo, Int'First + 1), + abs Int'Max (Hi, Int'First + 1)); -- Increase value if more digits required diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 720a6dab4ec..af08fdb2e33 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -2266,7 +2266,7 @@ package body Sem_Attr is -- Now test for dynamic predicate if Has_Predicates (P_Type) - and then not (Has_Static_Predicate (P_Type)) + and then not Has_Static_Predicate (P_Type) then Error_Attr_P ("prefix of % attribute may not have dynamic predicate"); @@ -4019,7 +4019,7 @@ package body Sem_Attr is if (Is_Type (Tsk) and then Tsk = S) or else (not Is_Type (Tsk) and then Etype (Tsk) = S - and then not (Comes_From_Source (S))) + and then not Comes_From_Source (S)) then null; else diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 97e2c37422d..de5a8c846ba 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -4176,7 +4176,7 @@ package body Sem_Ch10 is P := Unit (Parent_Spec (Lib_Spec)); P_Name := Defining_Entity (P); - if not (Private_Present (Parent (Lib_Spec))) + if not Private_Present (Parent (Lib_Spec)) and then not In_Private_Part (P_Name) then Install_Private_Declarations (P_Name); diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 64e3f85c605..74eac9c9789 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -18561,7 +18561,7 @@ package body Sem_Ch3 is Error_Msg_N ("full view of private extension must be an extension", N); - elsif not (Abstract_Present (Parent (Prev))) + elsif not Abstract_Present (Parent (Prev)) and then Abstract_Present (Type_Definition (N)) then Error_Msg_N diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 80e0c9c634c..05bbeeddae4 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -10014,7 +10014,7 @@ package body Sem_Ch6 is -- from interfaces several null primitives which differ only -- in the mode of the formals. - if not (Comes_From_Source (E)) + if not Comes_From_Source (E) and then Is_Null_Procedure (E) and then not Mode_Conformant (Designator, E) then @@ -12680,7 +12680,7 @@ package body Sem_Ch6 is -- overridden operation is the inherited primitive -- (which is available through the attribute alias). - elsif not (Comes_From_Source (E)) + elsif not Comes_From_Source (E) and then Is_Dispatching_Operation (E) and then Find_Dispatching_Type (E) = Find_Dispatching_Type (S) diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 0df6322da2a..c2e60aaae11 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -2665,7 +2665,7 @@ package body Sem_Ch7 is then return True; - elsif not (Is_Derived_Type (Dep)) + elsif not Is_Derived_Type (Dep) and then Is_Derived_Type (Full_View (Dep)) then -- When instantiating a package body, the scope stack is empty, so diff --git a/gcc/ada/sem_dim.adb b/gcc/ada/sem_dim.adb index 0b09f3fded6..139ed661f90 100644 --- a/gcc/ada/sem_dim.adb +++ b/gcc/ada/sem_dim.adb @@ -1580,13 +1580,13 @@ package body Sem_Dim is and then Dims_Of_L /= Dims_Of_R then if Nkind (L) = N_Real_Literal - and then not (Comes_From_Source (L)) + and then not Comes_From_Source (L) and then Expander_Active then null; elsif Nkind (R) = N_Real_Literal - and then not (Comes_From_Source (R)) + and then not Comes_From_Source (R) and then Expander_Active then null; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 6c778a5dcf9..621edc7725d 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -18006,7 +18006,7 @@ package body Sem_Prag is declare Designated : constant Entity_Id := Designated_Type (Typ); begin - if not (Is_Array_Type (Designated)) + if not Is_Array_Type (Designated) or else Is_Constrained (Designated) then Error_Pragma diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 8c9c4de6f76..b73b947c9a2 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -12389,7 +12389,7 @@ package body Sem_Res is if Nkind (Rop) = N_Real_Literal and then Realval (Rop) /= Ureal_0 - and then abs (Realval (Rop)) < Delta_Value (Standard_Duration) + and then abs Realval (Rop) < Delta_Value (Standard_Duration) then Error_Msg_N ("??universal real operand can only " diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index c71960ba004..edbd95cf607 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -565,7 +565,7 @@ package body Uintp is begin -- It is not so clear what to return when Arg is negative??? - Left_Hat := abs (L1) * Base + L2; + Left_Hat := abs L1 * Base + L2; end; end if; @@ -584,7 +584,7 @@ package body Uintp is Length_R := 2; else - R1 := abs (Udigits.Table (Uints.Table (Right).Loc)); + R1 := abs Udigits.Table (Uints.Table (Right).Loc); R2 := Udigits.Table (Uints.Table (Right).Loc + 1); Length_R := Uints.Table (Right).Length; end if; @@ -635,7 +635,7 @@ package body Uintp is -- For any other number in Int_Range, get absolute value of number elsif UI_Is_In_Int_Range (Input) then - Num := abs (UI_To_Int (Input)); + Num := abs UI_To_Int (Input); Bits := 0; -- If not in Int_Range then initialize bit count for all low order @@ -643,7 +643,7 @@ package body Uintp is else Bits := Base_Bits * (Uints.Table (Input).Length - 1); - Num := abs (Udigits.Table (Uints.Table (Input).Loc)); + Num := abs Udigits.Table (Uints.Table (Input).Loc); end if; -- Increase bit count for remaining value in Num @@ -2041,8 +2041,8 @@ package body Uintp is Init_Operand (Left, L_Vec); Init_Operand (Right, R_Vec); Neg := L_Vec (1) < Int_0 xor R_Vec (1) < Int_0; - L_Vec (1) := abs (L_Vec (1)); - R_Vec (1) := abs (R_Vec (1)); + L_Vec (1) := abs L_Vec (1); + R_Vec (1) := abs R_Vec (1); Algorithm_M : declare Product : UI_Vector (1 .. L_Length + R_Length); From patchwork Mon Jan 13 10:53:41 2025 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: 104679 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 476943857719 for ; Mon, 13 Jan 2025 11:09:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 476943857719 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=PN9kkB+/ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 5DF193858288 for ; Mon, 13 Jan 2025 10:54:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DF193858288 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 5DF193858288 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765650; cv=none; b=c66yks1koPMkyX6TyX9MbcCWLPa42hMVwEEvz2rEjU9pRodB4dCuV5BJpry1gUKoX9HYYE/HYKeGdA5QkQ2WcOd+TKTtCMhRHSz+qeFUxDacqcdVlQLcQl07xxSIEuPoOoh+G4cUa67g4ifSK+lBmy6Ft15r6DvUIW/1twB4plU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765650; c=relaxed/simple; bh=t0Cu9snveI6lMiAcez85xqc6SXNDT2PW/TshM3MYwmg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BXLdBNta0w0eq3RIKQl3mQw4MPnTsDwC8jA6GJMbqdjRpRbwVPr8sjR6Kcq30yH7ykYDCVJZOProa6oh1HxC6qgwpKHTIDHOx02z3n+cget/VX8XCbkd0kG3rqswYT+ihisHosUqYnVJ4yWCxQ3MgYcbOH9mhYT34NhEMcqFFY8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DF193858288 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so47563255e9.0 for ; Mon, 13 Jan 2025 02:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765649; x=1737370449; 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=n/KosGv3Im7A0gf57RMWEDIdBjF9R2XRrwsQmn9ITik=; b=PN9kkB+/pGOSuRcjt2VrnawhoiDdGQrdsYmV1ye+vNUmoSdmJ+tHMtJlWkVLaYbzq3 tPjPUhOvQ2GeREjUfA5p1AdnEXIp/WaR2UuDqxO2ZfBaIwW+mXUYuPFOec7mz/7hdqNf gLJQ2LV8eWn7al8+rvQMS+3zqoOmXZHLQDMU+FxDZkLQM+epR+HGwyW9l9HVeVFhObV8 fWP+WQEJkk6/peZWhcYkHVCvPB5YJNBdsuBB+iwvp6IPSvio15/AtOJt0CtWpioEzzJ9 z8DiI+hNgG70G6YXzb0BZOsu/NRuKXLU+r1osRVtdDJirNuS2L8uI+Md9AH7pIV/O05f m+1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765649; x=1737370449; 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=n/KosGv3Im7A0gf57RMWEDIdBjF9R2XRrwsQmn9ITik=; b=XulFDrno7xcKAMV75pjb//RB1ul4U+CSAn6ISL7fEJSdA4AvjZ6eWxn+9nYut58WJk Daj3KCt+97mJPSC8TER8WdK2aQEnyOFEjLmX9MPeUw0jOEQyST/UbmJrm43H3Wj+dxLn wCw9ZzKDba1gPL4Ixgf/ngRElCXewxP2xSrkw0W8NfBS8RMSupdLHSvWjBbjlHe4NZ5/ CUR2nLHt38PDFBEIPbEJbP83M2HGeqcmS4u8HQbMrQQXJYV7KwdK7ff6hmWcrW0wL7Y3 ebGtZ46HyZYN+Obmf239bbvOKUQvHiHyC7Uy2+AZW9tOSeH5fY8EiL+dpOQA9WKPOG7Z 1v2Q== X-Gm-Message-State: AOJu0YwWIoGlMxjKUUsmSHtDw2wWkSBAPsZ2q5kNDQ/VAWtZZ3SpIRPc WDC0zhBhebwOEFSxi4atOfIDzMU/yYiHgGz6g0G1uWkrFsJj18U2FD3john9GT/wExPZfGVRU3A = X-Gm-Gg: ASbGncuK61JxYp3OEr2TI2teczmL/BizjCON1kJl70/czzK4Gd67D+KzaEQ4PmbBJcn n7Ta3jw+8rfqF6/sMCS2o9w3vOdiwRW6E8L9t7sTQHdP8jWBXp98l9D3ZE5bnzOSLEjpoa6ZoJj vAoR6spdEOpu1ZspJIUJ6pgRF+4PV7DsnNrInveT2brc+CAF0kV6eozxFZ+aSkpawebJ9zs2X/g ZLSwy1vOUA0eE6/sNlGLQN56/xtj/HxwqryhLxB2oGJ0FwgcyR9IiiDHPtmwwLo8f4JlfIqSGaw wH4XP79k9aDp/gNPWyOD7OFWhMfdPH42WmAxeOxjmilnOamo/W3+Rw7Rw71/FyhaPP61ZQWe X-Google-Smtp-Source: AGHT+IHTaI/xWWnY14QI4l7WcIy3xU/gVY1c4e5pVnF72KDsY1XHJQWlB9G09rWdAG4pS66YZKTnAQ== X-Received: by 2002:adf:b197:0:b0:38a:88b8:99af with SMTP id ffacd0b85a97d-38a88b89a0amr13888951f8f.22.1736765649071; Mon, 13 Jan 2025 02:54:09 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:08 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 08/14] ada: Remove redundant parentheses inside unary operators in comments Date: Mon, 13 Jan 2025 11:53:41 +0100 Message-ID: <20250113105349.928779-8-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning will be soon emitted for unary operators as well. This patch removes the redundant parentheses to avoid future build errors. gcc/ada/ChangeLog: * libgnat/s-genbig.adb: Remove redundant parentheses in comments. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-genbig.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/libgnat/s-genbig.adb b/gcc/ada/libgnat/s-genbig.adb index 82bf3f76fc2..2780305e042 100644 --- a/gcc/ada/libgnat/s-genbig.adb +++ b/gcc/ada/libgnat/s-genbig.adb @@ -91,7 +91,7 @@ package body System.Generic_Bignums is Remainder : out Big_Integer; Discard_Quotient : Boolean := False; Discard_Remainder : Boolean := False); - -- Returns the Quotient and Remainder from dividing abs (X) by abs (Y). The + -- Returns the Quotient and Remainder from dividing abs X by abs Y. The -- values of X and Y are not modified. If Discard_Quotient is True, then -- Quotient is undefined on return, and if Discard_Remainder is True, then -- Remainder is undefined on return. Service routine for Big_Div/Rem/Mod. From patchwork Mon Jan 13 10:53:42 2025 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: 104678 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1414A3857710 for ; Mon, 13 Jan 2025 11:08:57 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 2C14B3857706 for ; Mon, 13 Jan 2025 10:54:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C14B3857706 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 2C14B3857706 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765651; cv=none; b=Kdu6FNR0YSoTG22mKfxSarBlGOoiefMFn62ny0BsvPPTiK44+oT0EhaZCX7UgsPR5YiDLc1JamYz9yiZD/ThNb3S4n0YN8tveMQaxs9v7jvfo49+YSKgRcaOGpYtU6MEhue4MeV0wQOWn/chJpQpBEHPvEvFB/4Prsug/Q1SPwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765651; c=relaxed/simple; bh=u7jZBKhdW22hUTydE6QnyVGEiBsWaB0HLSWjGtEyNtQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gBPldlPsxOt+XwtSqlBnZ42znXqWuJKEZ9t/+Gd1OFwba6hd2tIqBbnaZputppPyKE6oUFJVdYyFcJXigRF4Tz3KoSB4xqzDE8yYjtvql7r9nWwtSFIEy++dq9b2OwelEntT804hxzWlMZbs1M7iFfeU+/QeaM9E49cm8iEQFSw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C14B3857706 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=FWRlkgTB Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso29117885e9.2 for ; Mon, 13 Jan 2025 02:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765650; x=1737370450; 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=lNSwy68FsTIRD87PEGQEbvvqjTKD+KfvIXhL3zv3dd0=; b=FWRlkgTB8IToqZGvi1Vvf6hVDDNma8lVcY2ndbFc9hKF5zUKaVfGuKGnTbd8VC1eKT s/AURd4sq8L8sjJYLlcXCaH7lNDvkl4zF4fpHQforDca2kKZ4MhWtWB9jtUSGnUMIgx4 1ZA4fdZk9a/BCKnsc1W2becs5g8sW3Gj2YOKukC8LVF9ETrPHbZDglJ5eo3Mo8CCHTCP iZxJVu/aRNPR9vwDaG8dA96+X4oRwBYA43l94jEZN7InT5b2EIq5Gt7JWswxL1d9RUqC 7uehjdYzy9NE4uYKwQ3NFWzubeAFXHjIpXSRfAl/4azyzvfGX4iqu9N37lL3o18hQTsB 0oiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765650; x=1737370450; 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=lNSwy68FsTIRD87PEGQEbvvqjTKD+KfvIXhL3zv3dd0=; b=eBEsE6ph9HJjK5jlV/5wIaLAGaTA8M8BEOg6qew8jXTE45gENueM44pe5nAkvG602D azNvBcYxJRnM+A2Xs1xTazmC5d1rZaAGbC55neG8yeL35TNaLUAEOwz0dXkgXrlYCXdm JchDUZQm/X95UKglqBjofDvRl1Vsl7EgoMDale05b4alaf+64d0EduFkczTRalh6HUa5 D8TjD73EpNQo7ZBwIX3ga2F50OfLIzbw+wzA0WqcaNZcZOapXsme9JNu0qDDOrGdLM8C G+WanwyDn7CqnTZsIzHcUoPddheZG8VhNtRDHDeHEpowYLXHa7K4WVQrl2yfJljP5a10 Vi+Q== X-Gm-Message-State: AOJu0YyRCweSnzPj7wltGXRh5frhwaVOJRDFjv3xtCIeTTCYfUfg/qNz dRHJuufs56uiK8n+pW/gwtpPyMh1e3v+3C229PO8I2jdSDdmR8WFKcahuya2qJ5KPyGX30frV1o = X-Gm-Gg: ASbGnctq2fgKUui3BnaPXAkwid2dZ9UeCJ3/cgsc9+jFWtJk2wjF3R+PCod2fMdJMlT i3UQSL7cdQ+xm3TX9x136pILpnTpH5AyHumqyRx7kZMBrVcZWtlo3kr3ubjrDkJQ6upwUM0bwge xw4W8tR7fbHAJidR+/fptgMnpeEGYqeOB24y+kQLWI2d7Xm8YR7ZYLs3WQkzXb5+/IYvk+r37US o99R6L1TYXmBKC/3JHb0m2cFg4s7+CPBzgLyfH3ACk+ckcdVLwSZ5WvPljlHG1WE97o2DvirPD6 4ulx3dOLj0z/ow8ZzlTdn0IM4NO3q/zm9LPzRRbmHSVVyuR58kkZ2l5bxv3abTW7imYOFHsa X-Google-Smtp-Source: AGHT+IFI7NoT0koYBI+waqlZHQybob9qwtklaL2PRq5L6f7Rf5igVPFTLxBS36bz3CbZfU9686nwNg== X-Received: by 2002:a05:600c:3543:b0:434:f767:68ea with SMTP id 5b1f17b1804b1-436e2677c7dmr201065265e9.5.1736765649888; Mon, 13 Jan 2025 02:54:09 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:09 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 09/14] ada: Warn about redundant parentheses inside unary operators Date: Mon, 13 Jan 2025 11:53:42 +0100 Message-ID: <20250113105349.928779-9-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning is now emitted for unary operators as well. gcc/ada/ChangeLog: * par-ch4.adb (P_Factor): Warn when the operand of a unary operator doesn't require parentheses. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch4.adb | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 648a4cf6464..ca02f1baac1 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -2839,6 +2839,30 @@ package body Ch4 is Node1 : Node_Id; Node2 : Node_Id; + subtype N_Primary is Node_Kind with Static_Predicate => + N_Primary in N_Aggregate + | N_Allocator + | N_Attribute_Reference + | N_Case_Expression -- requires single parens + | N_Delta_Aggregate + | N_Direct_Name + | N_Explicit_Dereference + | N_Expression_With_Actions -- requires single parens + | N_Extension_Aggregate + | N_If_Expression -- requires single parens + | N_Indexed_Component + | N_Null + | N_Numeric_Or_String_Literal + | N_Qualified_Expression + | N_Quantified_Expression -- requires single parens + | N_Selected_Component + | N_Slice + | N_Subprogram_Call + | N_Target_Name + | N_Type_Conversion; + -- Node kinds that represents a "primary" subexpression, which does not + -- require parentheses when used as an operand of a unary operator. + begin if Token = Tok_Abs then Node1 := New_Op_Node (N_Op_Abs, Token_Ptr); @@ -2849,6 +2873,13 @@ package body Ch4 is Scan; -- past ABS Set_Right_Opnd (Node1, P_Primary); + + if Style_Check then + if Nkind (Right_Opnd (Node1)) in N_Primary then + Style.Check_Xtra_Parens_Precedence (Right_Opnd (Node1)); + end if; + end if; + return Node1; elsif Token = Tok_Not then @@ -2860,6 +2891,13 @@ package body Ch4 is Scan; -- past NOT Set_Right_Opnd (Node1, P_Primary); + + if Style_Check then + if Nkind (Right_Opnd (Node1)) in N_Primary then + Style.Check_Xtra_Parens_Precedence (Right_Opnd (Node1)); + end if; + end if; + return Node1; else From patchwork Mon Jan 13 10:53:43 2025 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: 104676 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C426F385773F for ; Mon, 13 Jan 2025 11:08:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C426F385773F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=a3u12v3g X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 064C5385770A for ; Mon, 13 Jan 2025 10:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 064C5385770A 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 064C5385770A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::432 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765652; cv=none; b=q2zNu0e9tRkY63ak+IANWow5y0LXdgNYdxCnOVV0ugw4Pa6nApRuL7RVbBNXHrt98hRlYabV+m2oRzKNCfqBbQDDlJT0TdXFSwN8+ihxLFRkYuWCfQhqGhfmtRVhmbCBZ4Fk2W1bScoMIOPgPgl2dy3kb4+aN7XN7FCp43OG6aY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765652; c=relaxed/simple; bh=yHbMKtF5TcZLpKy4X+gBeEKRLb4mVpqs2aOyYV6GdTw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pdKG0ds+SVviNd2VSIi+5H56tKODLYOX0qBPUF3kf2WYQCQvq2iRjbtbRiqlNRNiZRLSok76gfXYFN+UCRvpvywIgxDZFLRECjcNVjaVY78E+3fGvkjMHd/RPOOCHdoMGoXMv7AxfozkGZlTjFlJESWwtuy8PHJSPy66gJ7viQ4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 064C5385770A Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385df53e559so3309575f8f.3 for ; Mon, 13 Jan 2025 02:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765651; x=1737370451; 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=2dTsTAIMyPaqsXtAPgUKkmDGQKO6PAeAwjF3Jd44G94=; b=a3u12v3grVRDld+D8hEC4OSqV44j1ZJPsesbF+DFFUAFfLkouXlw5VEZK/VXgOYb6n /t9gIZr0Tj4S4ipR6kcDHeJIkLGrvam0Fj3WC38C4cSUfCV3iKrWASxe6J0k1QLXGdHT Np1ap4QRtx9uuY3IvlloPR1tSYA+kbfmIe6odA0imdrdQjRV1ctmmJpYjFJuuUImflFW lw2+uTdqmJkHlQyjbX9JqBPpYn5t60lUGRNju6TdPfv6JtLJGLZ0ajh1SSKjAymVvzWO KTsURffaZn4SmCW7/QxP/dc+Y6gdZsrIEJD3t6grnxhE+RmXgB5m8Qh8Doa7NJXnWjzT mr5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765651; x=1737370451; 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=2dTsTAIMyPaqsXtAPgUKkmDGQKO6PAeAwjF3Jd44G94=; b=lMsBoMx7W05Ziw2ABF9F1Q61J2VFi2U5yqtQdNSTlfIq1MtBoe7DBgJDTUj8r6bNQM 15gZb7tm6DxFKi9ELnfTq7QYHomlUctff5E3yWkb6vAPKfzgA6vJye48Pd4z2pQgbCKn txUjkC99Tvy5O4QQ5uuVBMBJaIIOv1SLZkeXK37O1j4KGRLN4vb2FA4fhL0r1Q5P7ctu vABXMuCdH894bKE1sPeTmEXt/SKTRNrsRr+ilS7n3rAz07ituX27mPTGb1VIPUJXlcTa 9zrQqH3MUbLzEy0+XU4ByYNvtvEoNCcoGfsxyBsABDm8fGbXEr2crKDzDCZTnfReiQ1C c/ow== X-Gm-Message-State: AOJu0YxLmddu8rli+WqdtGGsyAYgn6n5OMspudQ67NsHwwnrPwOEzJgR Z6b/P2l0hibpNT/dMvgMS0UOdo/nulFGk/YpDCh9KwNm+Yms3dHol0j1+VgHDC/d+qa1UZuYyyY = X-Gm-Gg: ASbGncuLXubBm2M8WqXAURItiL8JI8QRPsom7N3dn4RUOP5U/sPhIRiMfeKkmwnIZ2C OsCVLbwHpyZlUZy8+84rCPtwrUZS0oa2/agS3ugIyY95s5e1NqnZngx1rlQCJOOx0RX5sIXjesX zCbMr4Hsbnt/RojqdkP1A0quTsL3vd/bnSAH4R1ikBPDm+rD2U1bXJ6KZ0Z3fE6n5DNxHayEx2k HtOzB9KFAkTvHZuPXJUWkSYe3h2O0syK2ygj4B1s0dzFgd/NoXd8cvxCrfhCMUPW/Ndk4Pecrwt lNKpLk7OQQafecSos8refmQF1rnDdEApWy8K/HjmeHxcPlJWYGoFbumaZlByrA5gmReECRfR X-Google-Smtp-Source: AGHT+IG3CDKW8S1ydfKfy4LZIMXWi0VGzXeYO5qKInmFrXHawlCUV1QTB4TcaP2uepnJXMDlryNgdA== X-Received: by 2002:a5d:64a3:0:b0:386:3e0f:944b with SMTP id ffacd0b85a97d-38a8730fbd5mr16585771f8f.37.1736765650642; Mon, 13 Jan 2025 02:54:10 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:10 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Javier Miranda Subject: [COMMITTED 10/14] ada: Cleanup preanalysis of static expressions (part 4) Date: Mon, 13 Jan 2025 11:53:43 +0100 Message-ID: <20250113105349.928779-10-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Javier Miranda Fix regression in the SPARK 2014 testsuite. gcc/ada/ChangeLog: * sem_util.adb (Build_Actual_Subtype_Of_Component): No action under preanalysis. * sem_ch5.adb (Set_Assignment_Type): If the right-hand side contains target names, expansion has been disabled to prevent expansion that might move target names out of the context of the assignment statement. Restore temporarily the current compilation mode so that the actual subtype can be built. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 25 +++++++++++++++++++++---- gcc/ada/sem_util.adb | 5 ++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 432debf3e25..12d6426671e 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -121,6 +121,9 @@ package body Sem_Ch5 is Lhs : constant Node_Id := Name (N); Rhs : constant Node_Id := Expression (N); + Save_Full_Analysis : Boolean := False; + -- Force initialization to facilitate static analysis + procedure Diagnose_Non_Variable_Lhs (N : Node_Id); -- N is the node for the left hand side of an assignment, and it is not -- a variable. This routine issues an appropriate diagnostic. @@ -318,7 +321,24 @@ package body Sem_Ch5 is and then No (Actual_Designated_Subtype (Opnd)))) and then not Is_Unchecked_Union (Opnd_Type) then - Decl := Build_Actual_Subtype_Of_Component (Opnd_Type, Opnd); + -- If the right-hand side contains target names, expansion has + -- been disabled to prevent expansion that might move target + -- names out of the context of the assignment statement. Restore + -- temporarily the current compilation mode so that the actual + -- subtype can be built. + + if Nkind (N) = N_Assignment_Statement + and then Has_Target_Names (N) + and then Present (Current_Assignment) + then + Expander_Mode_Restore; + Full_Analysis := Save_Full_Analysis; + Decl := Build_Actual_Subtype_Of_Component (Opnd_Type, Opnd); + Expander_Mode_Save_And_Set (False); + Full_Analysis := False; + else + Decl := Build_Actual_Subtype_Of_Component (Opnd_Type, Opnd); + end if; if Present (Decl) then Insert_Action (N, Decl); @@ -366,9 +386,6 @@ package body Sem_Ch5 is T1 : Entity_Id; T2 : Entity_Id; - Save_Full_Analysis : Boolean := False; - -- Force initialization to facilitate static analysis - -- Start of processing for Analyze_Assignment begin diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 058c868aa07..0e1505bbdbe 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -1467,10 +1467,9 @@ package body Sem_Util is -- Start of processing for Build_Actual_Subtype_Of_Component begin - -- The subtype does not need to be created for a selected component - -- in a Spec_Expression. + -- The subtype does not need to be created during preanalysis - if In_Spec_Expression then + if Preanalysis_Active then return Empty; -- More comments for the rest of this body would be good ??? From patchwork Mon Jan 13 10:53:44 2025 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: 104677 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 008B83857713 for ; Mon, 13 Jan 2025 11:08:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id C88853857711 for ; Mon, 13 Jan 2025 10:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C88853857711 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 C88853857711 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765653; cv=none; b=L0mOguHfaOYtWPg5F13dKRkZxWQnTJ7KhnYL0/Ko/oTSM1Df6VPXxMWcHSQX62g9TTo40QzVDfSxIAAxALnu0JSktPytfQEbJR0ti33Wiwc/OV+fA2fXlK8/8jFwzLbq5/qMfRi/MksyIkrWB1BJ23pNSB4B7E95GCdRMAKXRzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765653; c=relaxed/simple; bh=rWjZNKf1G38SoIUWFD9V9rl2wYvt9WgtUwWEhg2e5QY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=A67hO3OIv9uTxW80jNBbrqXbkl0yyI9WI+9UoEvVXoj1/8QrqCF6naHP/Qq9v/Hezg8Rr+8lnzRuIUg/uUeYVep9XNIarZ+NeJoLvSKDf1Qkl/U2udsMZSJyC/oPhx9GFw6xYHUngTl2LwuIRodQ2UuNzI6tmdgAv1Y7OwY83U4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C88853857711 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Oq1ML5gn Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43618283d48so29187785e9.1 for ; Mon, 13 Jan 2025 02:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765651; x=1737370451; 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=wb2LZSkaO/oIJZgv5te77c9rZiZPxdvleDgvADV2qVs=; b=Oq1ML5gnXEW1dDYCG6b0kDHc/eXd0WOX2zpTL8GXWMHTyGIv11Gjk71Cxz/YCxhabC TiaAfWrAAuNXx5vNd/QebuE34N8VpjGZuk2fY+1cuZ75v48Cob8hajvHTRC7Cqsy7xbM I1LcYuGF08FuIrSGpJuc3C+XhfzIuW9aIcEx/2w6L99coIIdhdXf1IB2kyKXx4NkZzdB 4qh6ekOWCIw/OuUkWwsJt/Va/rd5PcPdFv49Tim6Mikf6i+5ooDQoOKLwQg/kqOKDp8T FA2eY3KkPonYLlZa88AHTYhwkoCsgWEpCvs0Qa70TNJXapT+FFSYUfvkV6cKJrAFFy3m duzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765651; x=1737370451; 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=wb2LZSkaO/oIJZgv5te77c9rZiZPxdvleDgvADV2qVs=; b=P9+QXONLPqPt9bVcgdQu0RJh0lWMtSTJnH0Q4KML54CmRtQnJ4PTVCttnTMW2e2Zi2 uvrwZ08ncbUceULHstl6nENtJ6k6Kq7LlKSewa5fNmg36MRmy4LuZHOCkkcqiYaYYE0Q WwPOCjHNI8QkLPrSSL4URoLA6jTLgfX/F3eHzsh94BEhysQaRM5YUCTBN/eNt58KuKnS p6R49wzCePogqIRw2UJWaX0ybrcGcId9yJSbTa+Rcl3A3hhQ52QGS7uRyvyMlxdGZXW8 j5pmDQVrg7l6iJIvZiUD4YedqHW5mlbiXNWDX9j/hYCDnhkBo5gsT2bGRLnCXLdhl0tZ jiRA== X-Gm-Message-State: AOJu0YzcNgf49FX+TeDO4NnL9bkeU/h13RF0V6VsT8X2F3ae3P4vtnLl G3NjPybJf22wqMETqbSQvC/Zl34/kpkkgiCOpM+7KUBal8HWO+HOV40zANlg58aIbd0wmwuHobc = X-Gm-Gg: ASbGncsJtoJbefDoAysVLQlAovzuJOl2c7vKMK4ZnTClve+V7KzBemBw264QzGYNgf+ WeUiSeAxJWjfHzYLAVOyVaZwYoQLEB8V9rAzGHosnlwW1AsMpazzN/8y8I1KCOeB2atx6o7Updg 4Zl4JlJaJicOIAZ4vQNWJNA+tc/P2dOOjiwoEIlVsxyb9RMvMp+clICdJoe2Ef0x0kV5jZucpAA Arh2le+5LNINX82fX/PfPKp31zTGsyI9FQnInIT6+VusFGlyTErEbAAvD+3QQwnLt7UrJYPOgQC Xxc0y5taf5x5Zx5UG/2PyyMuyx0ojPukyIqaN61ZB4xvPoYJE7VExbeTt5e0dSz7gkOZFwxm X-Google-Smtp-Source: AGHT+IHYfYD6f9qkZtQ4qkUw/HWwKjaH23ZC6KWv3zykhrqGQjqllhe1meVWCmaLh4982dxbt356vQ== X-Received: by 2002:a05:600c:3ca2:b0:434:9499:9e87 with SMTP id 5b1f17b1804b1-436e26e5159mr158568645e9.25.1736765651411; Mon, 13 Jan 2025 02:54:11 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:10 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 11/14] ada: Remove redundant parentheses inside unary operators (cont.) Date: Mon, 13 Jan 2025 11:53:44 +0100 Message-ID: <20250113105349.928779-11-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning will be soon emitted for unary operators as well. This patch removes the redundant parentheses to avoid build errors. gcc/ada/ChangeLog: * libgnat/a-strunb.ads: Remove redundant parentheses inside NOT operators. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-strunb.ads | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/ada/libgnat/a-strunb.ads b/gcc/ada/libgnat/a-strunb.ads index 5a1427c31a2..60d57954e5c 100644 --- a/gcc/ada/libgnat/a-strunb.ads +++ b/gcc/ada/libgnat/a-strunb.ads @@ -432,8 +432,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Length (Source) - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -485,8 +485,8 @@ is then J <= Index'Result - 1 else J - 1 in Index'Result .. Length (Source) - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -591,8 +591,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned @@ -655,8 +655,8 @@ is then J in From .. Index'Result - 1 else J - 1 in Index'Result .. From - Pattern'Length) - then not (Search.Match - (To_String (Source), Pattern, Mapping, J)))), + then not Search.Match + (To_String (Source), Pattern, Mapping, J))), -- Otherwise, 0 is returned From patchwork Mon Jan 13 10:53:45 2025 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: 104680 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28AF63857BB0 for ; Mon, 13 Jan 2025 11:12:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28AF63857BB0 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=XYLBrZZg X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id A5EF93857810 for ; Mon, 13 Jan 2025 10:54:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5EF93857810 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 A5EF93857810 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::433 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765653; cv=none; b=hPArpnXsjwOTu0o2UYbdoOPFqc5qsJNzQubBGoBpWupvARX8Ot09zxvh9XI6H8+BKrN0eEbnHqnR8qIsy18zaIBSJfHCRRJHiiDLEH7ATR0GPiSIjMfKtGtAUt0DaslS4tgUpjprR8UUMrSXopfRtnAh7hL1HZvGZOrZKG4xHEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765653; c=relaxed/simple; bh=34N/sPInvuAH+BwfN5TChGkjR710RB6CEmboZwHmWeQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=l/m57UO0HBun+7h7HBxJAUMkynEfUY8iNbiIWLP7A/lsfuOMhLq4PTEGtyvY9O30y8U+cjxMOlOc6gnMH4BlbjgSihIuV790l8G1Nn9xhu5ttbwuzyoDFBZnza4fSQrl+Y+TMEq251mNZbmeySNw2Pabjt1t70l20hd/PGdau6c= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5EF93857810 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-385de9f789cso2975441f8f.2 for ; Mon, 13 Jan 2025 02:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765652; x=1737370452; 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=pCiEkRCjn91IJbzMaw6AENc7aiT+6FyF8oTiGHJejFU=; b=XYLBrZZgcNCGFUl0KVYJ9JVI8KxeUuD9qUmDn/nZ34MlkyHtBqX4/ow5zDZCZVizSK 6N28vEmFjb9WaXjv97+jcV6WRwUjYXGbnaYB+OLxt8Efm9lT50hIdfCUJrnCCrQ/TieT RLrnV1TDRL4O8gbBUQMepYluLo9yiY73VUvnqkDRC19r7bbe7/H8F4iPybpXXy044bJY ujJOdHVvEI9oQ2m9LLuDuURcxGs0jh6l0OKSo4f/suYK9ZaBNSKkdDrF724bPRkDvs0N oR99srS0X/wev7zPVS6Mb9F4kw1pXW/UKy7/92gPklcWPfcV/jJ8TPu2bQDiATLn8w/Y weFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765652; x=1737370452; 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=pCiEkRCjn91IJbzMaw6AENc7aiT+6FyF8oTiGHJejFU=; b=LFcUn03wL3pzb4zrcR/HFr9DltjaOZN4GgxikVQ9+kEoC1+hFL3TbOZxVvCcKDepb0 KUpHqWOuSjIj4T+RLGSy/VpH8JqCW5q/ztI/C0wNgX7CxcgWG5l0UOE2oupOpRzSoqG8 mCy6HASY7EnzwD4eiyLH0mfD0GE2vEG2eGXme5b5Ea8QGppVtYbdf4gHUeDxzPwIDPbp 8+nKJvvOBPrVo7octs/x0wDkqkdQTk5aukeRxEbKzQG2wq/tYbWv2BOmvk3tWJz6o2jP WruD5yA0X2UKmDksg3kRGFNawa04AzOJtg3+sl52E6LXE0C+92hjQz85QNHEdx5NXbaN SXcg== X-Gm-Message-State: AOJu0Yxz7mhARdM4NXje8IK0pf3/d4K0f+LIElSPRHaeWkkppQgoCizn OPVUhnMLpX/k/XmdBYldng+P9VBZy+8VE5/1vWX3SETvNT0xn4xjphjuUgczvcUh1Ck9bQ7z4A4 = X-Gm-Gg: ASbGnctJ0TBgQRksBJrj5UjwfcohP94KKGzGkg6sapqS1QU1bNmiDAAEy67d7UjvVcx jm5YMv4lMNf2eAnceEbYpd2daVf4BHL/9UhL+BWWEnmJUtXrCUG/H+lNQQZAxgKmXiYFbD8YhhB z1N9lvlEf8x1na5kDyzEr/ZGONlaxGj477mjkDfi9CC415WjrLVsRSVW5fFAqQqxrUR/GDiZtCb YwoViVAdEPJhqASigAXLqpZGExkVRZBfo3DoXoqO0AAfZ7x+42AiiFblD0J9MkBflkpuciud12g 6K/wTpgPx3WnmTVY2ewchir/NP03o2eC6tRSMOBaSPeAQHpQon76DZcoHMGoE+Rs+WUnuShv X-Google-Smtp-Source: AGHT+IFwPyVcAfjJJRlENiFIG+VY9ri/5NZNcKEP0YMO4hLyWL4X98nXQdbnwzXNm5GwKW2xeOiMIQ== X-Received: by 2002:a05:6000:460b:b0:385:dffb:4d56 with SMTP id ffacd0b85a97d-38a87317e45mr17061762f8f.53.1736765652266; Mon, 13 Jan 2025 02:54:12 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:11 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Pascal Obry Subject: [COMMITTED 12/14] ada: Fix relocatable DLL creation with gnatdll Date: Mon, 13 Jan 2025 11:53:45 +0100 Message-ID: <20250113105349.928779-12-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Pascal Obry gcc/ada/ChangeLog: * mdll.adb: For the created DLL to be relocatable we do not want to use the base file name when calling gnatdll. * gnatdll.adb: Removes option -d which is not working anymore. And when using a truly relocatable DLL the base-address has no real meaning. Also reword the usage string for -d as we do not want to specify relocatable as gnatdll can be used to create both relocatable and non relocatable DLL. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gnatdll.adb | 8 +------- gcc/ada/mdll.adb | 13 +++++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/gcc/ada/gnatdll.adb b/gcc/ada/gnatdll.adb index 8881fc91ab4..0faf79f361b 100644 --- a/gcc/ada/gnatdll.adb +++ b/gcc/ada/gnatdll.adb @@ -134,10 +134,8 @@ procedure Gnatdll is P (" -l file File contains a list-of-files to be added to " & "the library"); P (" -e file Definition file containing exports"); - P (" -d file Put objects in the relocatable dynamic " + P (" -d file Put objects in the dynamic " & "library "); - P (" -b addr Set base address for the relocatable DLL"); - P (" default address is " & Default_DLL_Address); P (" -a[addr] Build non-relocatable DLL at address "); P (" if is not specified use " & Default_DLL_Address); @@ -315,10 +313,6 @@ procedure Gnatdll is Must_Build_Relocatable := False; - when 'b' => - DLL_Address := To_Unbounded_String (Parameter); - Must_Build_Relocatable := True; - when 'e' => Def_Filename := To_Unbounded_String (Parameter); diff --git a/gcc/ada/mdll.adb b/gcc/ada/mdll.adb index 281f6a97e5f..64350ff2ec3 100644 --- a/gcc/ada/mdll.adb +++ b/gcc/ada/mdll.adb @@ -77,10 +77,7 @@ package body MDLL is Bas_Opt : aliased String := "-Wl,--base-file," & Bas_File; Lib_Opt : aliased String := "-mdll"; Out_Opt : aliased String := "-o"; - Adr_Opt : aliased String := - (if Relocatable - then "" - else "-Wl,--image-base=" & Lib_Address); + Adr_Opt : aliased String := "-Wl,--image-base=" & Lib_Address; Map_Opt : aliased String := "-Wl,-Map," & Lib_Filename & ".map"; L_Afiles : Argument_List := Afiles; @@ -133,7 +130,7 @@ package body MDLL is -- 2) Build exp from base file Utl.Dlltool (Def_File, Dll_File, Lib_File, - Base_File => Bas_File, + Base_File => (if Relocatable then "" else Bas_File), Exp_Table => Exp_File, Build_Import => False); @@ -148,7 +145,7 @@ package body MDLL is -- 4) Build new exp from base file and the lib file (.a) Utl.Dlltool (Def_File, Dll_File, Lib_File, - Base_File => Bas_File, + Base_File => (if Relocatable then "" else Bas_File), Exp_Table => Exp_File, Build_Import => Build_Import); @@ -223,7 +220,7 @@ package body MDLL is -- 2) Build exp from base file Utl.Dlltool (Def_File, Dll_File, Lib_File, - Base_File => Bas_File, + Base_File => (if Relocatable then "" else Bas_File), Exp_Table => Exp_File, Build_Import => False); @@ -247,7 +244,7 @@ package body MDLL is -- 4) Build new exp from base file and the lib file (.a) Utl.Dlltool (Def_File, Dll_File, Lib_File, - Base_File => Bas_File, + Base_File => (if Relocatable then "" else Bas_File), Exp_Table => Exp_File, Build_Import => Build_Import); From patchwork Mon Jan 13 10:53:46 2025 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: 104674 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E9183857709 for ; Mon, 13 Jan 2025 11:04:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E9183857709 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=RyJasTEK X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 7D0A73857BB0 for ; Mon, 13 Jan 2025 10:54:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D0A73857BB0 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 7D0A73857BB0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765654; cv=none; b=iaa0dJdq8FWwotR167oL4Vkik6XcipkVsxm1cruBhlDK5WVmoLqaU6UVOzqAC9qTyVrPhAVnEwrpwFCnRUha8PSz0g6EMU5/BSGMFsHpWSP/SOsq7PA+LUlaMQGKmUW0c0SpEvj21ThiaJT7OAlOokytt8iI20Xn+iGDwPmCP08= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765654; c=relaxed/simple; bh=adFxkCwPE7nZ0E142sh/wKfjQucGk3LwXs4IHqRiTbA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=n/hP/xVEjhjiJrOQF3Hx+Kz4mN+wSyo1yJ8KXR+MWMQvOWPIIdSxvB25r1YUMCGteH7lyV+0PaPLCunNQviLd5Uh8dvm8PgcKB09O3FNtzhS9HUK310p1dfkEm7YibS1QgVt2IqGXtYbI6sJ1UdSJumsPZoc2qgHNl/piFMxbJw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D0A73857BB0 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385e27c75f4so2912214f8f.2 for ; Mon, 13 Jan 2025 02:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765653; x=1737370453; 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=AhYujBpSCBAS/7NCVvAohmFmY+hX14iVfjJ4KwTEAcY=; b=RyJasTEKv54iGSyIGQgPeUMAacJhAzobv4veh+2L2JlhozIJbSdlsV7LIoBnBZnn06 P6ZwmF6x0i4ixnP94pWFGv05RMV8aTV8FgvHYRyMPJm4R4npjTEda9Rxf1wRHHXrVwJs sjI2c9Vq827UTQzAt+0YaW8fZ3SkRcOE4R4YKUOXtNzwAU2BMchtdc26/YIW3+yOz9ii fc807NlvQOPpcvHHAdZwv8NgPI4xA3MuizF7Nf7X09tAIBZw+RR77ll3+fncclj6pjHg eKjppS35ACD6kWAdoDslGosiexdTiuUEbN6FUAf9Ottiw7kp/SnAUJk8MKVsArnVtoAM bS0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765653; x=1737370453; 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=AhYujBpSCBAS/7NCVvAohmFmY+hX14iVfjJ4KwTEAcY=; b=BnhSKg/d2BxPN0UHb83D5s+XrsUJaLVm8yaxeD1pZ9NpWGpJdYOK+cnaM4pwduO7pw Ba8M8SJuLkeKvFqQ3pbX5zLj4sxoA7GdX6rlJldeIEcImJcGADR0D+Fz0CPciK8bApP4 mvdJy3r9vyVNV0scLgMeXIX9e1hU2+WpYFbPOYZUGiU8gbcFRz62mtPXPsEmO0hj6eHs yYXin3qXjNTWQWPOOF4GkTqfouI+JzeqPSIyuMspX3OaKQRRid7jW0AeSyw0EsItaTK+ UjDCDSwGn4GF8UqkMCiVRlz7JKAbqlHZAjtwoIZgKEKYcFvrZO4mNEcjbQFbB0UPh1gN X5Nw== X-Gm-Message-State: AOJu0YxhSILE1OAHfL9smDoh/rpbMsmOceKz/FqzlcGLZgCZplCKDONF XjXM/lBqn8zVSX5PCSYkHJqloLto95OBv9DLRBz7wRSUmPsCDNArVGY8lpyokVOCjqG9yyWOtkg = X-Gm-Gg: ASbGncvplbS71gxVsvopog/tNXPp5x35yd0+/D9LJfGzbcvnu6ZyQvxCv6BjNHaLeBs ycxQURgLL0IqXIT20YaDoXoYlSLKg/p7e98xQ+///y4bOCOgEf8NErr62fYEw7pOcx8En2vdrVQ YeNh1ahCpDD4vi5trwo0aBlUhZoIvMEPyM5WxzWdKc1EtUcxx1nmFTle2WqO2bYEylbG7N7KbML jdGzY84gRa5i85B6rDSgPYljdqJZfjPWRqlO70fvwok6+JEQQ2DmSoFXWA/tphPsNKmtuqnigdb iV55vAr8Lz0W3/k0cko8cg2z1fmODn/tzp/EswCi/VE12yoLqHCIe+MEz3lpu9LFFYI+A3DA X-Google-Smtp-Source: AGHT+IE+4E2Pa/w1+m/QU1+x2mZtimSxxjo5cgseEErxFeLXhmt69rYML0XoWkv48DRjbCovKs80yg== X-Received: by 2002:a5d:59ab:0:b0:386:37f5:99f6 with SMTP id ffacd0b85a97d-38a8733bf6dmr18388217f8f.53.1736765653102; Mon, 13 Jan 2025 02:54:13 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:12 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Javier Miranda Subject: [COMMITTED 13/14] ada: Cleanup preanalysis of static expressions (part 5) Date: Mon, 13 Jan 2025 11:53:46 +0100 Message-ID: <20250113105349.928779-13-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Javier Miranda Partially revert the fix for sem_ch13.adb as it does not comply with RM 13.14(7.2/5). gcc/ada/ChangeLog: * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Restore calls to Preanalyze_Spec_Expression that were replaced by calls to Preanalyze_And_Resolve. Add documentation. (Check_Aspect_At_Freeze_Point): Ditto. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 9bbec28ddb3..072ec66a8f3 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -10039,7 +10039,7 @@ package body Sem_Ch13 is -- If the predicate pragma comes from an aspect, replace the -- saved expression because we need the subtype references - -- replaced for the calls to Preanalyze_And_Resolve in + -- replaced for the calls to Preanalyze_Spec_Expression in -- Check_Aspect_At_xxx routines. if Present (Asp) then @@ -10853,12 +10853,12 @@ package body Sem_Ch13 is | Aspect_Static_Predicate then Push_Type (Ent); - Preanalyze_And_Resolve (Freeze_Expr, Standard_Boolean); + Preanalyze_Spec_Expression (Freeze_Expr, Standard_Boolean); Pop_Type (Ent); elsif A_Id = Aspect_Priority then Push_Type (Ent); - Preanalyze_And_Resolve (Freeze_Expr, Any_Integer); + Preanalyze_Spec_Expression (Freeze_Expr, Any_Integer); Pop_Type (Ent); else @@ -10894,6 +10894,12 @@ package body Sem_Ch13 is end if; return; + -- The expression must be analyzed in the special manner described in + -- "Handling of Default and Per-Object Expressions" in sem.ads, since + -- any static expressions within an aspect_specification also cause + -- freezing at the end of the immediately enclosing declaration list + -- (RM 13.14(7.2/5)). + -- The default values attributes may be defined in the private part, -- and the analysis of the expression may take place when only the -- partial view is visible. The expression must be scalar, so use @@ -10902,7 +10908,7 @@ package body Sem_Ch13 is elsif A_Id in Aspect_Default_Component_Value | Aspect_Default_Value and then Is_Private_Type (T) then - Preanalyze_And_Resolve (End_Decl_Expr, Full_View (T)); + Preanalyze_Spec_Expression (End_Decl_Expr, Full_View (T)); -- The following aspect expressions may contain references to -- components and discriminants of the type. @@ -10916,14 +10922,14 @@ package body Sem_Ch13 is | Aspect_Static_Predicate then Push_Type (Ent); - Preanalyze_And_Resolve (End_Decl_Expr, T); + Preanalyze_Spec_Expression (End_Decl_Expr, T); Pop_Type (Ent); elsif A_Id = Aspect_Predicate_Failure then - Preanalyze_And_Resolve (End_Decl_Expr, Standard_String); + Preanalyze_Spec_Expression (End_Decl_Expr, Standard_String); elsif Present (End_Decl_Expr) then - Preanalyze_And_Resolve (End_Decl_Expr, T); + Preanalyze_Spec_Expression (End_Decl_Expr, T); end if; Err := @@ -11346,8 +11352,14 @@ package body Sem_Ch13 is -- Do the preanalyze call + -- The expression must be analyzed in the special manner described in + -- "Handling of Default and Per-Object Expressions" in sem.ads, since + -- at the freezing point of the entity associated with an aspect + -- specification, any static expressions expressions or names within + -- the aspect_specification cause freezing (RM 13.14(7.2/5)). + if Present (Expression (ASN)) then - Preanalyze_And_Resolve (Expression (ASN), T); + Preanalyze_Spec_Expression (Expression (ASN), T); end if; end Check_Aspect_At_Freeze_Point; From patchwork Mon Jan 13 10:53:47 2025 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: 104681 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8AF23385800F for ; Mon, 13 Jan 2025 11:14:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AF23385800F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=fLNqhsVP 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 375323858D21 for ; Mon, 13 Jan 2025 10:54:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 375323858D21 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 375323858D21 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=1736765655; cv=none; b=aI8SWB4GOrBWD9Fkuakmkr/Y9IshEL/FhIc6/uOBOG8xjIPh1bz0LUL9RWFJY/ZeWGP0eMgPI2RV7lZl8H/UTrRirRSYK7GDAj8HIfRznD1xoCIsg2Q7/D2zME7x7Mqonf2tU2yAGrpsCG5ApoEdFeBeivKqCg65rpOgf8txNOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736765655; c=relaxed/simple; bh=DfDc6n+YFDO9R/bmd1zYZ1PaqUB36OCFAW+bFDue6yE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rvger6+1MJ6IWtXkIm1/Jy0In34BPG+sWuWQQwMwCtU+HuejmdvXkHBBVEu/SNgvdH2XRiEE06337cA/YSGYK8hifF44ysaOq+Vx4zP3X5ZVFUVVM5zWPWHtfHJrfjbUcwuADle4QQUB0fCBLlW59b1pVfpVlI+StQflsFsqlg0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 375323858D21 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38633b5dbcfso4167012f8f.2 for ; Mon, 13 Jan 2025 02:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736765654; x=1737370454; 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=uzYNLfH1C4vyBN98bk+p3ZdMv7VrkfjbF4cuMMV3vNU=; b=fLNqhsVPTuoTHrJhT/Pm3nXZQtfs5z6H8pF8tPH1iYKkPilMRz+7q1yCubjVeQZ/LK K8rX3bvIypJZp03LlX2NBjpfzFsr9MqANKv0xmE8qiqklLP8Own6FwlhewOloiVz7pLa /AnzLteIWw5M9df5Dnvw7Rvx9j4E3Wamk1M9FGO+Ob1ehFGwvBvAr8KPRhyGqpmB9Zie MGhB0uRhn4/QjS5Guu1N1Tg/G9z444Qq445LIc4X5MoMVqVGXcY+KbJgqm3vp/P28m5o zwSFFLgeOv5hJrQHOC1sWXPbMSu3CTSFA0z9WTu+yT1WXbBbzg0OtApA9O4j03xpIeZG lzPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736765654; x=1737370454; 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=uzYNLfH1C4vyBN98bk+p3ZdMv7VrkfjbF4cuMMV3vNU=; b=Akdn0LUTLzmvLK5GTn2yRnb6aAa23aH07eOJHoHev05fb0wyOAgpavf1PKr9XVJfcc aCio/ca2LNnVokQuyqMIIjUIcZavPWGAa3MMBhYq4EZC174jQ3g4zULgfZskkJTsfnQQ VBtN+odnMZB1GXk4ULd580rtXjdZXvvkDwHXjlqN9lqSnP0F4fyBGWrukeHRBuxIuoXY nAOOL7R2WpusU7HBzA1/k0GM73ovU5VWpOi2FVUHEOsLD6fWh6Xj4497ScdYWRnmXTjK 6mmpTeveGjXzTYaQN7OI1mHorTj3adl0PbbGUCaYSx/Unv8fqtCLZD7ZZCivLWR3ToaR nIVg== X-Gm-Message-State: AOJu0YxTu79G5/Puux1dexfd17q11IEDDR15o4wK+d1IWD+e9vg8D/DJ sF2WgyqquoMWyWQGikSdNsbcWcNkI7Gm4R+YitHFLT8CS2exDiTQFHt4a+0bt6sZbK2j1ApJluk = X-Gm-Gg: ASbGnctj+CoWY+NS17LrMz2Y97lxxXZ/Q9d3quNHCLKFf/Fpjcaj/g+ifLfSbHYwqdx JDG/g/QqOtLLEcU1aUIge3bHy4qziBGv+Yi2MRC18p/jhYX3XG1aD1LgX4chH4RWykl7fH6S5zi Xi2ZSYvIufBZUROTN3lDf4U7t8ZDKYr6BfFh7SicdE8uKUk8Gm6jJpJHZ8lb/hCiMgz/HhPJPFs I3IeZZN9ES63IsnwWYMbEp3+jXxs1FXSveZXPH3bGu5p5qDxOvgedoYXg+SadGV3/vA9BQFB4/y NRexJDBgXmF8ioKSVUbBE0tvdzFgnETIp4dhxoVzoGw8zhSQ+/4Z7ABVj4hDjgCCdsbIkIQW X-Google-Smtp-Source: AGHT+IGhciue0fRtvKpLRontO5dkBe/O43Fzd3cAoEWKlWpIvuY3LVavbHvm4tq6zebeK0fnCneKiA== X-Received: by 2002:a5d:6c6e:0:b0:385:d7f9:f16c with SMTP id ffacd0b85a97d-38a87356cd4mr17682545f8f.46.1736765653848; Mon, 13 Jan 2025 02:54:13 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3834fbsm11709138f8f.26.2025.01.13.02.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 02:54:13 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Pascal Obry Subject: [COMMITTED 14/14] ada: Update gnatdll documentation (-b option removed) Date: Mon, 13 Jan 2025 11:53:47 +0100 Message-ID: <20250113105349.928779-14-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113105349.928779-1-poulhies@adacore.com> References: <20250113105349.928779-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 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~patchwork=sourceware.org@gcc.gnu.org From: Pascal Obry gcc/ada/ChangeLog: * doc/gnat_ugn/platform_specific_information.rst: Update. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../platform_specific_information.rst | 19 ++++++------------- gcc/ada/gnat_ugn.texi | 11 ++--------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/platform_specific_information.rst b/gcc/ada/doc/gnat_ugn/platform_specific_information.rst index aa63bb97e84..f2fc737f90d 100644 --- a/gcc/ada/doc/gnat_ugn/platform_specific_information.rst +++ b/gcc/ada/doc/gnat_ugn/platform_specific_information.rst @@ -167,7 +167,7 @@ Alternatively, you can specify :file:`rts-sjlj/adainclude` in the file .. index:: --RTS switch -You can select another run-time library temporarily +You can select another run-time library temporarily by using the :switch:`--RTS` switch, e.g., :switch:`--RTS=sjlj` @@ -538,17 +538,17 @@ and:: Choosing the Scheduling Policy with Windows ------------------------------------------- -Under Windows, the standard 31 priorities of the Ada model are mapped onto +Under Windows, the standard 31 priorities of the Ada model are mapped onto Window's seven standard priority levels by default: Idle, Lowest, Below Normal, Normal, Above Normal, When using the ``FIFO_Within_Priorities`` task dispatching policy, GNAT -assigns the ``REALTIME_PRIORITY_CLASS`` priority class to the application -and maps the Ada priority range to the sixteen priorities made available under -``REALTIME_PRIORITY_CLASS``. +assigns the ``REALTIME_PRIORITY_CLASS`` priority class to the application +and maps the Ada priority range to the sixteen priorities made available under +``REALTIME_PRIORITY_CLASS``. For details on the values of the different priority mappings, see declarations -in :file:`system.ads`. For more information about Windows priorities, please +in :file:`system.ads`. For more information about Windows priorities, please refer to Microsoft documentation. Windows Socket Timeouts @@ -1548,13 +1548,6 @@ You may specify any of the following switches to ``gnatdll``: relocatable DLL. We advise you to build relocatable DLL. - .. index:: -b (gnatdll) - -:switch:`-b {address}` - Set the relocatable DLL base address. By default the address is - ``0x11000000``. - - .. index:: -bargs (gnatdll) :switch:`-bargs {opts}` diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 0b62540a2fd..2579b31a7fc 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 , Jan 03, 2025 +GNAT User's Guide for Native Platforms , Jan 13, 2025 AdaCore @@ -24749,13 +24749,6 @@ Build a non-relocatable DLL at @code{address}. If you don’t specify default, when this switch is missing, @code{gnatdll} builds a relocatable DLL. We advise you to build relocatable DLL. -@geindex -b (gnatdll) - -@item @code{-b `address'} - -Set the relocatable DLL base address. By default the address is -@code{0x11000000}. - @geindex -bargs (gnatdll) @item @code{-bargs `opts'} @@ -29839,8 +29832,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{d2}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye