From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 41AA23858D35; Fri, 16 Jun 2023 14:02:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41AA23858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686924166; bh=ali9KQopsBI+BUMb5+qt1vkADuH0zBppMw+ocoGTbG4=; h=From:To:Subject:Date:From; b=gzQ6g9QXE4skErUDIHCpPU3mj3BihzaVz003+q39CuPtGVxPiQkf170ghZp6LJsJM A1dERHX23c6GJN693tP8Wp8zcEVQu7MeFE7X5A1OOP+3TboAAGyWIb3ByU91TCzPsh pq0RUdawtB6Atu3xxubNJs98m8dCnbt+bs/+V45U= From: "080ariel at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive. Date: Fri, 16 Jun 2023 14:02:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: 080ariel at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D110285 Bug ID: 110285 Summary: -Wanalyzer-infinite-loop false positive. Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: 080ariel at gmail dot com Target Milestone: --- Created attachment 55346 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55346&action=3Dedit Preprocessed file of a-test1.i -Wanalyzer-infinite-loop reports a false positive in test1.c with -O0 -O1 -= O2 but not with -O3. -Wanalyzer-infinite-loop reports a false positive in test2.c only with -O3. Small changes fix the bug or change it from happening only=20 in -O3 to happening only in the others levels and vice-versa. It is why I have not been able to make test2.c minimal while keeping the bug in -O3(it is attached just to show it can=20 also happen in -O3). It does not realize it cannot recurse because the condition=20 to recurse is both condition_to_recurse and !condition_to_recurse.=20 The analyzer report exactly the same thing in 14.0.0 and in 13.1.1. ---------------------------------------------------------------------- Tested both in 13.1.1 and in 14.0.0(commit: b6cb10af12cf869c1ae348c0e5cb2d364ef0abce) in Linux. Options given when GCC was configured/built: ../configure --enable-language= s=3Dc Complete command line that triggers the bug: gcc -fanalyzer minimalcase.c=