From: Richard Biener <rguenther@suse.de>
To: Nathan Sidwell <nathan@acm.org>,GCC Patches
<gcc-patches@gcc.gnu.org>,Jeff Law <law@redhat.com>
Subject: Re: [PATCH PR/82546] tree node size
Date: Mon, 16 Oct 2017 06:53:00 -0000 [thread overview]
Message-ID: <73AFE619-57E8-4944-ADB7-0D1AC9118E34@suse.de> (raw)
In-Reply-To: <3e7ecb64-cd96-47a3-cb75-53e41317d90c@acm.org>
On October 13, 2017 8:29:40 PM GMT+02:00, Nathan Sidwell <nathan@acm.org> wrote:
>[Although I filed this as a middle-end bug, it's really a core infra
>bug, not sure who the best reviewer is]
>
>In working on tree streaming in the modules branch, I discovered poor
>tree node size and hierarchy bits.
>
>Here's a fix for the first part of that. tree.c (tree_code_size)
>returns sizeof (tree_type_non_common) for any tcc_type node. That's
>wasteful, given we have tree_type_common->
>tree_type_with_lang_specific-> tree_type_non_common available as
>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
>structure. Ew.
>
>This patch makes tree_code_size ask the lang hook for the size of
>non-core type nodes. It also fixes the c++ and objc FEs to return a
>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
>patch. But at least the control flow is now correct. during
>developing
>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
>than before the patch.
>
>I intend to continue cleaning this up of course. It's not clear to me
>whether we should cache these node sizes in an array, and the way it
>goes about checking nodes with nested switches is understandable, but
>possible not the fastest solution. However let's at least get the
>sizing
>right first.
We were conservative exactly to avoid the langhook here. I think there's similar 'bug' on the decl side.
Richard.
>ok?
>
>nathan
next prev parent reply other threads:[~2017-10-16 6:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 18:32 Nathan Sidwell
2017-10-16 6:53 ` Richard Biener [this message]
2017-10-16 10:47 ` Nathan Sidwell
2017-10-17 9:27 ` Richard Biener
2017-10-17 14:18 ` Nathan Sidwell
2017-10-17 14:29 ` Richard Biener
2017-10-18 10:06 ` Olivier Hainque
2017-10-18 14:03 ` Eric Botcazou
2017-10-19 7:17 ` Olivier Hainque
2017-10-17 19:31 ` Unbreak Ada bootstrap (was Re: [PATCH PR/82546] tree node size) Jakub Jelinek
2017-10-17 20:09 ` Richard Biener
2017-10-17 20:21 ` Eric Botcazou
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=73AFE619-57E8-4944-ADB7-0D1AC9118E34@suse.de \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
--cc=nathan@acm.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).