This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: type attributes influence other types
- To: rth at cygnus dot com
- Subject: Re: PATCH: type attributes influence other types
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 10 Sep 1999 15:50:56 -0000
- CC: gcc-patches at gcc dot gnu dot org
> Date: Thu, 9 Sep 1999 17:11:46 -0700
> From: Richard Henderson <rth@cygnus.com>
>
> This makes sense to me. If we're going to use the values
> set up by layout_type, we've got to compute them first.
>
> Calling layout_type conditionally isn't even necessary, since
> layout_type itself knows when it's been done before. I can't
> even believe this happens enough to make optimizing around
> the duplicate call necessary.
Righto.
Fri Sep 10 16:48:26 1999 Andrew Haley <aph@cygnus.com>
* tree.c (type_hash_lookup): Check for equal TYPE_ALIGN fields
when comparing types; this requires the type to have been laid
out, so call layout_type() first.
Index: tree.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/tree.c,v
retrieving revision 1.84
diff -p -r1.84 tree.c
*** tree.c 1999/09/10 10:35:48 1.84
--- tree.c 1999/09/10 15:45:15
*************** type_hash_lookup (hashcode, type)
*** 3673,3684 ****
--- 3673,3688 ----
tree type;
{
register struct type_hash *h;
+
+ layout_type (type);
+
for (h = type_hash_table[hashcode % TYPE_HASH_SIZE]; h; h = h->next)
if (h->hashcode == hashcode
&& TREE_CODE (h->type) == TREE_CODE (type)
&& TREE_TYPE (h->type) == TREE_TYPE (type)
&& attribute_list_equal (TYPE_ATTRIBUTES (h->type),
TYPE_ATTRIBUTES (type))
+ && TYPE_ALIGN (h->type) == TYPE_ALIGN (type)
&& (TYPE_MAX_VALUE (h->type) == TYPE_MAX_VALUE (type)
|| tree_int_cst_equal (TYPE_MAX_VALUE (h->type),
TYPE_MAX_VALUE (type)))