diff options
author | Richard Guenther <rguenther@suse.de> | 2010-09-10 13:44:07 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-09-10 13:44:07 +0000 |
commit | 8c4353b7c50bc8855a0abdd9d9514477de715a33 (patch) | |
tree | 95b9637b447d189f3b6b054784820287a5fe2aa4 /gcc/c-decl.c | |
parent | a7c764a96ca48293b863196a073eb119453e1a3b (diff) | |
download | gcc-8c4353b7c50bc8855a0abdd9d9514477de715a33.tar.gz |
tree.c (type_hash_eq): For ARRAY_TYPEs also compare TYPE_SIZE.
2010-09-10 Richard Guenther <rguenther@suse.de>
* tree.c (type_hash_eq): For ARRAY_TYPEs also compare
TYPE_SIZE.
(build_index_type): Implement in terms of build_range_type.
(build_range_type): Do not allow NULL_TREE type, improve
hashing to cover more cases. Set TYPE_STRUCTURAL_EQUALITY_P
if we didn't hash.
* c-decl.c (grokdeclarator): When modifying TYPE_SIZE manually
create a distinct copy of the type.
From-SVN: r164174
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index c7babb54fff..03836b5e644 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5458,6 +5458,7 @@ grokdeclarator (const struct c_declarator *declarator, if (size && integer_zerop (size)) { gcc_assert (itype); + type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); TYPE_SIZE (type) = bitsize_zero_node; TYPE_SIZE_UNIT (type) = size_zero_node; SET_TYPE_STRUCTURAL_EQUALITY (type); @@ -5466,6 +5467,7 @@ grokdeclarator (const struct c_declarator *declarator, { gcc_assert (itype); /* The type is complete. C99 6.7.5.2p4 */ + type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); TYPE_SIZE (type) = bitsize_zero_node; TYPE_SIZE_UNIT (type) = size_zero_node; SET_TYPE_STRUCTURAL_EQUALITY (type); |