diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-08-20 00:20:05 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-08-20 00:20:05 +0000 |
commit | 3daca40f2e599700928087a829b6e2f3e3c85245 (patch) | |
tree | cff6b87cd32a17d2d4c54960b2087b9f13901596 /gcc/tree.c | |
parent | 7f51188660463d1a2097f7f5f74b9b0f8423567b (diff) | |
download | ppe42-gcc-3daca40f2e599700928087a829b6e2f3e3c85245.tar.gz ppe42-gcc-3daca40f2e599700928087a829b6e2f3e3c85245.zip |
(build_type_variant): Only return existing type if it
also has the same TYPE_NAME.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7954 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 068f2b73d04..7b8fb5182c6 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2802,19 +2802,14 @@ build_type_variant (type, constp, volatilep) constp = !!constp; volatilep = !!volatilep; - /* If not generating auxiliary info, search the chain of variants to see - if there is already one there just like the one we need to have. If so, - use that existing one. - - We don't do this in the case where we are generating aux info because - in that case we want each typedef names to get it's own distinct type - node, even if the type of this new typedef is the same as some other - (existing) type. */ - - if (!flag_gen_aux_info) - for (t = TYPE_MAIN_VARIANT(type); t; t = TYPE_NEXT_VARIANT (t)) - if (constp == TYPE_READONLY (t) && volatilep == TYPE_VOLATILE (t)) - return t; + /* Search the chain of variants to see if there is already one there just + like the one we need to have. If so, use that existing one. We must + preserve the TYPE_NAME, since there is code that depends on this. */ + + for (t = TYPE_MAIN_VARIANT(type); t; t = TYPE_NEXT_VARIANT (t)) + if (constp == TYPE_READONLY (t) && volatilep == TYPE_VOLATILE (t) + && TYPE_NAME (t) == TYPE_NAME (type)) + return t; /* We need a new one. */ |