This is the mail archive of the 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: [PATCH] Fix endless recursion in make_vector_type (PR tree-opt/29637; 4.[0123] regression cause by PR c/29092 fix)

Richard Kenner wrote:
I don't believe that invariant should hold, i.e., I think it reasonable for the TYPE_MAIN_VARIANT to have attributes.

The question, I suppose, is what TYPE_MAIN_VARIANT means.

Indeed, I think that's the question. If you have two variants of the same type, each with different attributes, how do you pick which one is "main"?

If those are semantic attributes, you don't; they're different, unrelated types.

To me, that argues that TYPE_MAIN_VARIANT should be a type that has
*none* of the "qualifications" of the type.  One could perhaps argue
that type attributes shouldn't merely be variants, but I think as long
as they are, then we should have a TYPE_MAIN_VARIANT that's easily
distinguishable, meaning it has no qualifiers.

The fact that "semantic" type attributes are variants is a bug, precisely because it then causes the compiler to think that two types with different semantic attributes are the same. For example:

__aligned__((16)) int

is not a variant of int; it's a subtype. You can use that type where you could use an "int", but not vice versa.

See the earlier thread on semantics for attributes.

Mark Mitchell
(650) 331-3385 x713

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