public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/113253] gcc -g causes -fanalyzer to issue false positive
Date: Wed, 31 Jan 2024 23:28:26 +0000	[thread overview]
Message-ID: <bug-113253-4-tZaln16IwW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113253-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:cc7aebff74d8967563fd9af5cb958dfcc8c111e8

commit r14-8670-gcc7aebff74d8967563fd9af5cb958dfcc8c111e8
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Wed Jan 31 18:26:26 2024 -0500

    analyzer: fix skipping of debug stmts [PR113253]

    PR analyzer/113253 reports a case where the analyzer output varied
    with and without -g enabled.

    The root cause was that debug stmts were in the
    FOR_EACH_IMM_USE_FAST list for SSA names, leading to the analyzer's
    state purging logic differing between the -g and non-debugging cases,
    and thus leading to differences in the exploration of the user's code.

    Fix by skipping such stmts in the state-purging logic, and removing
    debug stmts when constructing the supergraph.

    gcc/analyzer/ChangeLog:
            PR analyzer/113253
            * region-model.cc (region_model::on_stmt_pre): Add gcc_unreachable
            for debug statements.
            * state-purge.cc
            (state_purge_per_ssa_name::state_purge_per_ssa_name): Skip any
            debug stmts in the FOR_EACH_IMM_USE_FAST list.
            * supergraph.cc (supergraph::supergraph): Don't add debug stmts
            to the supernodes.

    gcc/testsuite/ChangeLog:
            PR analyzer/113253
            * gcc.dg/analyzer/deref-before-check-pr113253.c: New test.

    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

  parent reply	other threads:[~2024-01-31 23:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-06 19:08 [Bug analyzer/113253] New: " eggert at cs dot ucla.edu
2024-01-31 16:26 ` [Bug analyzer/113253] " dmalcolm at gcc dot gnu.org
2024-01-31 16:26 ` dmalcolm at gcc dot gnu.org
2024-01-31 19:07 ` dmalcolm at gcc dot gnu.org
2024-01-31 23:28 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-31 23:34 ` dmalcolm at gcc dot gnu.org
2024-04-14  5:03 ` [Bug analyzer/113253] [11/12/13 Regression] " pinskia at gcc dot gnu.org
2024-05-09 17:12 ` cvs-commit at gcc dot gnu.org
2024-05-09 17:50 ` [Bug analyzer/113253] [11/12 " dmalcolm 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-113253-4-tZaln16IwW@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).