From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 536DB3954C62; Tue, 28 Apr 2020 17:26:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 536DB3954C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588094805; bh=huwTMfS4b6z1jKN/plszz/dXaAhHcccL43QIJl4J6sA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Tjb9kCKYwJ0UcZInCE7qq5orGyW7TlDXUPDApzSyUwjZ5Jr8SaIMqhE9asDSJWWLD hXXOrWmNtztEER9uipm3az1ZX1fWVYINfQIWcwSpLRSmZhflSQ76TNATLN3um5B8GA WEk7Gis5mga2h0u5UUNPCjJyLw3zsflo38MhPSf4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3 Date: Tue, 28 Apr 2020 17:26:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2020 17:26:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94816 --- Comment #2 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:5eae0ac76dcb6aac1d1d6c4edd8852e0035792e4 commit r10-8015-g5eae0ac76dcb6aac1d1d6c4edd8852e0035792e4 Author: David Malcolm Date: Tue Apr 28 10:52:45 2020 -0400 analyzer: fix ICE copying struct [PR 94816] PR analyzer/94816 reports an ICE when attempting to copy a struct containing a field for which add_region_for_type for fails (on an OFFSET_TYPE): the region for the src field comes from make_region_for_unexpected_tree_code which gives it a NULL type, and then the copy calls add_region_for_type which unconditionally dereferences the NULL type. This patch fixes the ICE by checking for NULL types in add_region_for_type. gcc/analyzer/ChangeLog: PR analyzer/94816 * engine.cc (impl_region_model_context::on_unexpected_tree_code= ): Handle NULL tree. * region-model.cc (region_model::add_region_for_type): Handle NULL type. * region-model.h (test_region_model_context::on_unexpected_tree_code): Handle NU= LL tree. gcc/testsuite/ChangeLog: PR analyzer/94816 * g++.dg/analyzer/pr94816.C: New test.=