From patchwork Tue May 16 08:40:01 2023 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: 94528 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp272915vqo; Tue, 16 May 2023 01:48:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7A6nbZHXy7b8tjqh3Q44CVody2KEFDQUA58ZQ0SWRUfkDBWXQ+zErdJEsN0UE6nuslKWVO X-Received: by 2002:a17:907:a41e:b0:965:e556:8f6d with SMTP id sg30-20020a170907a41e00b00965e5568f6dmr34172640ejc.63.1684226932967; Tue, 16 May 2023 01:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684226932; cv=none; d=google.com; s=arc-20160816; b=hLJKZHbqgrZoFCOOuVzdHISnwijABfd75AOlGIGAiCP6u7M5vDU/Abejl3ufmKQrjK bTAdwVB3k7dMk4jbg/9oODCPjvR2RhpFud10Ef3lIdhDQ1n6E0BjddlRnmGAUJBaY7Hd MUA01YrEslQyB1UjlqgoHsGoB+nBkbrOi2PULaAS93ZNP/PjPmXIjLOtiQSx2qEIBBOW HyokuL8Rl1BxRIuFkt0oH0+61m63ik2JQlfiyCYp9xZf9XPihUDihfLj43zwrDpwDr6W rrLXuTbatMMk7CEmQ1rMZ3X4Z0eu/ZlPICX4BmWU9Afk+pbqXo9210SYe4tBLznItlBj 8ZFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=vWNwsWqeEnOUMNwNzgKeyA/j4XrKtDEIIIMsRVgVMW4=; b=b293Nr12tbQk359T2WKF0yV7x2vIv5W0K9cSYanCy3OnJPlcMBJ7l2ukJ5PsvUmDPi p6pZ9iBzCYY4vYa1NkXRMpgdL6nOPlck48OBET9QwlwSu3+uvupx9rY+qIkoY6+9wwRq mMp2jDBeiqYLXj6PGmeW0/1TJXm8SuZgeVFX+9WC8IO4kNZOumnZIoMljGKqKrf6jmys k4RuLv7JUK7IIXCquOEoWeA7HQzyw9ATjoFUVUwUXE2wquuJW7GgbIU3+aYB16b5Db7j kJlJ+YMqllQq1lVUVXJ/IW0sA94XpYvzhoVnZ8/wD1sRQk1qHD7fjAYL/V8vpaV+p0+J oWIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jljH1usl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id p20-20020a17090653d400b0096605d94b00si12974769ejo.861.2023.05.16.01.48.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 01:48:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jljH1usl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A0E27381159E for ; Tue, 16 May 2023 08:44:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0E27381159E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684226650; bh=vWNwsWqeEnOUMNwNzgKeyA/j4XrKtDEIIIMsRVgVMW4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=jljH1uslMvum9KVaqDAnc5Sm+EXBr0JCVlCSf0sAQ/xPhgaLHdaTApICu9LRMbfjE p236OyFw8pmZgp9WVJFuoinuMjuIAen0BL4hm4l24ZBljxQXaw6FA561wZjSu6jp0q ipFfxdjni8r//QC2hgy0UUD8J1wqWNEMYs+dmDZs= 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 0D7723852746 for ; Tue, 16 May 2023 08:40:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D7723852746 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f42ba32e24so53860675e9.3 for ; Tue, 16 May 2023 01:40:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684226403; x=1686818403; 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=vWNwsWqeEnOUMNwNzgKeyA/j4XrKtDEIIIMsRVgVMW4=; b=BweyTPw6Fks7j+/qckkQWMUlHhKzlRNmQf9voQheinl7ctUFFJMBx0z3YxhrlufI9q YlXjFcIY3b9Kfbis+RiCKI7WzrweRC5BS/SeVyGyzPXcEyob0/PQl+d08K2/z+pxRdj+ sQJFCvhyXD87lD0jKgJXB8/fcNR6hT9T2he8DC0718XjhiuWuBOoMLPiNbODwEokph+s RjwUVDkawiYaCEnGYPftyWgPVx501/uqVnI1F5vDj5eZxFg0EgXDKKfeTgVpMXbLVFyF QEoLv6di0buOyATR9EU68cgrAsRJaWYXOoG7rm4qU3jQR38zQJTovUFK2LP2biboqqDf 3cSQ== X-Gm-Message-State: AC+VfDy8c0xZQhEQuuJ6R7aFTDobcYiZEDBdD5foSfBf4boBbq5NPTks Y22NQSD0wKjWiDb8IgEZLBCJMoj+48Y+IuPSB8TTWg== X-Received: by 2002:a05:600c:2206:b0:3f4:2220:28cc with SMTP id z6-20020a05600c220600b003f4222028ccmr20665143wml.9.1684226402865; Tue, 16 May 2023 01:40:02 -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 i18-20020a5d5592000000b00307acec258esm1825986wrv.3.2023.05.16.01.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 01:40:02 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Arnaud Charlet Subject: [COMMITTED] ada: Bad handling of ASCII with -gnatyn Date: Tue, 16 May 2023 10:40:01 +0200 Message-Id: <20230516084001.1501211-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766039940335271653?= X-GMAIL-MSGID: =?utf-8?q?1766039940335271653?= From: Arnaud Charlet ASCII is special cased but this wasn't taking into account all cases such as Standard.ASCII. gcc/ada/ * snames.ads-tmpl (Name_ASCII): New. * style.adb (Check_Identifier): Fix handling of ASCII. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/snames.ads-tmpl | 1 + gcc/ada/style.adb | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 8f71ad98db3..afe7508ac28 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -260,6 +260,7 @@ package Snames is -- Some miscellaneous names used for error detection/recovery + Name_ASCII : constant Name_Id := N + $; Name_Const : constant Name_Id := N + $; Name_Error : constant Name_Id := N + $; Name_False : constant Name_Id := N + $; diff --git a/gcc/ada/style.adb b/gcc/ada/style.adb index 3014359acba..dda5cd47c06 100644 --- a/gcc/ada/style.adb +++ b/gcc/ada/style.adb @@ -35,9 +35,8 @@ with Nlists; use Nlists; with Opt; use Opt; with Sinfo; use Sinfo; with Sinfo.Nodes; use Sinfo.Nodes; -with Sinfo.Utils; use Sinfo.Utils; with Sinput; use Sinput; -with Stand; use Stand; +with Snames; use Snames; with Stylesw; use Stylesw; package body Style is @@ -201,7 +200,7 @@ package body Style is else -- ASCII is all upper case - if Entity (Ref) = Standard_ASCII then + if Chars (Ref) = Name_ASCII then Cas := All_Upper_Case; -- Special handling for names in package ASCII