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)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org, Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Date: Sun, 29 Oct 2006 19:50:49 -0800
- Subject: Re: [PATCH] Fix endless recursion in make_vector_type (PR tree-opt/29637; 4. regression cause by PR c/29092 fix)
- References: <Pine.LNX.firstname.lastname@example.org>
Roger Sayle wrote:
On Sun, 29 Oct 2006, Jakub Jelinek wrote:
2006-10-29 Jakub Jelinek <email@example.com>
* tree.c (make_vector_type): Don't recurse if TYPE_MAIN_VARIANT
of the innertype is the innertype itself.
* gcc.dg/pr29637.c: New test.
Sorry for the inconvenience. This is OK for all active branches.
Whilst it isn't clear whether it'd be nice to always have a type
without attributes to the be the TYPE_MAIN_VARIANT, this change is
always safe, and resovles the regression.
I don't believe that invariant should hold, i.e., I think it reasonable
for the TYPE_MAIN_VARIANT to have attributes.
Following the proposed (and, apparently, generally agreeable) semantics
for attributes, something like:
typedef __attribute__((...)) int I;
makes "I" an entirely separate type from "int" if the attribute is
"semantic". Then, TYPE_MAIN_VARIANT of "const I" would be "I", but not
"int", and there is in general no non-attribute form of "I" that is "the
The question, I suppose, is what TYPE_MAIN_VARIANT means. What it
should mean (i.e., the way in which the compiler generally uses it at
present) is "a type like this one, but without top-level qualifiers, and
(Two types are the same if -- but *not* only if -- they have the same
top-level qualifiers and their TYPE_MAIN_VARIANTS are the same. The
"not only if" comes from things like two incomplete array types, which
then turn out to have the same number of elements.)
(650) 331-3385 x713