This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: PATCH: type attributes influence other types


> 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)))


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