public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive.
@ 2023-06-16 14:02 080ariel at gmail dot com
  2023-06-16 14:03 ` [Bug analyzer/110285] " 080ariel at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: 080ariel at gmail dot com @ 2023-06-16 14:02 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-05-21  9:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 14:02 [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive 080ariel at gmail dot com
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

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).