public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/94105] ICE in get_region, at analyzer/region-model.h:1744
Date: Sun, 15 Mar 2020 12:02:15 +0000	[thread overview]
Message-ID: <bug-94105-4-QMwZE6NrBJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94105-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
commit r10-7168-g5c048755ec98645f8436b630df3f9294ca9cbc2a
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Mar 10 19:03:37 2020 -0400

    analyzer: handle NOP_EXPR in get_lvalue [PR94099,PR94105]

    PR analyzer/94099 and PR analyzer/94105 both report ICEs relating to
    calling region_model::get_lvalue on a NOP_EXPR.

    PR analyzer/94099's ICE happens when generating a checker_path when
    encountering an unhandled tree code (NOP_EXPR) in get_lvalue with a
    NULL context (from for_each_state_change).

    PR analyzer/94105 ICE happens when handling an ARRAY_REF where the
    first operand is a NOP_EXPR: the unhandled tree code gives us
    a symbolic_region, but the case for ARRAY_REF assumes we have an
    array_region.

    This patch fixes the ICEs by handling NOP_EXPR within
    region_model::get_lvalue, and bulletproofs both of the above sources
    of failure.

    gcc/analyzer/ChangeLog:
            PR analyzer/94099
            PR analyzer/94105
            * diagnostic-manager.cc (for_each_state_change): Bulletproof
            against errors in get_rvalue by passing a
            tentative_region_model_context and rejecting if there's an error.
            * region-model.cc (region_model::get_lvalue_1): When handling
            ARRAY_REF, handle results of error-handling.  Handle NOP_EXPR.

    gcc/testsuite/ChangeLog:
            PR analyzer/94099
            PR analyzer/94105
            * gcc.dg/analyzer/pr94099.c: New test.
            * gcc.dg/analyzer/pr94105.c: New test.

      parent reply	other threads:[~2020-03-15 12:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 18:43 [Bug analyzer/94105] New: " asolokha at gmx dot com
2020-03-10  8:52 ` [Bug analyzer/94105] " marxin at gcc dot gnu.org
2020-03-13 23:11 ` dmalcolm at gcc dot gnu.org
2020-03-15 12:02 ` marxin at gcc dot gnu.org [this message]

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-94105-4-QMwZE6NrBJ@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).