From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109445 invoked by alias); 20 Dec 2018 14:20:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 108651 invoked by uid 89); 20 Dec 2018 14:20:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=H*UA:https, Hx-languages-length:1105, bootstrapping X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Dec 2018 14:20:26 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8D4A9ACA9 for ; Thu, 20 Dec 2018 14:20:23 +0000 (UTC) From: Martin Jambor To: GCC Patches Cc: Subject: Re: [PR 88214] Check that an argument is pointer before attempting agg jf construction from it In-Reply-To: References: User-Agent: Notmuch/0.26 (https://notmuchmail.org) Emacs/26.1 (x86_64-suse-linux-gnu) Date: Thu, 20 Dec 2018 14:21:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01464.txt.bz2 Hi, On Mon, Dec 10 2018, Richard Biener wrote: > On Fri, Dec 7, 2018 at 3:59 PM Martin Jambor wrote: >> ... >> >> On a related note, would people object to adding the following assert, >> which would have made this bug much more straightforward to find? > > That's fine with me. Thanks, I have just committed the following as r267298 after bootstrapping and testing it on x86_64-linux. Martin 2018-12-20 Martin Jambor PR ipa/88214 * tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Assert that ptr is a pointer. --- gcc/tree-ssa-alias.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 85a5de7ce05..66cf2f2c669 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -710,6 +710,7 @@ ao_ref_init_from_ptr_and_size (ao_ref *ref, tree ptr, tree size) } else { + gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr))); ref->base = build2 (MEM_REF, char_type_node, ptr, null_pointer_node); ref->offset = 0; -- 2.19.2