From patchwork Mon Jul 5 13:13:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1500738 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=adacore-com.20150623.gappssmtp.com header.i=@adacore-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=wVcTnMWK; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GJR484MNcz9sWS for ; Mon, 5 Jul 2021 23:14:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BA1D33857409 for ; Mon, 5 Jul 2021 13:14:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id DDE663840001 for ; Mon, 5 Jul 2021 13:13:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DDE663840001 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-lj1-x22a.google.com with SMTP id t30so4630875ljo.5 for ; Mon, 05 Jul 2021 06:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=4Yxm5ZtnuZ2+7FRVW2jrVM0Ia7h1hQJHE+c6F4eK0uY=; b=wVcTnMWKFtpXmjP3JZKgadcBdZHkO5NEVQ/Nf/65AdYos1EQ7libf3pJxATQN7RQ++ ICnb5VSw4vA1Dm4RWbddLNq2+1NFFDKUsOOYqA7GtZmONwyRnMrFamBCLHvdSGlglpiD OXOcvSS+aqKFi+4wbycwVcvSvw1dj2idsfq/9dnR8KvvkwWmFnzhnkVGgd18Y81IdlDL rDI/vqRmItRvkvZ3zH0Ir09fWrznTHcLXDopZfH94g938Ue17Xnl9DPRQMv0PyYgciCu QLAyKVBsRUC4dItg/9uZyRdNGF7doc5afXp6IFs1oJWy1fzPLntpQfYwIX4sf33bMjPm tA2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=4Yxm5ZtnuZ2+7FRVW2jrVM0Ia7h1hQJHE+c6F4eK0uY=; b=UxB2mZKV0kCv/3/mjLhZRZrvXChgUZLaq1LPasOzYV4Squ7EDoUNyrYDzbrZmhNkp9 ILQph+wSlOpv0TUhtOEbIQ8R6zBaBw0QwdLH33szOxJQ5SjzvoUYwnDb/gPyiFZwRYTm YSiO4MWF0qIxQ9os4XaayQBDH7I1WPhdIRXqhmrziX6X1w0wHxp8pvS6LQI2pTHBZzfC PQC1lxBt136MQJcbohXyijNfyoJBIhI/TpiJ/3JZzXQPGGwaDiE/E6CnfQ+1pmfIQ++j RF0vHh7kElLOzwUk4oNtoJAvu+oDRqBLxBROB7Co5qP3dJsUUuC8qamo3qzgf/ZbiFFT 8R3Q== X-Gm-Message-State: AOAM531FL8SGS04AGjGQtxx9Y79S4dBCCVoNTZaTWO7BorjU9g5Nz2cM xG/wK+7KichzFyCJwRBEkGmyHL1Dq/aOZBDk X-Google-Smtp-Source: ABdhPJyjlu4o6k6C0+0vrc8sjqL0Q4m22mOs6RT9EdwK6axhUS6ScW6A7DKQkaJYWQWtjXO0gjghQw== X-Received: by 2002:a2e:b535:: with SMTP id z21mr11217165ljm.344.1625490819607; Mon, 05 Jul 2021 06:13:39 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id o16sm1084793lfb.98.2021.07.05.06.13.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 06:13:38 -0700 (PDT) Date: Mon, 5 Jul 2021 13:13:37 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Subject: [Ada] Do not catch 'N rem -1' in CodePeer_Mode Message-ID: <20210705131337.GA2222049@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: Boris Yakobowski Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The special case used for catching the 'rem -1' operation is not useful to CodePeer, and in fact may be detrimental to its precision. Remove it in CodePeer_Mode. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_Op_Rem): Remove special case for rem -1 in CodePeer_Mode. diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -10393,7 +10393,9 @@ package body Exp_Ch4 is -- types and this is really marginal). We will just assume that we need -- the test if the left operand can be negative at all. - if Lneg and Rneg then + if (Lneg and Rneg) + and then not CodePeer_Mode + then Rewrite (N, Make_If_Expression (Loc, Expressions => New_List (