This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] Type inheritance graph analysis & speculative devirtualization, part 4/7, ODR at LTO time
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Aug 2013 20:03:22 +0200
- Subject: Re: [RFA] Type inheritance graph analysis & speculative devirtualization, part 4/7, ODR at LTO time
- Authentication-results: sourceware.org; auth=none
- References: <20130819140116 dot GA16575 at kam dot mff dot cuni dot cz>
Hi,
On Mon, Aug 19, 2013 at 04:01:16PM +0200, Jan Hubicka wrote:
[...]
>
> * Makefile.in (ipa-devirt.o): Add dependency on diagnostic.h
> * ipa-devirt.c: Include diganostic.h
> (odr_type_d): Add types and types_set.
> (hash_type_name): Work for types with vtables during LTO.
> (odr_hasher::remove): Fix comment; destroy types_set.
> (add_type_duplicate): New function,
> (get_odr_type): Use it.
> (dump_type_inheritance_graph): Dump type duplicates.
> * ipa.c (symtab_remove_unreachable_nodes): Build type inheritance
> graph.
> * tree.c (types_same_for_odr): Give exact answers on types with
> virtual tables.
[...]
> Index: ipa-devirt.c
> ===================================================================
> *** ipa-devirt.c (revision 201836)
> --- ipa-devirt.c (working copy)
> *************** static odr_hash_type odr_hash;
> *** 222,227 ****
> --- 251,382 ----
> static GTY(()) vec <odr_type, va_gc> *odr_types_ptr;
> #define odr_types (*odr_types_ptr)
>
> + /* TYPE is equivalent to VAL by ODR, but its tree representation differs
> + from VAL->type. This may happen in LTO where tree merging did not merge
> + all variants of the same type. It may or may not mean the ODR violation.
> + Add it to the list of duplicates and warn on some violations. */
> +
> + void
> + add_type_duplicate (odr_type val, tree type)
> + {
It seems the function can be made static. If not, it should probably
have a name that would be less prone to clashes.
Thanks,
Martin