From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13344 invoked by alias); 16 Oct 2017 06:49:51 -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 13334 invoked by uid 89); 16 Oct 2017 06:49:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=fastest, claim X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Oct 2017 06:49:49 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 98C87AAAD; Mon, 16 Oct 2017 06:49:46 +0000 (UTC) Date: Mon, 16 Oct 2017 06:53:00 -0000 User-Agent: K-9 Mail for Android In-Reply-To: <3e7ecb64-cd96-47a3-cb75-53e41317d90c@acm.org> References: <3e7ecb64-cd96-47a3-cb75-53e41317d90c@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH PR/82546] tree node size To: Nathan Sidwell ,GCC Patches ,Jeff Law From: Richard Biener Message-ID: <73AFE619-57E8-4944-ADB7-0D1AC9118E34@suse.de> X-SW-Source: 2017-10/txt/msg00961.txt.bz2 On October 13, 2017 8:29:40 PM GMT+02:00, Nathan Sidwell w= rote: >[Although I filed this as a middle-end bug, it's really a core infra=20 >bug, not sure who the best reviewer is] > >In working on tree streaming in the modules branch, I discovered poor=20 >tree node size and hierarchy bits. > >Here's a fix for the first part of that. tree.c (tree_code_size)=20 >returns sizeof (tree_type_non_common) for any tcc_type node. That's=20 >wasteful, given we have tree_type_common->=20 >tree_type_with_lang_specific-> tree_type_non_common available as=20 >choices. It's also obscuring defects in (at least) the c++ FE where we > >use tree_type_non_common fields, but claim the node doesn't contain >that=20 >structure. Ew. > >This patch makes tree_code_size ask the lang hook for the size of=20 >non-core type nodes. It also fixes the c++ and objc FEs to return a=20 >size for the nodes it cares about. > >I don't (yet) know whether all the core types are tree_type_non_common, > >nor whether the FE's can return smaller sizes than the do with this=20 >patch. But at least the control flow is now correct. during >developing=20 >this patch I added an assert that the lang hook was returning a size at > >least as big as tree_type_non_common, so they couldn't be more broken=20 >than before the patch. > >I intend to continue cleaning this up of course. It's not clear to me=20 >whether we should cache these node sizes in an array, and the way it=20 >goes about checking nodes with nested switches is understandable, but=20 >possible not the fastest solution. However let's at least get the >sizing=20 >right first. We were conservative exactly to avoid the langhook here. I think there's si= milar 'bug' on the decl side.=20 Richard.=20 >ok? > >nathan