From patchwork Thu Jan 6 17:12:53 2022 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: 1576193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=Xm7ANx8K; dkim-atps=neutral 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=) Received: from sourceware.org (ip-8-43-85-97.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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JVCjz1dfnz9sPC for ; Fri, 7 Jan 2022 04:18:31 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B75D53858027 for ; Thu, 6 Jan 2022 17:18:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B75D53858027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1641489508; bh=51egA1iY53rf+55bFg60TKkx/25FI/z3rcBx9oW4jxU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Xm7ANx8KwNSPjfJtQZdFOjMhe4WI5lfXK621KEJ1tgoxg5PMroVG7LOB38NakUK7P bC5JUXctGRS0pfE5BpYAa8awH/mKkn05GSMovq/fI+UODdxPPPmtUb11DVgiERCW+X tzDTyYmyJVVMmS3tc5BQK3X2tPrjVpwDSjA/+ZUk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 7AC053858033 for ; Thu, 6 Jan 2022 17:12:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7AC053858033 Received: by mail-wr1-x42c.google.com with SMTP id r17so6140769wrc.3 for ; Thu, 06 Jan 2022 09:12:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=51egA1iY53rf+55bFg60TKkx/25FI/z3rcBx9oW4jxU=; b=vlkdK+VBQ89WxPGEi5Y9ppW7c5gO7zZB8SBVL0VVsKL+SM1M0431AuRtZUXMRU4jrI qPHvFJQgHcZARCrHZzWiHXNMxZyQIA1V3QLHhM8gFoUelKPy+QjpnpOJYnRC3U4HngAN N7f2tlZBlEWwQ1Jo+pZQ38StiNb8vpRm6QOcVnYXhG0kM4hZ8d7ij28CQN/eB7qo8zUR 0+tWtyq5b9mIVjuBTPT6xAgxBAGjameY8xZw5u2aVoEFSPL6QxSH+wdIOttH4WcB4PZM wsq8wPBPhLa+jzk96jPDRG2GKndcwKi423sOA63imm6gS8gzFJ/9EAW/fqI5Vft0swXJ J4GA== X-Gm-Message-State: AOAM530Zf1GItdLOyFPV/qNw1EiU//n6nALqxReZdHKAnXpU/FVTUzGu 3Wdv6GrrBs+/y9o0iZ9RICrL2kyc1pv25w== X-Google-Smtp-Source: ABdhPJxAeGNEygsf5KcRQii5p8Q2hcgUcWmaAWyOVON27Oasq/oilJiGwJRIHVZZuNTw/aA/U+1r6Q== X-Received: by 2002:a5d:64c6:: with SMTP id f6mr50003288wri.711.1641489174554; Thu, 06 Jan 2022 09:12:54 -0800 (PST) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id t15sm2508012wrz.82.2022.01.06.09.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 09:12:53 -0800 (PST) Date: Thu, 6 Jan 2022 17:12:53 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Justify false positive message from CodePeer analysis of GNAT Message-ID: <20220106171253.GA2921446@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.1 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 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: , X-Patchwork-Original-From: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Yannick Moy Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Analysis of loop variant is known to lead to false alarms with CodePeer. Add pragma Annotate in such a case which can be justified. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-exponu.adb (Exponu): Add annotation. diff --git a/gcc/ada/libgnat/s-exponu.adb b/gcc/ada/libgnat/s-exponu.adb --- a/gcc/ada/libgnat/s-exponu.adb +++ b/gcc/ada/libgnat/s-exponu.adb @@ -64,6 +64,9 @@ begin pragma Loop_Invariant (Exp > 0); pragma Loop_Invariant (Result * Factor ** Exp = Left ** Right); pragma Loop_Variant (Decreases => Exp); + pragma Annotate + (CodePeer, False_Positive, + "validity check", "confusion on generated code"); if Exp rem 2 /= 0 then pragma Assert