This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: Ensure TREE_TYPE (TYPE_MIN_VALUE (t)) == t
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: dnovillo at redhat dot com, gcc-patches at gcc dot gnu dot org, iant at google dot com, rguenther at suse dot de
- Date: Fri, 27 Apr 2007 18:12:43 EDT
- Subject: Re: PATCH RFC: Ensure TREE_TYPE (TYPE_MIN_VALUE (t)) == t
- References: <m3vefh3dm9.fsf@localhost.localdomain> <20070427220712.GB16083@redhat.com>
I'd say that this is a bug in the same way that any other
> direct type comparison is flawed. I'd suggest that
>
> TYPE_MAIN_VARIANT (TREE_TYPE (TYPE_MIN_VALUE (t)))
> == TYPE_MAIN_VARIANT (t)
>
> is the correct test. That certainly handles your typedef case.
I forgot about TYPE_MAIN_VARIANT and you forgot about subtypes!