public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "080ariel at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-110285-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110285

            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=55346&action=edit
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 
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 
also happen in -O3).

It does not realize it cannot recurse because the condition 
to recurse is both condition_to_recurse and !condition_to_recurse. 

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-languages=c
Complete command line that triggers the bug: gcc -fanalyzer minimalcase.c

             reply	other threads:[~2023-06-16 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 14:02 080ariel at gmail dot com [this message]
2023-06-16 14:03 ` [Bug analyzer/110285] " 080ariel at gmail dot com
2023-06-16 14:05 ` 080ariel at gmail dot com
2023-06-16 14:07 ` 080ariel at gmail dot com
2023-06-16 21:29 ` [Bug analyzer/110285] -Wanalyzer-infinite-recursion false positive involving floating-point values dmalcolm at gcc dot gnu.org
2024-02-16 19:47 ` [Bug analyzer/110285] [13/14 Regression] " dmalcolm at gcc dot gnu.org
2024-03-04 13:00 ` rguenth at gcc dot gnu.org
2024-03-22 13:45 ` law at gcc dot gnu.org
2024-05-21  9:15 ` [Bug analyzer/110285] [13/14/15 " jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110285-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).