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
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ 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] 8+ messages in thread

* [Bug analyzer/110285] -Wanalyzer-infinite-loop false positive.
  2023-06-16 14:02 [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive 080ariel at gmail dot com
@ 2023-06-16 14:03 ` 080ariel at gmail dot com
  2023-06-16 14:05 ` 080ariel at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 080ariel at gmail dot com @ 2023-06-16 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Ariel Cabello Mateos <080ariel at gmail dot com> ---
Created attachment 55347
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55347&action=edit
test1.c

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

* [Bug analyzer/110285] -Wanalyzer-infinite-loop false positive.
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 080ariel at gmail dot com @ 2023-06-16 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ariel Cabello Mateos <080ariel at gmail dot com> ---
Created attachment 55348
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55348&action=edit
test2.c

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

* [Bug analyzer/110285] -Wanalyzer-infinite-loop false positive.
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 080ariel at gmail dot com @ 2023-06-16 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ariel Cabello Mateos <080ariel at gmail dot com> ---
Created attachment 55349
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55349&action=edit
Preprocessed source of test2.c

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

* [Bug analyzer/110285] -Wanalyzer-infinite-recursion false positive involving floating-point values
  2023-06-16 14:02 [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive 080ariel at gmail dot com
                   ` (2 preceding siblings ...)
  2023-06-16 14:07 ` 080ariel at gmail dot com
@ 2023-06-16 21:29 ` dmalcolm at gcc dot gnu.org
  2024-02-16 19:47 ` [Bug analyzer/110285] [13/14 Regression] " dmalcolm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2023-06-16 21:29 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|-Wanalyzer-infinite-recursi |-Wanalyzer-infinite-recursi
                   |on false positive           |on false positive involving
                   |                            |floating-point values

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this.

-fanalyzer currently doesn't attempt to track conditions involving floating
point, so it incorrectly treats both A and !A as potentially being true along
an execution path, leading to the false positive.  Sorry about this.

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

* [Bug analyzer/110285] [13/14 Regression] -Wanalyzer-infinite-recursion false positive involving floating-point values
  2023-06-16 14:02 [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive 080ariel at gmail dot com
                   ` (3 preceding siblings ...)
  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 ` 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
  6 siblings, 0 replies; 8+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-02-16 19:47 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-02-16
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
            Summary|-Wanalyzer-infinite-recursi |[13/14 Regression]
                   |on false positive involving |-Wanalyzer-infinite-recursi
                   |floating-point values       |on false positive involving
                   |                            |floating-point values

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

* [Bug analyzer/110285] [13/14 Regression] -Wanalyzer-infinite-recursion false positive involving floating-point values
  2023-06-16 14:02 [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive 080ariel at gmail dot com
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-04 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.3

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

* [Bug analyzer/110285] [13/14 Regression] -Wanalyzer-infinite-recursion false positive involving floating-point values
  2023-06-16 14:02 [Bug analyzer/110285] New: -Wanalyzer-infinite-loop false positive 080ariel at gmail dot com
                   ` (5 preceding siblings ...)
  2024-03-04 13:00 ` rguenth at gcc dot gnu.org
@ 2024-03-22 13:45 ` law at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-22 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
           Priority|P3                          |P2

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

end of thread, other threads:[~2024-03-22 13:45 UTC | newest]

Thread overview: 8+ 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

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