public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Guenther <rguenther@suse.de>
Subject: Re: Turn complete to incomplete types in free_lang_data
Date: Fri, 26 Oct 2018 14:52:00 -0000	[thread overview]
Message-ID: <20181026140612.GB59378@kam.mff.cuni.cz> (raw)
In-Reply-To: <CAFiYyc1qNR8Ct+Xddu1-X5d9+k5fgYJyDwZ3qXE0bemU_PPa=w@mail.gmail.com>

> > OK if it survives more testing on firefox and lto bootstrap?
> 
> It looks like a hack to do free_lang_data_in_type from free_lang_data_in_decl
> walk - I remember you wanted to unify find_* and free_*?  If not doing that

I did try it :) There is a catch - free lang data calls langhooks to produce mangled
assembler names. For that the trees must be non-freed yet.
So you can't do freeing as you discover what trees to follow.

We can save one walk by computing assembler names during the discovery, but we
need to know all trees we want to do langhooks on before we start putting NULL
pointers around.

> why would first doing the type walk and only then the decl walk not work
> to avoid this ugliness?

Hmm, currently we first walk decl and then types,so swapping them woudl work.
But since I want to also simplify types in function types, it would break next.

> 
> That we need to have variants of the incomplete types at all for the place
> you substitute them (FIELD_DECLs) has what reason?  See also comments below...
> 
> We are getting more and more "interesting" in things we free.  _Please_ work on
> enabling free-lang-data (portions) for all compilations (with
> -fchecking?).  It's disturbing to see
> so much differences creep in in the supposedly "shared" part of regular and
> LTO compilation.

I wonder what is the plan to make late warnings to work reliably in this case?

> > +/* Do same comparsion as check_qualified_type skipping lang part of type
> > +   and be more permissive about type names: we only care that names are
> > +   same (for diagnostics) and that ODR names are the same.  */
> > +
> > +static bool
> > +types_equal_p (tree t, tree v)
> 
> The function name is of course totally misleading.  Please use sth like
> fld_type_variants_equal_p.
> 
> Note we already split check_qualified_type - can't you somehow re-use
> check_base_type (only)?

Hmm, you are right. I can re-unify those since this function basically cared
about ...
> 
> > +{
> > +  if (t==v)
> > +    return true;
> > +
> > +  if (TYPE_QUALS (t) != TYPE_QUALS (v))
> > +    return false;
> > +
> > +  if (TYPE_NAME (t) != TYPE_NAME (v)
> > +      && (!TYPE_NAME (t) || !TYPE_NAME (v)
> > +         || TREE_CODE (TYPE_NAME (t)) != TYPE_DECL
> > +         || TREE_CODE (TYPE_NAME (v)) != TYPE_DECL
> > +         || DECL_ASSEMBLER_NAME_RAW (TYPE_NAME (t))
> > +            != DECL_ASSEMBLER_NAME_RAW (TYPE_NAME (v))
> 
> I wonder what this is about...

... unmerged TYPE_NAMEs which happens only on WPA state. It is leftover of
my merging during streaming experiment.

I will clean this up and send updated patch.  I was bit in hurry leaving today
and wanted to send at least initial patch for discussion.

Honza

  reply	other threads:[~2018-10-26 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 12:49 Jan Hubicka
2018-10-26 14:06 ` Richard Biener
2018-10-26 14:52   ` Jan Hubicka [this message]
2018-10-30  9:42     ` Richard Biener
2018-10-30 10:11       ` Jan Hubicka
2018-10-29 11:04   ` Jan Hubicka
2018-10-30 15:20     ` Richard Biener
2018-10-30 19:49       ` Jan Hubicka

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=20181026140612.GB59378@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.com \
    /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).