This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C frontend] Fix construction of TYPE_STUB_DECL


On 05/21/2015 04:32 PM, Jan Hubicka wrote:
I think at LTO time it is useful to have two things
   - be able to say what type comply C++ ODR rule, because we special case these
     for ODR warnings
   - be able to say at LTO time what types are anonymous, that is they are not
     compatible with any type from other unit.

...where the second group is a subset of the first; in languages that use structural compatibility, anonymous types can be compatible.

Either a special flag TYPE_ODR_P set by C++ FE on all types that comply ODR rule
or making TYPE_PUBLIC (TYPE_STUB_DECL (t)) to reliably identify that type is
anonymous (or an equivalent) would fix the two issues.

It seems that we've been establishing which types have linkage by setting their DECL_ASSEMBLER_NAME. It seems that the problem is coming from leaving it unset for types with internal (anonymous) linkage, so you're trying to check TREE_PUBLIC instead, which breaks with other front ends. Perhaps we should set DECL_ASSEMBLER_NAME for internal C++ types to some magic value?

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]