public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/108492] New: __analyzer_eval has effect on the analysis result of gcc static analyzer
@ 2023-01-23 10:44 mengli.ming at outlook dot com
2023-01-29 13:25 ` [Bug analyzer/108492] " mengli.ming at outlook dot com
0 siblings, 1 reply; 2+ messages in thread
From: mengli.ming at outlook dot com @ 2023-01-23 10:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108492
Bug ID: 108492
Summary: __analyzer_eval has effect on the analysis result of
gcc static analyzer
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: mengli.ming at outlook dot com
Target Milestone: ---
case:
```c
void __analyzer_eval();
void f(int b)
{
int c = 1;
__analyzer_eval(c && (c = 0) | b);
if (c && (c = 0) | b)
{
int *p = (int *)0;
__analyzer_eval(c && (c = 0) | b);
if (c && (c = 0) | b)
{
*p = 42;
}
}
}
```
In this case, when `__analyzer_eval` is added at line 6
(https://godbolt.org/z/defnzqKPn), the eval statement inside the if branch has
no output. However, when line 6 is commented out
(https://godbolt.org/z/j4dGGEM1s), then the result is output.
Also, the eval result of `(c && (c = 0) | b)` should probably be TRUE after
analyzer goes inside the if branch.
Thank you for taking the time to review this case.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug analyzer/108492] __analyzer_eval has effect on the analysis result of gcc static analyzer
2023-01-23 10:44 [Bug analyzer/108492] New: __analyzer_eval has effect on the analysis result of gcc static analyzer mengli.ming at outlook dot com
@ 2023-01-29 13:25 ` mengli.ming at outlook dot com
0 siblings, 0 replies; 2+ messages in thread
From: mengli.ming at outlook dot com @ 2023-01-29 13:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108492
ming mengli <mengli.ming at outlook dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from ming mengli <mengli.ming at outlook dot com> ---
I'm sorry, there is nothing wrong with this case, sorry to bother you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-29 13:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23 10:44 [Bug analyzer/108492] New: __analyzer_eval has effect on the analysis result of gcc static analyzer mengli.ming at outlook dot com
2023-01-29 13:25 ` [Bug analyzer/108492] " mengli.ming at outlook dot com
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).