public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug analyzer/106620] New: Incorrectly thinks execution can continue after a return statement @ 2022-08-15 8:55 nrk at disroot dot org 2022-08-15 15:33 ` [Bug analyzer/106620] " dmalcolm at gcc dot gnu.org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: nrk at disroot dot org @ 2022-08-15 8:55 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106620 Bug ID: 106620 Summary: Incorrectly thinks execution can continue after a return statement Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: nrk at disroot dot org Target Milestone: --- Created attachment 53457 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53457&action=edit sample code Sample code (also attached) : https://godbolt.org/z/ez556Yd39 It thinks that memchr() is being called with null. But if `hay` was null, then the function returns, so that's not possible. Removing the `|| nlen == 1` silences the warning. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug analyzer/106620] Incorrectly thinks execution can continue after a return statement 2022-08-15 8:55 [Bug analyzer/106620] New: Incorrectly thinks execution can continue after a return statement nrk at disroot dot org @ 2022-08-15 15:33 ` dmalcolm at gcc dot gnu.org 2022-08-15 15:34 ` dmalcolm at gcc dot gnu.org 2022-08-16 2:06 ` nrk at disroot dot org 2 siblings, 0 replies; 4+ messages in thread From: dmalcolm at gcc dot gnu.org @ 2022-08-15 15:33 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106620 David Malcolm <dmalcolm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WORKSFORME --- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Thanks for filing this. Looking at the Compiler Explorer link, the false positive occurs with gcc 11.1 at -O3. With gcc 11.1 and gcc 11.3 the false +ve occurs at -O1 and above. With gcc 12.1 and trunk, the false +ve does not occur. I've made lots of implementation changes to -fanalyzer in gcc 12 in beyond that I don't intend to backport to gcc 11, so I'm going to mark this as resolved with "WORKSFORME". Feel free to reopen it if you're able to reproduce it with gcc 12 or later; thanks again for filing this. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug analyzer/106620] Incorrectly thinks execution can continue after a return statement 2022-08-15 8:55 [Bug analyzer/106620] New: Incorrectly thinks execution can continue after a return statement nrk at disroot dot org 2022-08-15 15:33 ` [Bug analyzer/106620] " dmalcolm at gcc dot gnu.org @ 2022-08-15 15:34 ` dmalcolm at gcc dot gnu.org 2022-08-16 2:06 ` nrk at disroot dot org 2 siblings, 0 replies; 4+ messages in thread From: dmalcolm at gcc dot gnu.org @ 2022-08-15 15:34 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106620 --- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> --- (In reply to David Malcolm from comment #1) > I've made lots of implementation changes to -fanalyzer in gcc 12 in beyond "and beyond", I meant to say ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug analyzer/106620] Incorrectly thinks execution can continue after a return statement 2022-08-15 8:55 [Bug analyzer/106620] New: Incorrectly thinks execution can continue after a return statement nrk at disroot dot org 2022-08-15 15:33 ` [Bug analyzer/106620] " dmalcolm at gcc dot gnu.org 2022-08-15 15:34 ` dmalcolm at gcc dot gnu.org @ 2022-08-16 2:06 ` nrk at disroot dot org 2 siblings, 0 replies; 4+ messages in thread From: nrk at disroot dot org @ 2022-08-16 2:06 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106620 --- Comment #3 from nrk at disroot dot org --- > Feel free to reopen it if you're able to reproduce it with gcc 12 or later Huh, I linked to godbolt specifically because I wanted to test gcc 12 and see if the bug still persists or not since my local version is at 11.2.1. But looks like I messed it up. In any case, thanks for fixing it! ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-16 2:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-08-15 8:55 [Bug analyzer/106620] New: Incorrectly thinks execution can continue after a return statement nrk at disroot dot org 2022-08-15 15:33 ` [Bug analyzer/106620] " dmalcolm at gcc dot gnu.org 2022-08-15 15:34 ` dmalcolm at gcc dot gnu.org 2022-08-16 2:06 ` nrk at disroot dot 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).