From patchwork Tue Nov 7 09:20:18 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: 162348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp113749vqo; Tue, 7 Nov 2023 01:26:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IETnGATAOYHd41iZt9pUW3+/FOyYl+X5EJOQv/eB5ErLML9L9UJzD4maMK/W4sk0JL2rYed X-Received: by 2002:a05:620a:1a92:b0:775:cf5f:8a77 with SMTP id bl18-20020a05620a1a9200b00775cf5f8a77mr38702805qkb.34.1699349207222; Tue, 07 Nov 2023 01:26:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699349207; cv=pass; d=google.com; s=arc-20160816; b=Wuk+HKLE5n2Y2Da3GW9mS1na63FDxK15ATxbMx01Ke5Vj8Er2ufmgA7aS94xnRUl/u 48HLtfUfVhSKMkIAqGVSyTCYa1LF4MXNcGhT6kH8ffIaf0XWfGAgEUhX8vXAUgeNWfwp suOma+d1uMwMjB/WOUCkmONjdluVXaZlb0FS9Nkm4nSpEvSDa+wyME94YMPJY/R+R9jD 3YsEZOQahMl7GKw+XAnf1EPgJ3ycmpzMO+X6y7+4yEccZtaemv+MtJKuNFvO7KotEp0P EOE68RWZr4m0GikjIpHxi78ooxDUXZOM7lhx4dwhB8tvBW+rcnkS5WouN8p00dGhcr8R CnpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=JZEc7O02uJ77Yql1mvL65VP6Ie2NsZDA/v1wZikomIk=; fh=hOhsC1930eHatDPYd2EALQ9Ry/g++vvN4vxlQkRuX+0=; b=rbLYtFKLxEdLX+gXe8u1LB2zKr3Rxsp9n6jcISf49E9h5kBJ5G+ALDPZdHQACjqpv7 W1lakVkKiil6V56A7zNi+YI2O4Bp8SQpABD6Wb1K9s2Ty/7Db36dlZ8eXEZduj6Qu4i3 sjwhI2ibYKofIdUPP0Y1e4Lgvr2YqONmdhBBQiv8rA75BKWxTgklfwvngHTocJ/n00p4 6FNv2ghhMaPIMzAdO17yW193hjbRTSgxqC+3BereJwgJH5QDrg01sDexRyq7ULZoPxtb eG9guQ9AsoDAxo6kMcqenHwj9GAl7vm1UdgwREgK6jlodg65RIasX3hg8SRUHZJXsD6F PS9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=PKi2Dxjb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h14-20020a37de0e000000b007759c22efdbsi6517102qkj.100.2023.11.07.01.26.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:26:47 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=PKi2Dxjb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC6613857020 for ; Tue, 7 Nov 2023 09:26:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id C11DB385DC26 for ; Tue, 7 Nov 2023 09:20:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C11DB385DC26 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 C11DB385DC26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348825; cv=none; b=vMGib8AGzWjWIMY8K0RWYO2vKxHBt+zpjxQguwbgHGnwVdrntRsBAUISg6g2+h0UeYi8L2Iccg6Ncl0Rp/Lmh7dwLw0Lojg8S/2fY8MxYurNqxTi2YjOAg/052b0Jt8X3Z6pmRHaFfSjDAQVDuIAa6a3MnYMvc9iuYAXshfyLzc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699348825; c=relaxed/simple; bh=am4xE4SXwlFROXH5b7TYeS2BQ5ODzjWdcCBSqIcLEK4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tU4fINfb590H5mazQ5AgGyK9Cfg04aNHK0tZN+0DGP7DJei38D9jNyFVEkRTokoCnUgABDJnGgqwzFgw5Q1n5n5RW+fLW5RyQp0kkfcPDnRVXVUHXrQ88i/fbkL54J0BTbjoNyqPaKYzdduvudbaJOZNkUVDESgxXPEoYPAwtFM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c5b7764016so72871491fa.1 for ; Tue, 07 Nov 2023 01:20:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1699348821; x=1699953621; 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=JZEc7O02uJ77Yql1mvL65VP6Ie2NsZDA/v1wZikomIk=; b=PKi2DxjbVgwvXo29OQp5bg3dt3e51YTCL2DTWY8cFcAYmPC7uQ8QWOLlpUQfgdKopr 8S2GjrUyeZDNto7cz1GVcbdM/Wl3f/I8L0ctolQWeL/sb0JT/HDRgyCrm4FNF7AX1TMA pfMsScsV2X8BgyX9x/t0WUsD/43aZGVNOI3xppXQrp4OJjFegasUSD4QrSu8z+I/aBST j4unPETEy3D6IF2gakQEq/x8pAKotcZls5tRGDmnBaC01RkURAXrDIG1ppaE4eSNgE6f E6AiwJIHhG1N+a96zDe97kM6a1lPWbmIRYUjARHxoscMvdvDdsTwNvbg2qh+bxriXHxC xoOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699348821; x=1699953621; 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=JZEc7O02uJ77Yql1mvL65VP6Ie2NsZDA/v1wZikomIk=; b=B9qKoVWAhtcKpWs0U/yB3IT1JqPVR8RwYsvAn0GUIUbnxDK1RJHuIG8yYCYGuV4toF hrKtuBKD0/kizrof+tSLDtff45cK5DgOxLc8naGDms7B+tmBbSIMVanWpyetiEQFh2fp R3Id7xTT2eliQciaqcYB6WE4wpfGIQanMXt1RK4YYzkGqrpnZOrzemT2RlFEdM56Io+i mtmUOvkgK4jBeP2qNeNyXeAMj3vyTMaQ2cc107KXhUHfU2s1sPqzxJDYARrIjM7Pa6Fx S5eJB4p/iBrLxZo4SNfxNy37oNLlohy0T6VyMUMFPpYrhsnr9yWf60s8ohqGLFM2faQQ /jeQ== X-Gm-Message-State: AOJu0YwjjDl6h2bojkdmqIVkyCMwApgZ1UthE0IUDD17RWHN1gL6ApaU VLXRZMJJ77Nazzdu8rHbK9FydizHLKyu0otG++9NvA== X-Received: by 2002:a2e:9457:0:b0:2bc:efa4:2c32 with SMTP id o23-20020a2e9457000000b002bcefa42c32mr24815371ljh.37.1699348821337; Tue, 07 Nov 2023 01:20:21 -0800 (PST) Received: from localhost.localdomain ([2001:861:3382:1a90:dbc1:a1d1:2e58:4040]) by smtp.gmail.com with ESMTPSA id a15-20020a5d456f000000b0032fab28e9c9sm1781289wrc.73.2023.11.07.01.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 01:20:20 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Minor tweaks for comparison operators Date: Tue, 7 Nov 2023 10:20:18 +0100 Message-ID: <20231107092018.3906393-1-poulhies@adacore.com> X-Mailer: git-send-email 2.42.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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781896794433582504 X-GMAIL-MSGID: 1781896794433582504 From: Eric Botcazou No functional changes. gcc/ada/ * gen_il-gen-gen_nodes.adb (N_Op_Boolean): Fix description. * sem_ch4.adb (Analyze_Comparison_Equality_Op): Tidy up. * sem_ch12.adb (Copy_Generic_Node): Use N_Op_Compare subtype. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gen_il-gen-gen_nodes.adb | 3 +-- gcc/ada/sem_ch12.adb | 8 +------- gcc/ada/sem_ch4.adb | 9 ++++----- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index 2ad6e60dae8..0d2a68ea681 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -255,8 +255,7 @@ begin -- Gen_IL.Gen.Gen_Nodes Sm (Do_Division_Check, Flag))); Ab (N_Op_Boolean, N_Binary_Op); - -- Binary operators that take operands of a boolean type, and yield a - -- result of a boolean type. + -- Binary operators that yield a result of a boolean type Cc (N_Op_And, N_Op_Boolean, (Sm (Chars, Name_Id), diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index c264f2a8283..80b3e16ea75 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -8196,13 +8196,7 @@ package body Sem_Ch12 is -- if one of the operands is of a universal type, we need -- to manually restore the full view of private types. - if Nkind (N) in N_Op_Eq - | N_Op_Ge - | N_Op_Gt - | N_Op_Le - | N_Op_Lt - | N_Op_Ne - then + if Nkind (N) in N_Op_Compare then if Yields_Universal_Type (Left_Opnd (Assoc)) then if Present (Etype (Right_Opnd (Assoc))) and then diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index e3badc3e19d..78249258f55 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -2099,16 +2099,15 @@ package body Sem_Ch4 is end loop; end if; - -- If there was no match, and the operator is inequality, this may be + -- If there was no match and the operator is inequality, this may be -- a case where inequality has not been made explicit, as for tagged -- types. Analyze the node as the negation of an equality operation. - -- This cannot be done earlier, because before analysis we cannot rule + -- This cannot be done earlier because, before analysis, we cannot rule -- out the presence of an explicit inequality. - if Etype (N) = Any_Type - and then Nkind (N) = N_Op_Ne - then + if Etype (N) = Any_Type and then Nkind (N) = N_Op_Ne then Op_Id := Get_Name_Entity_Id (Name_Op_Eq); + while Present (Op_Id) loop if Ekind (Op_Id) = E_Operator then Find_Comparison_Equality_Types (L, R, Op_Id, N);