From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C27993858417; Sun, 28 May 2023 20:15:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C27993858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685304907; bh=X9ftxnxOtn1A9n5J7NP8vskdzR1qRnDWrHLsRJz31aE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ewp3vNQACl1bPQgIlEr2LAJRXXZelPF/bJ6/anQkxYgiEwYcmidffTJDN24Xt0Bc5 XCI4n5omwoFPsarEVJAjtSAYePXUp37SioJofXHQOCZFVhJna5g1a/4J5EAbGmeTGy zQ/gzT8KlevP4Otg/VVnsr/wUkhDacQskGslYL+M= From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions Date: Sun, 28 May 2023 20:15:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109914 --- Comment #2 from Jan Hubicka --- The reason why gcc warns is that it is unable to prove that the function is always finite. This means that it can not auto-detect pure attribute since optimizing the call out may turn infinite program to finite one.=20 So adding the attribute would still help compiler to know that the loops are indeed finite.=