From patchwork Tue May 30 07:21:19 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: 100610 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1999344vqr; Tue, 30 May 2023 00:33:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4P7weC0mQPO00YWG2unAb2HvD5fRQbCsvLfQ0EAr9+YFsIH1C3CUiGRAC30BHHbWrb73nS X-Received: by 2002:a17:907:3f82:b0:96b:4ed5:a1c9 with SMTP id hr2-20020a1709073f8200b0096b4ed5a1c9mr1821813ejc.51.1685432036555; Tue, 30 May 2023 00:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685432036; cv=none; d=google.com; s=arc-20160816; b=IS4JTHuTasucZZoN9g/gEU0wzwLI9y+omrjOwu5Gh1sRo+Nmz1PScmrVvfODkPhecf bRKoIJUHb7Nz8BTJUpFdWOu57tJ40bdoydOk4VQ7yjI2qiVJSbJKErgJhKoN/I5L9YsZ k2bz94BB0G8HPBquRI4KFtPLhbgiq9MWF6/M/yWrwmV07WN16ctObh0rRVYnFfbMne+f Xwisj+E1jsCSztJ6UqbuxCBMgstkYMfW/18hoGGFO8uwMcP4IOEqkT8OUZaetSG+yzNz iNUrl0IZjCajPXPEZxaGGE30HFwGzkvCvNAD/8nwcnl1XHynny4/DT6uH8EzkdNhKLkL NZEg== 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=tMdTGb4LKdoDnPdUAsq2IJhF6Jl2QX3CTGswu7B043Y=; b=I0wjHRnXXuzaVUh4xat2sNrTLfYTFy9yek0raLyVPvYs+NVLl6aCNLUSEOePi3TAqs 1T6WrRymH/lgaP8S/k3+1sNExTMELsWOLOzSEmoV7PhkxsREsa7pstUNzhCQW3fFLXvK p3cgLlLpSVJ6k6CuTm5kX84c8i03HUHBsHm25lndQ/6LeWRzOIeQtLcEWtMdBIXwFA07 bY9wSeGENFCOheaK2oYbpe5St0Y38yqxfBMtZqDJaJSUIllgD5Z3RGNtk7WSKF7WhuZm ZkWPMBqBGj5mjJOnN0yw6YmAjtX0LPBhoyXfOgLzHmq/g9M2TLjZzpIb6aRx0/m0JYJF w+vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=beoMgC6z; 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 h14-20020a17090619ce00b0096f5b58e7f2si356958ejd.778.2023.05.30.00.33.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 00:33: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=beoMgC6z; 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 6BB57384F1E3 for ; Tue, 30 May 2023 07:27:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BB57384F1E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685431659; bh=tMdTGb4LKdoDnPdUAsq2IJhF6Jl2QX3CTGswu7B043Y=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=beoMgC6zqyD7SVV5BSeGx1M1suL2w8X3uHrd50+KfyW0cgqZLceQnYJTwKn3hlzRq jcxhIjkmKg4wINAt5imu+ir0EnbSo/yO/Uo/gBhX9oGR+6tEPs44SCj8AKFbJw1ZhQ Rp2RASQ7dz9zokUNIZmKma9zbtk/ItKdSFfJUDuo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id B35AC385C6D8 for ; Tue, 30 May 2023 07:21:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B35AC385C6D8 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-30adc51b65cso3579489f8f.0 for ; Tue, 30 May 2023 00:21:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685431280; x=1688023280; 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=tMdTGb4LKdoDnPdUAsq2IJhF6Jl2QX3CTGswu7B043Y=; b=I1siAROUYP+maTxmdkal2oZEYLP9cqNGHfGZf5Dgp0MjG/gVu+jMtnqwNutrN5YTfd D5KIckr0MhEAgJcCq3lbCtzq7nadtgbObfWn0mLSdhxxR3PjKeGEKWxP/Y//TUK/LFOw RpsiAG60SMb+iuBmQARTqgj+rmooFcjr+01DDlDkD0lOp9oD286dX4UZnMImMZzGdcoS DJF5QhIFf7N5VZF8RirOapZyj7nPLJHrSsLVLQF9HIXGpiGlhYyLR9w4V7b0cafC/Tpt p5xqwLHFKbEbgRfOKtMzcOu1rICWD38UFMQP+Wda09dq8VN0+vsPsXRy/PxGdgPKYPB3 cvBA== X-Gm-Message-State: AC+VfDw2epcKc5JXyFHiOMqegdZO0Orb6KON9lr3zctb4yTUO5LDdr9Y 8TxL82L0QemP/Nsr45f4qszlGXcfQ8YBpAdc2b/5Rg== X-Received: by 2002:adf:eccd:0:b0:30a:e8de:f820 with SMTP id s13-20020adfeccd000000b0030ae8def820mr1259403wro.30.1685431280631; Tue, 30 May 2023 00:21:20 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:7733:a608:a415:6b2a]) by smtp.gmail.com with ESMTPSA id g3-20020a5d46c3000000b002f28de9f73bsm2250466wrs.55.2023.05.30.00.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 00:21:20 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Fix minor issue with Mod operator Date: Tue, 30 May 2023 09:21:19 +0200 Message-Id: <20230530072119.2500748-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.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.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?1767303583236466116?= X-GMAIL-MSGID: =?utf-8?q?1767303583236466116?= From: Eric Botcazou gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu) : Test the precision of the operation rather than that of the result type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/trans.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 8c8a78f5d2d..1c3c6c0618e 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -7095,9 +7095,9 @@ gnat_to_gnu (Node_Id gnat_node) gnu_rhs = convert (gnu_count_type, gnu_rhs); gnu_max_shift = convert (TREE_TYPE (gnu_rhs), TYPE_SIZE (gnu_type)); - /* If the result type is larger than a word, then declare the dependence - on the libgcc routine. */ - if (TYPE_PRECISION (gnu_result_type) > BITS_PER_WORD) + /* If the result type is larger than a word, then declare the + dependence on the libgcc routine. */ + if (TYPE_PRECISION (gnu_type) > BITS_PER_WORD) Check_Restriction_No_Dependence_On_System (Name_Gcc, gnat_node); } @@ -7114,7 +7114,7 @@ gnat_to_gnu (Node_Id gnat_node) /* If this is a modulo/remainder and the result type is larger than a word, then declare the dependence on the libgcc routine. */ else if ((kind == N_Op_Mod ||kind == N_Op_Rem) - && TYPE_PRECISION (gnu_result_type) > BITS_PER_WORD) + && TYPE_PRECISION (gnu_type) > BITS_PER_WORD) Check_Restriction_No_Dependence_On_System (Name_Gcc, gnat_node); /* Pending generic support for efficient vector logical operations in