From: Ilya Verbin <iverbin@gmail.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Jason Merrill <jason@redhat.com>,
Jakub Jelinek <jakub@redhat.com>,
gcc-patches@gcc.gnu.org, rguenther@suse.de
Subject: Re: Silence merge warnings on artificial types
Date: Thu, 02 Apr 2015 18:23:00 -0000 [thread overview]
Message-ID: <20150402182303.GA52553@msticlxl57.ims.intel.com> (raw)
In-Reply-To: <20150331075121.GB62830@kam.mff.cuni.cz>
On Tue, Mar 31, 2015 at 09:51:21 +0200, Jan Hubicka wrote:
> this patch adds the ARTIFICIAL flag check to avoid ODR merging to these.
> I oriignally tested DECL_ARTIFICIAL (decl) (that is TYPE_NAME) that randomly
> dropped type names on some classes but not all.
>
> Jason, please do you know what is meaning of DECL_ARTIFICIAL on class type
> names? Perhaps we can drop them to 0 in free lang data?
>
> With this bug I triggered wrong devirtualization because we no longer insert
> non-odr types into a type inheritance graph. This is fixed by the lto_read_decls
> change and finally I triggered an ICE in ipa-devirt that due to the bug
> output a warning late and ICEd on streamer cache being NULL. I guess it is
> better to guard it even though all wanrings should be output early.
>
> Bootsrapped/regtested x86_64-linux, will commit it after chromium rebuild.
>
> Honza
>
> * tree.c (need_assembler_name_p): Artificial types have no ODR
> names.
> * ipa-devirt.c (warn_odr): Do not try to apply ODR cache when
> no caching is done.
>
> * lto.c (lto_read_decls): Move code registering odr types out
> of TYPE_CANONICAL conditional and also register polymorphic types.
> Index: tree.c
> ===================================================================
> --- tree.c (revision 221777)
> @@ -5139,6 +5145,7 @@ need_assembler_name_p (tree decl)
> && decl == TYPE_NAME (TREE_TYPE (decl))
> && !is_lang_specific (TREE_TYPE (decl))
> && AGGREGATE_TYPE_P (TREE_TYPE (decl))
> + && !TYPE_ARTIFICIAL (TREE_TYPE (decl))
> && !variably_modified_type_p (TREE_TYPE (decl), NULL_TREE)
> && !type_in_anonymous_namespace_p (TREE_TYPE (decl)))
> return !DECL_ASSEMBLER_NAME_SET_P (decl);
Hmm, libgomp.c++/target-3.C still fails.
Here is what I see in need_assembler_name_p:
<type_decl 0x2b5a8751aed8 .omp_data_s.3
type <record_type 0x2b5a87536690 .omp_data_s.3 BLK
size <integer_cst 0x2b5a873ce318 constant 192>
unit size <integer_cst 0x2b5a873ce2e8 constant 24>
align 64 symtab 0 alias set -1 canonical type 0x2b5a87536690
fields <field_decl 0x2b5a87537000 b.0 type <pointer_type 0x2b5a87536150>
unsigned DI file test.cpp line 8 col 13
size <integer_cst 0x2b5a873ace58 constant 64>
unit size <integer_cst 0x2b5a873ace70 constant 8>
align 64 offset_align 128
offset <integer_cst 0x2b5a873ace88 constant 0>
bit offset <integer_cst 0x2b5a873aced0 constant 0> context <record_type 0x2b5a87536690 .omp_data_s.3> chain <field_decl 0x2b5a87537098 s>> reference_to_this <reference_type 0x2b5a87536738>>
VOID file test.cpp line 11 col 13
align 1>
(TYPE_ARTIFICIAL = 0)
<type_decl 0x2b5a8751a850 .omp_data_s.3
type <record_type 0x2b5a8752cdc8 .omp_data_s.3 BLK
size <integer_cst 0x2b5a873ce318 constant 192>
unit size <integer_cst 0x2b5a873ce2e8 constant 24>
align 64 symtab 0 alias set -1 canonical type 0x2b5a8752cdc8
fields <field_decl 0x2b5a8751a980 b.0 type <pointer_type 0x2b5a8752c498>
unsigned DI file test.cpp line 8 col 13
size <integer_cst 0x2b5a873ace58 constant 64>
unit size <integer_cst 0x2b5a873ace70 constant 8>
align 64 offset_align 128
offset <integer_cst 0x2b5a873ace88 constant 0>
bit offset <integer_cst 0x2b5a873aced0 constant 0> context <record_type 0x2b5a8752cdc8 .omp_data_s.3> chain <field_decl 0x2b5a8751a8e8 s>>
pointer_to_this <pointer_type 0x2b5a87536888>>
VOID file test.cpp line 11 col 13
align 1>
(TYPE_ARTIFICIAL = 0)
-- Ilya
next prev parent reply other threads:[~2015-04-02 18:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 3:03 Silence merge warnings on artiical types Jan Hubicka
2015-03-30 8:30 ` Richard Biener
2015-03-30 8:48 ` Jan Hubicka
2015-03-30 15:36 ` Ilya Verbin
2015-03-30 17:06 ` Jan Hubicka
2015-03-30 17:11 ` Ilya Verbin
2015-03-30 17:16 ` Jan Hubicka
2015-03-30 17:21 ` Jakub Jelinek
2015-03-30 17:23 ` Jan Hubicka
2015-03-30 17:53 ` Jason Merrill
2015-03-31 7:51 ` Silence merge warnings on artificial types Jan Hubicka
2015-03-31 13:26 ` Jason Merrill
2015-04-02 18:23 ` Ilya Verbin [this message]
2015-04-02 18:37 ` Jan Hubicka
2015-04-02 19:06 ` Jakub Jelinek
2015-04-03 13:36 ` Jakub Jelinek
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=20150402182303.GA52553@msticlxl57.ims.intel.com \
--to=iverbin@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=jakub@redhat.com \
--cc=jason@redhat.com \
--cc=rguenther@suse.de \
/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).