This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Using One Definition Rule for types during LTO devirtualizatoin?
- From: Jason Merrill <jason at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, mjambor at suse dot de
- Date: Mon, 17 Jun 2013 09:01:03 -0400
- Subject: Re: [RFC] Using One Definition Rule for types during LTO devirtualizatoin?
- References: <20130617100510 dot GB3276 at kam dot mff dot cuni dot cz>
On 06/17/2013 06:05 AM, Jan Hubicka wrote:
It is my understanding that C++ standard enforces one definition rule for
types, too (to enable sane mangling?) and that we can basically match types
by their name and contextes (namespaces/outer classes)?
Yes. Also for template instantiations and inline functions (basically,
decls with TREE_COMDAT set). That isn't very interesting for devirt,
but we might want to handle it in decls_same_for_odr anyway.
Also, it would be really nice to warn about ODR violations: types/decls
that are the same for ODR but are structurally different.
+ This is non-trivial for LTO where minnor differences in
"minor"
+ /* If types are not structuraly same, do not bother to contnue.
"structurally" "continue"
Jason