This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix endless recursion in make_vector_type (PR tree-opt/29637; 4. 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,
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:
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.
(650) 331-3385 x713