From patchwork Tue May 23 08:08:56 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: 97882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1980229vqo; Tue, 23 May 2023 01:26:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LLyBK+64b45qnRlsnv51SgebUrNSKi3qpbdlRMbh+ZMMWFPW4wcntV1IoXOrRl88wHBDr X-Received: by 2002:a17:907:3e0b:b0:967:13a3:d82c with SMTP id hp11-20020a1709073e0b00b0096713a3d82cmr13951737ejc.26.1684830416488; Tue, 23 May 2023 01:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684830416; cv=none; d=google.com; s=arc-20160816; b=nMKHP9FQWuXLJFmAs4GYrTpIEdFNs9Z80Bs46EGTd9hEEYuAneX6EFhRmKRj7PnoWz Xy0mTQzFyiM00A1QLTosSzb7GewH3+0NcuaHWuVoLqdvt3jpaNBZZEu2a2DsVrHshQxr pSH6luoJPKoI9+FmxPp+ZxdmDXp3FX7ql6Sz+Judqs/X3QwByxN+k6iqXdTTRwe5kQqZ /yW0J4QuszXq7Tdb16q1AZWXkI4rdH++Ww5BV2jd6vYCNUOV8UHPc/sL/49uHBcS186b pI5cgqwbmmsYCmOS77z48BpDHsbey+bbok1AdxRJhyJ6Vn872xb4YfvG4wbOgx/cfHAv WTfA== 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=L6kGpPDAJbozFvqYaADTq8lz37cALlzjObp2DiiiMVg=; b=S/S5szK9WJ/DlRhLs8mijAG/exyOiIL/iWtunyil2U9M9iBwceHDgCJpsxx+1bD8q3 zT/C2njl2glRBDKC0x/n3I8FddvR6wqDHiGKe06FnDds4Oq0QO6a8oPXs++pgBe1iXcn NQz6XkrQdK9ewUjeuyRwfeDZ9JCfoXv4QDuT9zqcrXWRrDD6/qfF4bfnODVfZzdDrVFb WkK0hcuKEUyqFkV/4hQrAd81jcUDp3fnUQ3AXwOpXWVxCGQ69doYY8xi5h/88rcKHXvF 9n8a0N/POKBqa400SDLgOy8qMxODqPOMF28HR33xQqoUIRATwgB1ZwpREQ9BRAWVHLtL /0ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Bmk/bD2A"; 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=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lu19-20020a170906fad300b00965d146c112si310941ejb.630.2023.05.23.01.26.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:26:56 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b="Bmk/bD2A"; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF0A73947411 for ; Tue, 23 May 2023 08:16:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF0A73947411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684829813; bh=L6kGpPDAJbozFvqYaADTq8lz37cALlzjObp2DiiiMVg=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Bmk/bD2AfRRlawFrhAObyAbIKZIC0twFtsYfjmoYHuyNzegbr/+/GHJC+ZjC02q57 cRNK7LxVNuo7KDCcAFsmu/qJYmkMoWCd6SxoFm+FfY5njezVj/M2vcHDm2kdxHoNw7 3t0ja84zRpvwiP46GZ2aSwqW0UG0ethnwY0V81mM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 9E88638768BB for ; Tue, 23 May 2023 08:08:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E88638768BB Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f60e536250so273805e9.1 for ; Tue, 23 May 2023 01:08:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684829337; x=1687421337; 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=L6kGpPDAJbozFvqYaADTq8lz37cALlzjObp2DiiiMVg=; b=W4R2PSJxKaZM++tqo20GeAjfMWz0ZbPMjU1vhfZx4qy8fhJDHgX0Pzg09IamBaRT2R 2K6aPqO5DduLU8htOeFo/BUlWm323ge1TWrTXbuagbt+IbUa8fJK//Ez6njh2RxoQwIP how7HezNdH3ILnXid5gY8owCVJOAUgsHaGG/PrxXx1lnniQla6Uj0/QlvS1J5ldd2GTc ErxnPBQ1g7pukjLPo3Cock5X5gvJOiq889TJcEeBMv/cPNOYgQT9T8HOzQkOCpRFkUWO rOnhh9KsqkrcCSXSDDRy8aiYXC/Lgb0rXVkTLgMBn5ch9vO2nFbOtNvRhLKqFhTnAiOV nBHg== X-Gm-Message-State: AC+VfDz+/o33yEXvl8PTmMzWi8zZQhcLk1hJ8uXh0zIjqtHI/8zp0MPB XTtoPGbohRUmEmRsqMjmaxhBMmdfsbLz7/BpKB5VOw== X-Received: by 2002:a7b:c044:0:b0:3f4:2a69:409 with SMTP id u4-20020a7bc044000000b003f42a690409mr9450481wmc.11.1684829337389; Tue, 23 May 2023 01:08:57 -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 u3-20020a7bc043000000b003f4f89bc48dsm14052249wmc.15.2023.05.23.01.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:08:56 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Fix oversight in latest change Date: Tue, 23 May 2023 10:08:56 +0200 Message-Id: <20230523080856.1874354-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 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?1766672738771854252?= X-GMAIL-MSGID: =?utf-8?q?1766672738771854252?= From: Eric Botcazou The resolution must be identical inside and outside the System hierarchy. gcc/ada/ * sem_res.adb (Resolve_Intrinsic_Operator): Always perform the same resolution for the special mod operator of System.Storage_Elements. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index f1d9a97452a..3b7d821158c 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -9778,11 +9778,13 @@ package body Sem_Res is -- If the result or operand types are private, rewrite with unchecked -- conversions on the operands and the result, to expose the proper - -- underlying numeric type. + -- underlying numeric type. Likewise for the special mod operator of + -- System.Storage_Elements, to expose the modified base type. if Is_Private_Type (Typ) or else Is_Private_Type (Etype (Left_Opnd (N))) or else Is_Private_Type (Etype (Right_Opnd (N))) + or else Is_Stoele_Mod then Arg1 := Convert_Operand (Left_Opnd (N));