From patchwork Thu Jul 10 09:50:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 368550 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6663D140143 for ; Thu, 10 Jul 2014 19:50:59 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=Z+peFPSeG/X8eJkr 91mGrBKZsJNLNx/x7Gs5FS0ybbknwFy1SqmU3dN4o0aibJ+CIAxQu+w+/TZVxbX7 XOXFKZrkJm8gTmVW8gcQtNysYiaSpTnFZ9MIHRbVvyR7Ua5hn2EQrBeep+4Whr8Q 4Zw2v7YYl6uqcI9YsdYenIOYNKI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=/EXbLr36tP63VWFyanXgI9 5gjKw=; b=wf7r9NeK/FF3TAEa7l1iGW1Gxj4fs7FjMLKNCGLbwueo7oIt9pvObR yWDYfpz/ZdLH6XsI9YhwdvI4+wJNa2S4zYhmA9Kln//pHZqZca/ehit7HILui5LF URZSq4Xp2bQJp9XKULtyv3Jh7Q/eGm0Vh899KwuhsGDV0iDHhHXGw= Received: (qmail 24126 invoked by alias); 10 Jul 2014 09:50:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24078 invoked by uid 89); 10 Jul 2014 09:50:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Jul 2014 09:50:26 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1X5Azc-0006Z7-6i from Thomas_Schwinge@mentor.com ; Thu, 10 Jul 2014 02:50:20 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 10 Jul 2014 02:50:20 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 10 Jul 2014 10:50:18 +0100 From: Thomas Schwinge To: Jan Hubicka CC: , , Subject: Re: Move DECL_VINDEX and DECL_SAVED_TREE into function_decl In-Reply-To: <20140623202541.GA21820@kam.mff.cuni.cz> References: <20140623202541.GA21820@kam.mff.cuni.cz> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Thu, 10 Jul 2014 11:50:06 +0200 Message-ID: <87egxtr19t.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Mon, 23 Jun 2014 22:25:41 +0200, Jan Hubicka wrote: > this patch makes DECL_VINDEX and DECL_SAVED_TREE to be FUNCTION_DECL only. > Bootstrapped/regtested x86_64-linux, OK? ... without --enable-checking=fold. ;-P > * class.c (check_methods, create_vtable_ptr, determine_key_method, > add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by FUNCTION_DECL check. > * cp-tree.h (lang_decl_ns): Add ns_using and ns_users. > (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns. > (DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL. > (DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT. > * tree.c (find_decls_types_r): Do not check DECL_VINDEX for TYPE_DECL. > * tree.h (DECL_VINDEX, DECL_SAVED_TREE): Restrict to DECL_FUNCTION. > * tree-core.h (tree_decl_non_common): Move saved_tree and vindex... > (tree_function_decl): ... here. > * tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): Move > streaming of vindex to ... > (write_ts_function_decl_tree_pointers): ... here. > > * tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers): > Do not stream DECL_VINDEX. > (lto_input_ts_function_decl_tree_pointers): Stream it here. > > * lto.c (mentions_vars_p_decl_non_common): Move DECL_VINDEX check to .. > (mentions_vars_p_function): ... here. > (compare_tree_sccs_1): Update VINDEX checks. > (lto_fixup_prevailing_decls): Likewise. I'm seeing ICEs: »tree check: expected function_decl, have type_decl in fold_checksum_tree, at fold-const.c:14861«. Is the following the correct fix, or should this be done differently? Grüße, Thomas --- gcc/fold-const.c +++ gcc/fold-const.c @@ -14858,7 +14858,8 @@ fold_checksum_tree (const_tree expr, struct md5_ctx *ctx, if (CODE_CONTAINS_STRUCT (TREE_CODE (expr), TS_DECL_NON_COMMON)) { - fold_checksum_tree (DECL_VINDEX (expr), ctx, ht); + if (TREE_CODE (expr) == FUNCTION_DECL) + fold_checksum_tree (DECL_VINDEX (expr), ctx, ht); fold_checksum_tree (DECL_RESULT_FLD (expr), ctx, ht); fold_checksum_tree (DECL_ARGUMENT_FLD (expr), ctx, ht); }