From patchwork Tue Sep 10 07:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1983021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=RGhUGtqY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X2wk149VTz1y1S for ; Tue, 10 Sep 2024 17:46:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2B6B3857022 for ; Tue, 10 Sep 2024 07:45:59 +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 31F1A3858C98 for ; Tue, 10 Sep 2024 07:45:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31F1A3858C98 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 31F1A3858C98 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=1725954336; cv=none; b=gFAl+CHkRkCRHXbnqOt/r6OAX/c+ui1VstyfnR7T+X3PtEB3u67QSQ6nwRSlIRwJEH+XEVV2gKZ7jKpNrZufMM/rv5dwo8R62bWUVSGz1p1gJVt9WTFKKVsARj8uD163oMFDDIk6+d0WBVwlC2s+ontv8/+KW1BKVp45zGBl8/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954336; c=relaxed/simple; bh=Wv/3OeCaFkWGrHlpqpXOtkfAlO6BZzV8c2db422g26Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dc/LxPT/K5sY95Nz8B269Ky8lxC5Qpxi3gjnc6Zv148UPXx1ggqMJDYvboKoTtVAo/gs4G33kGsmgDGfZlarxtpuxwvJAC1Q+AA9xp0Pbp3RjZWIFsQI5MPbvL4CBaToHVUWIERmXAmtmLpsFY7N1L4s3FxOAjfA1Vb3YKX5BoQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42cbaf9bfdbso10978615e9.0 for ; Tue, 10 Sep 2024 00:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725954333; x=1726559133; 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=hdP8EaoH0YwWhH//YBs8AeRbHnkdXYlMJQAJrx+rpTs=; b=RGhUGtqYGqx+QauCmKvxqsuqyNUBdAFk4yH1z8FvIDklgufr0TDhqYmcWohB2Ic/we FuPjVRB0vYtQBjHwageWLx5kGmLeflIoYDYf8BTh1grTQZFBBM0cnOqxzYtyb9mxxVl2 84U1rrKMJ5B1vrI70yW7m1EHj0ImnChUJmQ+mf9K+e4PVBMr/+QsCjiHEIXTWeR0b65L GsqcP1KJTvX/87WvoxG/0p+LIciNtyOYc4iOu2ivF8HK1PHcB+naI77mIO7edK0wSvOk i5lQcgHjVQPO3HPsgDNtUDmst082K56mpMFBbbfbqx/ILSbHR5KEb0KT8ok9Xg2l1YTj gsUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725954333; x=1726559133; 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=hdP8EaoH0YwWhH//YBs8AeRbHnkdXYlMJQAJrx+rpTs=; b=QBKLJmcQFiQ+GTL0PI2Fgt6dcT1G3wK59jmojFTbfIAmaCUGDPLEOlezQ7eG6aPKji n7Osp3IDsZUa69lN+gIOXpKeI2H3yN529xQ5yk1l0ThfmLNkaKkYKE0ZH9FDjITuzgoE WzbQPzE7lpFpaUtCLIAc9zwHLBsjCDzN896UMop/prjp2qg97awngO9OFaaeleEkYQSB DlLQQoTqmVbL5phJTVqF8UhuF7eX93qOTuF0P/SFu11910XZVsZwBfjtwLxKCwEzvSDZ MLeCWEy5Kj4SfmzN9PHi74jZj91yIK7K73pBaX/1GlHZC1PkzMX6d6/Vb9BdKiTXhWDS cYQg== X-Gm-Message-State: AOJu0YxryC7vGNW0LdLeu31X06YQ0drYGoGrDbHxEA9zx2w81UPGgun8 nRNvqxvn3Ef3KX9Zfcr1GU0OrVwbSvilSSeCsQGa0BGL00qgHh3U1vpZHuNSAr4oUoam/sjCo34 = X-Google-Smtp-Source: AGHT+IGlQHMHzaYGGGFg1chXxwH80M5zOOE4SH5eCuLdgeVEpPN9q4sH2DpRa01NmVzIwZ+pcaeUqw== X-Received: by 2002:a05:600c:2297:b0:42c:b0a4:6b67 with SMTP id 5b1f17b1804b1-42cb0a46deemr67459545e9.34.1725954332236; Tue, 10 Sep 2024 00:45:32 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956655fcsm8059267f8f.38.2024.09.10.00.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 00:45:31 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 1/7] ada: Whitespace cleanup in declaration of calendar-related routines Date: Tue, 10 Sep 2024 09:45:15 +0200 Message-ID: <20240910074521.448168-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Piotr Trojanek Code cleanup. gcc/ada/ * libgnat/s-os_lib.ads: Remove extra whitespace. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-os_lib.ads | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/libgnat/s-os_lib.ads b/gcc/ada/libgnat/s-os_lib.ads index 46e11f708a2..54e7205c3e6 100644 --- a/gcc/ada/libgnat/s-os_lib.ads +++ b/gcc/ada/libgnat/s-os_lib.ads @@ -130,12 +130,12 @@ package System.OS_Lib is -- Returns current local time in the form YYYY-MM-DD HH:MM:SS. The result -- has bounds 1 .. 19. - function GM_Year (Date : OS_Time) return Year_Type; - function GM_Month (Date : OS_Time) return Month_Type; - function GM_Day (Date : OS_Time) return Day_Type; - function GM_Hour (Date : OS_Time) return Hour_Type; - function GM_Minute (Date : OS_Time) return Minute_Type; - function GM_Second (Date : OS_Time) return Second_Type; + function GM_Year (Date : OS_Time) return Year_Type; + function GM_Month (Date : OS_Time) return Month_Type; + function GM_Day (Date : OS_Time) return Day_Type; + function GM_Hour (Date : OS_Time) return Hour_Type; + function GM_Minute (Date : OS_Time) return Minute_Type; + function GM_Second (Date : OS_Time) return Second_Type; -- Functions to extract information from OS_Time value in GMT form procedure GM_Split From patchwork Tue Sep 10 07:45:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1983024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=hInEekUy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X2wlJ6Chmz1y1S for ; Tue, 10 Sep 2024 17:47:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B31913858C53 for ; Tue, 10 Sep 2024 07:47:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 219603858C41 for ; Tue, 10 Sep 2024 07:45:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 219603858C41 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 219603858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954337; cv=none; b=Iee5jlRbLQ80gknBk7UiJZOjvRJJllcg+u97Yj9uuSAXz74XjSb9zjx6doC9SbEV3s79/AfxKQ/PsbaYckTrf85/ZF9ZSUGoemr7/9XGxjfTkeQKNqExL7O9AbW2TvsxNe69CwAZJlzqcrwJmYnL6NqzarZCOEDpEiYCfMeIYn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954337; c=relaxed/simple; bh=DBV2il9OvQAQ+IVw8prmvmOi8a2r2GPWmcx1DN0rkzA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qe+KVQLZDeQpMdqCRo4Uz/3ks9xZRPlJbvrxV+bK2H3CsDFYiDR0qVUcMo4PY/JFE2fY7IW0vP3ejFXerdM1K78c2pzboRxlkIadp/8KPhBT2bB83EeBCo6eYAOCB6nWxUhe57IImH0ka6WzwPeLQ38fA6kPbrCafTBYvLNiJeQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-428e0d18666so47395995e9.3 for ; Tue, 10 Sep 2024 00:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725954334; x=1726559134; 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=dG/MErCM1nVfkHr/r4RZi1km8NKNLdcJCQA9lcaJIJs=; b=hInEekUyrTDody3u3w3nMqArl2K0sYWjMXktmtzVbGbIXoZHmrdedGPhXGKrC094bl rCykmalkWnM5JJZiwq+Nh71fo4M3wdzafAw5XMrujXa4TjMDQZ4ELjT98UUft2iR0fGe f67Rq3C0h3cgeFWt0ztNdJBBVHSXsbxDrRYyPfGRKveE73kNFvr+A39Q+p3cSnU4nRpL 1RE4ELxx6OVyR+CzIvfPkxOZpGJVYr9lkzJnZ5dcKtyZr7jaNGQ9Wr0dd4kg0BUuhtti t5PdwYd2R9vZlyK1jAy7fBttzW1L8ampSBkLwh5m8T4QEWkbHe9Tq48mwNCMXxYdhOOJ R6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725954334; x=1726559134; 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=dG/MErCM1nVfkHr/r4RZi1km8NKNLdcJCQA9lcaJIJs=; b=HB5O7ZYLq6LNKMAUqzq1SN0AYD+yig0XEyIV9osO2Mf8ikokeReAILuRCIB7iVIaXg pDH6xeKPQDgoWQTjRCL2C/7t0op+mg1AvJbZo9UtjZbzux6sn/MB8nCm/x0/bv8Zv0i3 2VG7U9kn45T89gHvRfXduDXR2nuc2YgEBbN3YXs2CVwdgenX+3SAvxq/uxrRa6wae3xK aqM6p9/+/PVFYbFRnwSocSyjk8ftE8/LW4ayPAtN2XMBrfZEkMi1CD7wzZBVrrqR9jnd PBziomb0rudMteRybWKTjS0oBSDylkyT0/WQ6rKQJ4ttsqwT0I9nzQAY1dKTPuAEke/b qoIA== X-Gm-Message-State: AOJu0Yw1uagUzifopoZW0jnmDa+6FYxsCgQm4IsNm/Q5ZvTYqaIs78SF kovS1BLMV7pyj+MD8EIEg+SYOZXD5coahbBpouATHvbRujhvSoWFoC7cdpm+yXcf/rzxSogoib0 = X-Google-Smtp-Source: AGHT+IH5rBwV8dMjdMJ+ytksWf6P7sXJqmDHL99V1pttaEPf3ZXsEBZIm/bhcfjigTarz/EtevvmtA== X-Received: by 2002:a05:600c:1c2a:b0:42c:bf79:78f7 with SMTP id 5b1f17b1804b1-42cbf797acamr11761855e9.32.1725954333017; Tue, 10 Sep 2024 00:45:33 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956655fcsm8059267f8f.38.2024.09.10.00.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 00:45:32 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 2/7] ada: Simplify code for inserting checks into expressions Date: Tue, 10 Sep 2024 09:45:16 +0200 Message-ID: <20240910074521.448168-2-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910074521.448168-1-poulhies@adacore.com> References: <20240910074521.448168-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * checks.adb (Remove_Checks): Combine CASE alternatives. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/checks.adb | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 5d7f4cca70a..57307c3da1b 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -9712,10 +9712,6 @@ package body Checks is Set_Do_Range_Check (N, False); case Nkind (N) is - when N_And_Then => - Traverse (Left_Opnd (N)); - return Skip; - when N_Attribute_Reference => Set_Do_Overflow_Check (N, False); @@ -9723,35 +9719,29 @@ package body Checks is Set_Do_Overflow_Check (N, False); case Nkind (N) is - when N_Op_Divide => - Set_Do_Division_Check (N, False); - - when N_Op_And => - Set_Do_Length_Check (N, False); - - when N_Op_Mod => - Set_Do_Division_Check (N, False); - - when N_Op_Or => - Set_Do_Length_Check (N, False); - - when N_Op_Rem => + when N_Op_Divide + | N_Op_Mod + | N_Op_Rem + => Set_Do_Division_Check (N, False); - when N_Op_Xor => + when N_Op_And + | N_Op_Or + | N_Op_Xor + => Set_Do_Length_Check (N, False); when others => null; end case; - when N_Or_Else => - Traverse (Left_Opnd (N)); - return Skip; - when N_Selected_Component => Set_Do_Discriminant_Check (N, False); + when N_Short_Circuit => + Traverse (Left_Opnd (N)); + return Skip; + when N_Type_Conversion => Set_Do_Length_Check (N, False); Set_Do_Overflow_Check (N, False); From patchwork Tue Sep 10 07:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1983022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=eVyAlUav; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X2wkK368Hz1y1S for ; Tue, 10 Sep 2024 17:46:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 224F6385DDD4 for ; Tue, 10 Sep 2024 07:46:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 4ED903858C50 for ; Tue, 10 Sep 2024 07:45:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4ED903858C50 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 4ED903858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954337; cv=none; b=IHcaKFPo00w4l16lAtLabhrtI0efyQ13ZbVTsvI5igfb8gOyJUkTLKZq0tUipuWyeJptek7i6vWql4b06x02IuMt5HQzbz0FQrTaV87ykwNcdBaLuqqmQXmN5XNMZZrTCf+UWiIBRya6W2yZGyRaJFkVXT4hTqcvIoXnr7Mi0x4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954337; c=relaxed/simple; bh=iRXRFfsAD6alxTXyk62K9dTEEZ4XtJKV9XAgio+RKko=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rAn5Jvu3ZjxKcLB0xe6jf4FF5a6n2phri8O4q0aDjJMympr3xYYH5U+3ePxIrHn2Bq9fzxr6f0sehH1zfK2ofWEcZQLdnBn9AJI0TVa17wx1hBO48oXxO8O8kt7SSbyY9FMK2FvZXZHhectTSdG1l64KjwuMSPqIUjeFMBvcE1E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42cbaf9bfdbso10978735e9.0 for ; Tue, 10 Sep 2024 00:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725954334; x=1726559134; 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=JNpdVbicCXyhOQdT9rQ+rqn63C2EfAoqKlGWQSDFl5I=; b=eVyAlUavkzbm2P3ZkneBY7fNdXvfY45cBoID6fvJOHDWggwRA30xUSS0359SOZ0Mat mkNK3N728Iki2b4lttEJunqw2ii+ES+CoQ+ee+feWkKhKN7JuvkMb9B8qiXgxCDp5ajk 9aQg1izS7q6jeWZCrNDlNXi7kec8UTFaTsa1mnsiHY7VynOZvhUsumcb0AkQ39j8iReK 579wsSQgUWIiBisqWDLj6yZaZfKZ0pClQmWZWRLKbjJ4lZdWw2K7Ng3Dd1Q6Zg6UuGap dDc4/PbmCqtLYWRUNMM+gykfONOr8tTHPRk3SBg32N4VRsLhImWt0LqBhi6HrgEUYlwd yV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725954334; x=1726559134; 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=JNpdVbicCXyhOQdT9rQ+rqn63C2EfAoqKlGWQSDFl5I=; b=I5mNmXLiss1bAAboAxU/b7FzpAMEBWluO3keNjTSpI056GT3orp1vq7LzscS/eyU0Y eZvLCnVpd3PfSPGHe+BnFCK6bo5Rw6/Xn9PNNqJLYk0oFFJQiGZDsdb3vJgrDlc9vivY X1hxM4P0Vz0vzIo8nXyuuTkmRglv7R4mjlTF1mlDiUAfv23R5WDkInAdSQ5QNdTjN/on tPCPuAGhOVJWbUoiwebjUFHF6E5DT71tk3Nf7yqEG71Oyi8f3oDgSth/nXIgJRyzZAoD 5CRk9ix6/Gb14FYHLj3BdhP09c7tGqxFksFJg1X8tJ8zIPKi68iRKkvi+q+zsGaZB1BG 5T2A== X-Gm-Message-State: AOJu0YyrJoGwZhHFreAfscN5GLjcUOHG+mu548JSs8HuJ40r4HSGvQox TLgF06IVsyhp4l9TGcdbb6tcLPJqbH718ebSG7s/4phi5ZdkMBN1+WXcHGvHYi+7tUNGNSNdR4Y = X-Google-Smtp-Source: AGHT+IGRkuJdKfG+Fj410cdL8JGif1qr5jma/McQ73S1h0lNa6xQje8OAO50NGDhZzQWnqE3JmGezA== X-Received: by 2002:a05:600c:3541:b0:42c:c37b:4d53 with SMTP id 5b1f17b1804b1-42cc37b501fmr3875215e9.0.1725954333818; Tue, 10 Sep 2024 00:45:33 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956655fcsm8059267f8f.38.2024.09.10.00.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 00:45:33 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 3/7] ada: Evaluate calls to GNAT.Source_Info routines in semantic checking Date: Tue, 10 Sep 2024 09:45:17 +0200 Message-ID: <20240910074521.448168-3-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910074521.448168-1-poulhies@adacore.com> References: <20240910074521.448168-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Piotr Trojanek When semantic checking mode is active, i.e. when switch -gnatc is present or when the frontend is operating in the GNATprove mode, we now rewrite calls to GNAT.Source_Info routines in evaluation and not expansion (which is disabled in these modes). This is needed to recognize constants initialized with calls to GNAT.Source_Info as static constants, regardless of expansion being enabled. gcc/ada/ * exp_intr.ads, exp_intr.adb (Expand_Source_Info): Move declaration to package spec. * sem_eval.adb (Eval_Intrinsic_Call): Evaluate calls to GNAT.Source_Info where possible. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_intr.adb | 6 ------ gcc/ada/exp_intr.ads | 5 +++++ gcc/ada/sem_eval.adb | 37 ++++++++++++++++++++++++++++++++++--- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index a076eb0eeb6..0db0a66ab1c 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -109,12 +109,6 @@ package body Exp_Intr is -- Expand a call to corresponding function, declared in an instance of -- System.Address_To_Access_Conversions. - procedure Expand_Source_Info (N : Node_Id; Nam : Name_Id); - -- Rewrite the node as the appropriate string literal or positive - -- constant. Nam is the name of one of the intrinsics declared in - -- GNAT.Source_Info; see g-souinf.ads for documentation of these - -- intrinsics. - --------------------- -- Add_Source_Info -- --------------------- diff --git a/gcc/ada/exp_intr.ads b/gcc/ada/exp_intr.ads index 699d1c8164f..75f24bf5495 100644 --- a/gcc/ada/exp_intr.ads +++ b/gcc/ada/exp_intr.ads @@ -39,6 +39,11 @@ package Exp_Intr is -- documentation of these intrinsics. Loc is passed to provide location -- information where it is needed. + procedure Expand_Source_Info (N : Node_Id; Nam : Name_Id); + -- Rewrite the node as the appropriate string literal or positive constant. + -- Nam is the name of one of the intrinsics declared in GNAT.Source_Info; + -- see g-souinf.ads for documentation of these intrinsics. + procedure Expand_Intrinsic_Call (N : Node_Id; E : Entity_Id); -- N is either a function call node, a procedure call statement node, or -- an operator where the corresponding subprogram is intrinsic (i.e. was diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index aaf0a766dc3..de3f35e9a61 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -33,6 +33,7 @@ with Einfo.Utils; use Einfo.Utils; with Elists; use Elists; with Errout; use Errout; with Eval_Fat; use Eval_Fat; +with Exp_Intr; use Exp_Intr; with Exp_Util; use Exp_Util; with Freeze; use Freeze; with Lib; use Lib; @@ -191,7 +192,7 @@ package body Sem_Eval is -- (it is an error to make the call if these conditions are not met). procedure Eval_Intrinsic_Call (N : Node_Id; E : Entity_Id); - -- Evaluate a call N to an intrinsic subprogram E. + -- Evaluate a call N to an intrinsic subprogram E function Find_Universal_Operator_Type (N : Node_Id) return Entity_Id; -- Check whether an arithmetic operation with universal operands which is a @@ -2888,13 +2889,43 @@ package body Sem_Eval is end if; case Nam is - when Name_Shift_Left => + + -- Compilation date and time are the same for the entire compilation + -- unit, so we can replace them with static strings. + + when Name_Compilation_ISO_Date + | Name_Compilation_Date + | Name_Compilation_Time + => + Expand_Source_Info (N, Nam); + + -- Calls to other intrinsics from the GNAT.Source_Info package give + -- different results, depending on where they occur. In particular, + -- for generics their results depend on where those generics are + -- instantiated; same for default values of subprogram parameters. + -- Those calls will behave as nonstatic, and we postpone their + -- rewriting until expansion. + + when Name_Enclosing_Entity + | Name_File + | Name_Line + | Name_Source_Location + => + if Inside_A_Generic + or else In_Spec_Expression + then + null; + else + Expand_Source_Info (N, Nam); + end if; + + when Name_Shift_Left => Eval_Shift (N, E, N_Op_Shift_Left); when Name_Shift_Right => Eval_Shift (N, E, N_Op_Shift_Right); when Name_Shift_Right_Arithmetic => Eval_Shift (N, E, N_Op_Shift_Right_Arithmetic); - when others => + when others => null; end case; end Eval_Intrinsic_Call; From patchwork Tue Sep 10 07:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1983025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=KhveTmyi; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X2wlt5qL0z1y1S for ; Tue, 10 Sep 2024 17:47:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A74F83858C50 for ; Tue, 10 Sep 2024 07:47:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 4BA3D3858424 for ; Tue, 10 Sep 2024 07:45:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4BA3D3858424 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 4BA3D3858424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::430 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954342; cv=none; b=aKEiUcK0dpM8cz6vv64DqEoO57ux3OItgG4XKX3zUi1awoITeFgIMErJW4e7R5ontviy5OxebxUyT4MyaujKXkDp62ntc4/RSUz5du09eJM1wSUHdkCDJ+ocaGsUv2+gdu2wrcdAhWPUbaVn3pYZcXHGG7f6L/bCryj+7XI4A/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954342; c=relaxed/simple; bh=He5ZHzgKGdYp45bgg0/2o7BkmyIpLS9QmWZAGMaNrwc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HxTobSB5ocq3KajToWAvd53/+L/c5VeNgOQHjc+lCCW82jwYxF+uKEE40Snm7GpEZrSsbm9yLKbq+51anU8ChLMxCTs71nAwwA8yHCnc2pS4KehKBcLP02vGBjX4nLLIV3EEnNmvo/jw8BMWSgjFiRKGXvd2ZqKhGm/4IrDa7nc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-374cacf18b1so2997598f8f.2 for ; Tue, 10 Sep 2024 00:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725954335; x=1726559135; 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=oiMCu0cRUX42R/zwpw2lB0aRUwgv4/P7lxfHEMlyzaE=; b=KhveTmyiegblfqX/1Cg7E6uj3xK9a5YxExLmeS5/X9H88EwujqTChcJY/+gQF4K4P4 jiwgXRCboqaKxA3wbCoHDuIeHio0m05QNn4bRckb4EmYfCxLgeDk8MUseTBDR/GXzKJ+ GzIWjWv+NMYt6a4AWs8ezDa3JeezrMugIQ/ishV3e+J1qCawWjnmhiW7KY5YVao7yR1X zJfi5ZYHZDcVOIBSRMfB8tcSdjpZvi8WFjy0K1yizPk/tLRrP76mOP36KHhRoUKr2cG5 wDCu+IXQ1E6zy2jVX2/HP0yAsAE1/ajsKKxgP4KHr48hVZBFMvRdsWOGpGDR9tH93hb3 2rFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725954335; x=1726559135; 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=oiMCu0cRUX42R/zwpw2lB0aRUwgv4/P7lxfHEMlyzaE=; b=i8c1ViDVSqRwijUYtVVoPpMSnppbC29f6j1mD385IgXKHRU0VvX9ubTiK7ywVXzMF8 q6uf1nNp2fQW9M/ABDcqhOw51ZjHd1ZJYlTGpJBwpLDUzJUwAaIbfa2K4Ai6ni0hP/dg nd0ZEp7CE9eEUfJ60kiF+7azXCeCXIYmgA1JpDCobws56r+tsZiVtAmG62aD3FA8ePcU 86kxJs+Yxe0C5u9ggmxENofwWVA3oHLYxWDAi2htDkxMip7ytsCrZVHiuxTLb9Mt+24W Sew7LGA+bOBw0zdWupbouzuX5t9OSgzOvOkVCfLEIzNRbCSsYu3XX+33tmSOoKyJyhFy 1BaQ== X-Gm-Message-State: AOJu0Yx4/dgAPOtJi+i03rVZp9pglkIw2sgM7wk6fP+bh60mu74OMVEY Jesun3gR6D4D6NeSHztcVbHVHQ/BX9V7LU7zxufQkxHUVWUa9AWdBZIUe7uqnQ29p/ecE5bcyr4 = X-Google-Smtp-Source: AGHT+IHBeCKWA6vreBp8i+3qtEzGZ6yzB6aFU2+3JGrJKNHyorrEgekpYS4Q/dRdoYbtMnw7PydD7A== X-Received: by 2002:a5d:5746:0:b0:374:c782:8d5d with SMTP id ffacd0b85a97d-37892685713mr5113639f8f.10.1725954334734; Tue, 10 Sep 2024 00:45:34 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956655fcsm8059267f8f.38.2024.09.10.00.45.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 00:45:34 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 4/7] ada: Normalize span generation on different platforms Date: Tue, 10 Sep 2024 09:45:18 +0200 Message-ID: <20240910074521.448168-4-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910074521.448168-1-poulhies@adacore.com> References: <20240910074521.448168-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Viljar Indus The total number of characters on a source code line is different on Windows and Linux based systems (CRLF vs LF endings). Use the last non line change character to adjust printing the spans that go over the end of line. gcc/ada/ * diagnostics-pretty_emitter.adb (Get_Last_Line_Char): New. Get the last non line change character. Write_Span_Labels use the adjusted line end pointer to calculate the length of the span. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/diagnostics-pretty_emitter.adb | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/gcc/ada/diagnostics-pretty_emitter.adb b/gcc/ada/diagnostics-pretty_emitter.adb index 927e50578e9..389be8a6533 100644 --- a/gcc/ada/diagnostics-pretty_emitter.adb +++ b/gcc/ada/diagnostics-pretty_emitter.adb @@ -165,7 +165,7 @@ package body Diagnostics.Pretty_Emitter is function Get_Line_End (Buf : Source_Buffer_Ptr; Loc : Source_Ptr) return Source_Ptr; - -- Get the source location for the end of the line in Buf for Loc. If + -- Get the source location for the end of the line (LF) in Buf for Loc. If -- Loc is past the end of Buf already, return Buf'Last. function Get_Line_Start @@ -177,6 +177,10 @@ package body Diagnostics.Pretty_Emitter is (Buf : Source_Buffer_Ptr; Loc : Source_Ptr) return Source_Ptr; -- Get first non-space character in the line containing Loc + function Get_Last_Line_Char + (Buf : Source_Buffer_Ptr; Loc : Source_Ptr) return Source_Ptr; + -- Get last non line end [LF, CR] character in the line containing Loc + function Image (X : Positive; Width : Positive) return String; -- Output number X over Width characters, with whitespace padding. -- Only output the low-order Width digits of X, if X is larger than @@ -314,6 +318,25 @@ package body Diagnostics.Pretty_Emitter is return Cur_Loc; end Get_First_Line_Char; + ------------------------ + -- Get_Last_Line_Char -- + ------------------------ + + function Get_Last_Line_Char + (Buf : Source_Buffer_Ptr; Loc : Source_Ptr) return Source_Ptr + is + Cur_Loc : Source_Ptr := Get_Line_End (Buf, Loc); + begin + + while Cur_Loc > Buf'First + and then Buf (Cur_Loc) in ASCII.LF | ASCII.CR + loop + Cur_Loc := Cur_Loc - 1; + end loop; + + return Cur_Loc; + end Get_Last_Line_Char; + ----------- -- Image -- ----------- @@ -720,8 +743,9 @@ package body Diagnostics.Pretty_Emitter is Source_Text (Get_Source_File_Index (L.First)); Col_L_Fst : constant Natural := Natural - (Get_Column_Number (Get_First_Line_Char (Buf, L.First))); - Col_L_Lst : constant Natural := Natural (Get_Column_Number (L.Last)); + (Get_Column_Number (Get_First_Line_Char (Buf, L.First))); + Col_L_Lst : constant Natural := Natural + (Get_Column_Number (Get_Last_Line_Char (Buf, L.Last))); -- Carret positions Ptr : constant Source_Ptr := Loc.Span.Ptr; From patchwork Tue Sep 10 07:45:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1983026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=U+mtUI2H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X2wml4WNmz1y1S for ; Tue, 10 Sep 2024 17:48:23 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 695C4385B50D for ; Tue, 10 Sep 2024 07:48:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id F2F3F385841E for ; Tue, 10 Sep 2024 07:45:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F2F3F385841E 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 F2F3F385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954342; cv=none; b=tcTMTpNUXeiR/82KnkfDLWj2mEtAeEYsxy5sXcpnvT/mMFOFNsdH6tyTAaCcIPHN7JgHImsn4NBpwf+y794RbcDYLKhDiLl+DqMfYOLA025+KPeFGBRWTYwU8grvwrYY/OGz26RtDnrbxV7Qim0fM7E+WwTdIdRIMybBMz3SqDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954342; c=relaxed/simple; bh=JJg7/mJOk0xSN75l9kn3S+Qzh/YaebUKOEmWtF+0HM8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rCwET3455PtEoAJnp6RsiH+JZ/h8J4xjwUudw/8pQHmssXbTrqQO63dp7RaO7XqcvWjSuv1wVEDHwaCNER2jJeYFHSQvay99YKlqk7dy6grBks/Cb24Vq9RPdxK8S7kG1VY/rcOvhu2ZqchvRK4c45l+jLVABnpwJzXUGymWHfg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42ca573fd5aso34351265e9.3 for ; Tue, 10 Sep 2024 00:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725954335; x=1726559135; 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=lwlbctuMzt3wXw8kOmiELh00zpus1OPAk2xsjco3T7g=; b=U+mtUI2HXtsbDMXYXxo0kiH6QN6JZ9zlAjTQKUl5+r3W7sNXd3WUqeZpfbsjUjiBfc jtJYtyPnfYToK9ngh8zog4vnV8uCJ3hErjxiMPjMbCCOjgb/CyN8YUo3jGOGkh+cXuM/ DFdlDZPyAxVd8kPyDfGA1uJumZjCK/F+DrGazbhiDJt6GT6IkdVLCistmXu+HETikBub 3UCwB3hCSvCGwXiYM0NMj3IHr8AOa5LRlf920ARghEpQ92o7Y4y2/Z3Ne7qVj7UT2tbb 68JXGze6RWy61jpblMd3QNETLIYnyIGqkQEZcs8yulA6poCXRlHmDLO8UsotsYTN/ICl KWNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725954335; x=1726559135; 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=lwlbctuMzt3wXw8kOmiELh00zpus1OPAk2xsjco3T7g=; b=vqtxn1IjVFmt1gBS1ArcdKGZXH3j3BSmYSJsqdQvFCT7I5S2KIq4U+50rrtoTKxbmA VVBvTtN1MMMnzgTuV50YMYQlPo7YKPUSWCvN1flW1i8M/j8v/HbKRRmFVFg18Pav1Glf zNO9aFvLORhyRZW1xccAgfz6yt84Ja2C9N+rmRv0g99e+Bf/ZWzv6DibO3WgBw19KMwF /g9jh1Y4EnUEKII750Uqn+kOE9H18QVwgxxi/LnDSSwkHw/lm2HduDJ0FG7lO12kkmMO +gL8mni0J4ljb7AQ7c9kgrlBPeOmQEqlHEZucf6ViANsQfsf56MXBhGohod+KeXav+iZ Y3vQ== X-Gm-Message-State: AOJu0YzlAitMllCEE1Z0Z7BDMBLvGlYUdDjKYFvQNfoPXzPiW6t43QrD bxKaPMypmA7iSqiJEgf2HT/+8fpljXEsT0cf3YHV4JSY2OKBLrqi+SyznWicXtPsGA8938rnKCI = X-Google-Smtp-Source: AGHT+IE+p1/k/jfxuLNLt6H9G+FBqNGddx7inB3CfZVJgq78b/6UA4FnmYf/1+rQ/U2wX/ntFI2t3A== X-Received: by 2002:a05:600c:4446:b0:42c:ac9f:b505 with SMTP id 5b1f17b1804b1-42cac9fb8fbmr71211715e9.31.1725954335490; Tue, 10 Sep 2024 00:45:35 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956655fcsm8059267f8f.38.2024.09.10.00.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 00:45:35 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Javier Miranda Subject: [COMMITTED 5/7] ada: First controlling parameter: report error without Extensions allowed Date: Tue, 10 Sep 2024 09:45:19 +0200 Message-ID: <20240910074521.448168-5-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910074521.448168-1-poulhies@adacore.com> References: <20240910074521.448168-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Javier Miranda Enable reporting an error when this new aspect/pragma is set to True, and the sources are compiled without language extensions allowed. gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Call Error_Msg_GNAT_Extension() to report an error when the aspect First_Controlling_Parameter is set to True and the sources are compiled without Core_Extensions_ Allowed. * sem_prag.adb (Pragma_First_Controlling_Parameter): Call subprogram Error_Msg_GNAT_Extension() to report an error when the aspect First_Controlling_Parameter is set to True and the sources are compiled without Core_Extensions_Allowed. Report an error when the aspect pragma does not confirm an inherited True value. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 28 ++++++++++++++--------- gcc/ada/sem_prag.adb | 53 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 61 insertions(+), 20 deletions(-) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index ab8cc1012c3..0770bafd231 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -4530,6 +4530,9 @@ package body Sem_Ch13 is if (No (Expr) or else Entity (Expr) = Standard_True) and then not Core_Extensions_Allowed then + Error_Msg_GNAT_Extension + ("'First_'Controlling_'Parameter", Sloc (Aspect), + Is_Core_Extension => True); goto Continue; end if; @@ -4545,19 +4548,24 @@ package body Sem_Ch13 is goto Continue; end if; - -- If the aspect is specified for a derived type, the - -- specified value shall be confirming. - if Present (Expr) - and then Is_Derived_Type (E) - and then - Has_First_Controlling_Parameter_Aspect (Etype (E)) and then Entity (Expr) = Standard_False then - Error_Msg_Name_1 := Nam; - Error_Msg_N - ("specification of inherited aspect% can only " - & "confirm parent value", Id); + -- If the aspect is specified for a derived type, + -- the specified value shall be confirming. + + if Is_Derived_Type (E) + and then Has_First_Controlling_Parameter_Aspect + (Etype (E)) + then + Error_Msg_Name_1 := Nam; + Error_Msg_N + ("specification of inherited True value for " + & "aspect% can only confirm parent value", + Id); + end if; + + goto Continue; end if; -- Given that the aspect has been explicitly given, diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index b139bd4cf4e..2d31c71f366 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -17761,22 +17761,55 @@ package body Sem_Prag is ---------------------------------------- when Pragma_First_Controlling_Parameter => First_Ctrl_Param : declare - Arg : Node_Id; - E : Entity_Id := Empty; + Arg : Node_Id; + E : Entity_Id := Empty; + Expr : Node_Id := Empty; begin - if not Core_Extensions_Allowed then - return; - end if; - GNAT_Pragma; - Check_Arg_Count (1); + Check_At_Least_N_Arguments (1); + Check_At_Most_N_Arguments (2); Arg := Get_Pragma_Arg (Arg1); + Check_Arg_Is_Identifier (Arg); - if Nkind (Arg) = N_Identifier then - Analyze (Arg); - E := Entity (Arg); + Analyze (Arg); + E := Entity (Arg); + + if Present (Arg2) then + Check_Arg_Is_OK_Static_Expression (Arg2, Standard_Boolean); + Expr := Get_Pragma_Arg (Arg2); + Analyze_And_Resolve (Expr, Standard_Boolean); + end if; + + if not Core_Extensions_Allowed then + if No (Expr) + or else + (Present (Expr) + and then Is_Entity_Name (Expr) + and then Entity (Expr) = Standard_True) + then + Error_Msg_GNAT_Extension + ("'First_'Controlling_'Parameter", Sloc (N), + Is_Core_Extension => True); + end if; + + return; + + elsif Present (Expr) + and then Is_Entity_Name (Expr) + and then Entity (Expr) = Standard_False + then + if Is_Derived_Type (E) + and then Has_First_Controlling_Parameter_Aspect (Etype (E)) + then + Error_Msg_Name_1 := Name_First_Controlling_Parameter; + Error_Msg_N + ("specification of inherited True value for aspect% can " + & "only confirm parent value", Pragma_Identifier (N)); + end if; + + return; end if; if No (E) From patchwork Tue Sep 10 07:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1983027 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=DyWUcSeo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X2wn64Wd6z1y1S for ; Tue, 10 Sep 2024 17:48:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 797B53858C50 for ; Tue, 10 Sep 2024 07:48:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id BE5C3385840B for ; Tue, 10 Sep 2024 07:45:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE5C3385840B 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 BE5C3385840B 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=1725954342; cv=none; b=ouOSnmYi0AHOEJBxv8Ko07IFVdqOB/1hxxfxdXpfmXfNOVWscZEye2BNqBnKVCfcI+EFbotQbv/+4zyotgVW2UNvSNROnpbsgfuqmS2TNdmd+pyzZ7WVWro+mwgsg/VRW/Jbji+vzpg3J7AZn6//L/MHMPZ2O2aRdmpMLm9pFfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954342; c=relaxed/simple; bh=x3rFY3caBBbXCrlKQTlYGvLVsijaAG0RuG8CdWQBfFo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LbIdmo8PyAWWp6c6e4SJYrjWNC4JWYLknQrhIT2l08wqMg5bno5nOdFNO3TDgnyhXaDBKvRV3mLfr7L/TJeWBm46MeTVhL0sTaM77zgbedOUM6ABrrTlPJovyub9Ftn7XZxTjwEEsSVvyHfe5YQhLkrAF6Z4NXpBG7kYYCnbodA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-374ba74e9b6so4002515f8f.0 for ; Tue, 10 Sep 2024 00:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725954336; x=1726559136; 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=gSCVI1U8L1YDAB8SWY53VkVmwLuurygj0Kr57TUK2Yc=; b=DyWUcSeoldC3my1eGiKQIxZLyC2VtHsZDLMx2rHECA8SvtrbWHjx57BQdDCvQo5QZv /OkLFQPU2Xu4qxJm2Ls0QQUg1yfb3kcOnr331XZz+XgzpVOY7YvDN4BbnaGpvGKAD1KS caHUOc5vu5VUwfmDszRfvMDgtDxMmtINT1isqnWEZLpU2W+xB9t9B9yEFS0vCRuOzgu5 AN0ZmTGGscwqzjmNXw+M881Asx0B/BWgmrSpLGw19jG/+T533v6jDacc+vnz7OyahgLH fUeywfbz0Guic4HtDYcdT8/ECB8TbypF6ba7E7u/LexHDyjFembfhZb3kpwNUMz4kkLs ARBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725954336; x=1726559136; 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=gSCVI1U8L1YDAB8SWY53VkVmwLuurygj0Kr57TUK2Yc=; b=rIdvTqFfvov/LzBXpXq8/R3wYsnHulh6RefiM/UcgvqJIbdsT/5ioDiW6mambKFG82 WQlLpPn8o8wgNEusRGQSsmw5teFC29C9XAdAm+1mfY3Z4cdlIvIry/hjcn77/fF1bq5U 3ZRlgfaVP1lWjwxWz0YtBAZlgN6xS24LrbklZ6HylMjKwEv7KGPh+cYkZVK+ZYSAUpcR 6mFdDfsPYhSYogQt1SjqcfyIQFgsFuqYc/SJMNXeR2OXa+seiYnbj+ZwjDI7KZg9+F2o W380R6mK9R7XeblCfHnEQtdiDMfyagmlAp0nzguwqklQCSCSZ0Uuh2TIreBk1o1q0JTn wdBA== X-Gm-Message-State: AOJu0Yzn6QzjQaoz/nVwGYxExuUZBe1ZeT+3a54124hcUY0IFcamliZ+ uM7j7wnWLBM3wbifLdIRDDRZkgM9p7QSj3BiFA4IZo+oDxETNyTnvpVbqc8sNPUWwg/7DMA0B9M = X-Google-Smtp-Source: AGHT+IF9RrwrKhZdaia7pYOUau+K45d3uAmrSlTbOUVBaHcEALXq5RPyV1SOeM3JuLFw4iBq2PgRXw== X-Received: by 2002:adf:fcca:0:b0:374:c90e:990c with SMTP id ffacd0b85a97d-378922b7aefmr8232055f8f.33.1725954336358; Tue, 10 Sep 2024 00:45:36 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956655fcsm8059267f8f.38.2024.09.10.00.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 00:45:35 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 6/7] ada: Use the same warning character in continuations Date: Tue, 10 Sep 2024 09:45:20 +0200 Message-ID: <20240910074521.448168-6-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910074521.448168-1-poulhies@adacore.com> References: <20240910074521.448168-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Viljar Indus gcc/ada/ * gcc-interface/decl.cc: Use same warning characters in continuation messages. * gcc-interface/trans.cc: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 8 ++++---- gcc/ada/gcc-interface/trans.cc | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 655ba0b8a10..4252e627b0c 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -1430,7 +1430,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) post_error ("??too large object cannot be allocated statically", gnat_entity); - post_error ("\\?dynamic allocation will be used instead", + post_error ("\\??dynamic allocation will be used instead", gnat_entity); } @@ -6565,7 +6565,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition, ("??cannot import type-generic 'G'C'C builtin!", gnat_subprog); post_error - ("\\?use a supported result type", + ("\\??use a supported result type", gnat_subprog); gnu_builtin_decl = NULL_TREE; } @@ -6587,7 +6587,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition, ("??cannot import type-generic 'G'C'C builtin!", gnat_subprog); post_error - ("\\?use a supported second parameter type", + ("\\??use a supported second parameter type", gnat_subprog); gnu_builtin_decl = NULL_TREE; } @@ -6608,7 +6608,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition, ("??cannot import type-generic 'G'C'C builtin!", gnat_subprog); post_error - ("\\?use a supported third parameter type", + ("\\??use a supported third parameter type", gnat_subprog); gnu_builtin_decl = NULL_TREE; } diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 92e000686fb..710907bb999 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -4949,10 +4949,10 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target, ("unchecked conversion implemented by copy??", gnat_actual); post_error - ("\\?use pragma Universal_Aliasing on either type", + ("\\??use pragma Universal_Aliasing on either type", gnat_actual); post_error - ("\\?to enable RM 13.9(12) implementation permission", + ("\\??to enable RM 13.9(12) implementation permission", gnat_actual); } @@ -4962,10 +4962,10 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target, ("value conversion implemented by copy??", gnat_actual); post_error - ("\\?use pair of types with same root type", + ("\\??use pair of types with same root type", gnat_actual); post_error - ("\\?to avoid new object in RM 4.6(58.5/5)", + ("\\??to avoid new object in RM 4.6(58.5/5)", gnat_actual); } } @@ -10644,9 +10644,9 @@ validate_unchecked_conversion (Node_Id gnat_node) { post_error_ne ("??possible aliasing problem for type&", gnat_node, Target_Type (gnat_node)); - post_error ("\\?use -fno-strict-aliasing switch for references", + post_error ("\\??use -fno-strict-aliasing switch for references", gnat_node); - post_error_ne ("\\?or use `pragma No_Strict_Aliasing (&);`", + post_error_ne ("\\??or use `pragma No_Strict_Aliasing (&);`", gnat_node, Target_Type (gnat_node)); } } @@ -10670,7 +10670,7 @@ validate_unchecked_conversion (Node_Id gnat_node) { post_error_ne ("??possible aliasing problem for type&", gnat_node, Target_Type (gnat_node)); - post_error ("\\?use -fno-strict-aliasing switch for references", + post_error ("\\??use -fno-strict-aliasing switch for references", gnat_node); } } From patchwork Tue Sep 10 07:45:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1983023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=YwjflGtc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X2wkg0mvgz1y1S for ; Tue, 10 Sep 2024 17:46:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF7A43858424 for ; Tue, 10 Sep 2024 07:46:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id B36663858C53 for ; Tue, 10 Sep 2024 07:45:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B36663858C53 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 B36663858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954342; cv=none; b=FWnugLizg2EkDB0xH9vt1KgLJHrYfqkJs9urEh4owzqKMRP1uKbH/8GulsYMkRsdjqHyukkAU6zKIhxR5zEB1HclFZDHzH44fg8YQxM9zdvzzsSF7AnIbMsJD75E41Nvd4OASMFPdIw9eocQAZpkGk1AqBsr4RQUqQ5Y8biFCGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725954342; c=relaxed/simple; bh=kkz9snGusAHIUpGQnZ1ryyHbAJGgUiU6M09es1EiNeQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Kh9sVCCfr4Vn92APaSFFWNcqZo6/eefMqFG08acq0SGQizsjU8Gjt+dK1CJfvQLjQ0w8hlzEmJ2LeswSzJjMyQeoRhqobPOOsi5wIVjqkYXoAJlBAdG67/Au7M7mhsw+yM5fxygIxcyXxQQinOf8w/ZfIPQcC4nag2k/wxq0RPU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42cba6cdf32so12019875e9.1 for ; Tue, 10 Sep 2024 00:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725954337; x=1726559137; 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=Z1bBLEJQRv6XQNO5RJvJalMuAghJ5XAj4sbcmKJgdoc=; b=YwjflGtcgMaAEP0dNjfHiMF6QxiIANLChbrkuL8dYDDxLVm1pLDUd/959HR6bjVoSm RJoJO+zloktsAdZOtDSLpxtgMFX1Ru4qBDeTszAYcGs8UYfwckpxXrHWWovc8pmp2ybw q/XtATb8fPHpC5dIWM1ySmVUlqe7GTGWQ44ovADbb2Px1btNxgU6xnJIdP6EXtDDImNH 2xn/9nBd5H8ni0sLGM3M7ib+BQ5wJZNLFZbjMJ+QY7qK4r4/Jb18r7/s23ZJOBYfZSpx XHtZDtKTUJaZSTCymRMEvaseifSGrFezQfOoG7w0Nv3zUnRsC3bIO9HUdHYUwbTTV2yI 4Elw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725954337; x=1726559137; 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=Z1bBLEJQRv6XQNO5RJvJalMuAghJ5XAj4sbcmKJgdoc=; b=V411aFy53kk5uM4x+OaiHwd5JWfXeD6fzjvLRvqPfXZ0yoQ1YcZyXb9cSOgsjXpF/a /jF1N6IJbEadK6AymtoNH6WL8dunyyEoxVLJYRmX19fkazOxyM3a1kdJdN/jEVXfpZlr P8wibITKHY6u8+Ckj02d/lgld2IME8HVrsOIKj54a1eoLjsNVc9u74AJtdcLkLMM8WXx C6pleNXpwzHDfjqr7M93K3Akn/JIp9f/8OzNxR9GI41kZvXW51Agb8ykkIzeAYVt0h7B s+WfRUPT/CgtFs8VdaCnd1zBUQgiT3DR/RtqAYBfOSSWlCSuYirKbEm1PGuNgQ/BSpPU Og0A== X-Gm-Message-State: AOJu0YzLINgudSHEn5bszy2YxP3nqmjBJUDegl6APiN0/ZojNS5aZZAH EDNEpYpw+q6vGLLuOqPsiFlsyymJTWLS9frAWbnzPbWUycP0rmSVOyYmJHhDkucnJg/kgAqO/9c = X-Google-Smtp-Source: AGHT+IHMq9eUJsL3gDFAB/QWM6Ex2GrX5olbkK7sGNMlPkN8CN1BMsqWkXG3xdcqHEtdAm3kUjQkIg== X-Received: by 2002:a05:600c:4715:b0:428:e866:3933 with SMTP id 5b1f17b1804b1-42c9f9d6629mr95886875e9.22.1725954337329; Tue, 10 Sep 2024 00:45:37 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956655fcsm8059267f8f.38.2024.09.10.00.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 00:45:36 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 7/7] ada: Include missing associated header file Date: Tue, 10 Sep 2024 09:45:21 +0200 Message-ID: <20240910074521.448168-7-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910074521.448168-1-poulhies@adacore.com> References: <20240910074521.448168-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Eric Botcazou memmodel.h must be included alongside tm_p.h for the sake of the SPARC port. gcc/ada/ * gcc-interface/misc.cc: Include memmodel.h before tm_p.h. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/misc.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc index 645937f796c..2aa1bfd410b 100644 --- a/gcc/ada/gcc-interface/misc.cc +++ b/gcc/ada/gcc-interface/misc.cc @@ -28,6 +28,7 @@ #include "coretypes.h" #include "target.h" #include "tree.h" +#include "memmodel.h" #include "tm_p.h" #include "diagnostic.h" #include "opts.h"