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: 1784962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=RbuDa7yu; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QQRwr5VThz20Pr for ; Tue, 23 May 2023 18:16:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 965E43AA802B for ; Tue, 23 May 2023 08:16:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965E43AA802B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684829786; bh=L6kGpPDAJbozFvqYaADTq8lz37cALlzjObp2DiiiMVg=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=RbuDa7yuT3YfrK/YY/JqfdXczTfwuwe52gPkAGeTPEnwfIJ9nca+MZl1P9wky3PWC B2tm+gbUhoZ2EoSTPut9N92wmeq+5PL2QRPaPAflkqLdeV5fLnZxws0iSQxuguVgaZ t5YUDMPnHoQIX1ubsAW/TY/uPRCnOHhOsv4imoz8= 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-Google-Smtp-Source: ACHHUZ7dPG428uxzWxs88MfMmVc1vGrN15sfKolaqWaKM4jRSSZK1ZammGjesSbn6bOwBxA1Cr0UGw== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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));