From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f42ba32e24so53860675e9.3 for ; Tue, 16 May 2023 01:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1684226403; x=1686818403; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vWNwsWqeEnOUMNwNzgKeyA/j4XrKtDEIIIMsRVgVMW4=; b=TJ8trQKjIz8KEjgNaNanF+geDqH2ONpNdUoZjHNc5382y02EqiRJYDzW5Ih1s2B/Bs 9+j2Z+HJNsWJVJ/70hxPZXuhNgknDL0bDrK27L1f9X0202fusNIcLPRRWls5pGTfMhJs lN+OmpW7IlK/D6SjZDQXIGZeVxfEXyi0jXoC6BQrHQlwI55IZz72Q5u+Cl4dojLFZf2Q O156ylHr6zzIPyVbE5CDb3x4EdJu6Bht9v+KywcX4X3KSq4qrkyNTN2BI/COqdbRXOw5 m/s9tYzl9CnJXiPYo6O+yk5C/pxDAZC/aVR3Ur7yvFqE5FVRQ+p0eC5L/JyK/tCZizaG 1m5A== 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-Google-Smtp-Source: ACHHUZ6zyh+DfttPnLvNU/M0wJx92GFsuHKgPZKp5ZSa6NIzMAbATOz5MsMXPzKc7lwmLP/5aO8MUw== 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) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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 -- 2.40.0