PATCH: type attributes influence other types
Andrew Haley
aph@pasanda.cygnus.co.uk
Thu Sep 30 23:58:00 GMT 1999
> Date: Mon, 6 Sep 1999 14:27:00 -0700
> From: Richard Henderson <rth@cygnus.com>
>
> On Mon, Sep 06, 1999 at 03:43:40PM -0000, Andrew Haley wrote:
> > Mon Sep 6 15:31:59 1999 Andrew Haley <aph@cygnus.com>
> >
> > * tree.c (type_hash_lookup): Check for equal TYPE_ALIGN fields
> > when comparing types.
>
> Ok.
In testing I discovered that when compiling builtin functions gcc
assumes that alignment is *not* part of a function's type. Here is an
amended patch.
Andrew.
Mon Sep 6 15:31:59 1999 Andrew Haley <aph@cygnus.com>
* tree.c (type_hash_lookup): Check for equal TYPE_ALIGN fields
when comparing data types.
Index: gcc/tree.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/tree.c,v
retrieving revision 1.172.4.1
diff -c -2 -p -r1.172.4.1 tree.c
*** tree.c 1999/08/18 20:13:30 1.172.4.1
--- tree.c 1999/09/07 14:34:12
*************** type_hash_lookup (hashcode, type)
*** 3786,3789 ****
--- 3786,3793 ----
&& attribute_list_equal (TYPE_ATTRIBUTES (h->type),
TYPE_ATTRIBUTES (type))
+ /* Function types of differing alignment are isomorphic; data
+ types types of differing alignment are not. */
+ && (TREE_CODE (type) == FUNCTION_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),
More information about the Gcc-patches
mailing list