Commit e24fa534 by Jim Wilson

(build_type_variant): Only return existing type if it

also has the same TYPE_NAME.

From-SVN: r7954
parent b6d5307f
...@@ -2802,19 +2802,14 @@ build_type_variant (type, constp, volatilep) ...@@ -2802,19 +2802,14 @@ build_type_variant (type, constp, volatilep)
constp = !!constp; constp = !!constp;
volatilep = !!volatilep; volatilep = !!volatilep;
/* If not generating auxiliary info, search the chain of variants to see /* Search the chain of variants to see if there is already one there just
if there is already one there just like the one we need to have. If so, like the one we need to have. If so, use that existing one. We must
use that existing one. preserve the TYPE_NAME, since there is code that depends on this. */
We don't do this in the case where we are generating aux info because for (t = TYPE_MAIN_VARIANT(type); t; t = TYPE_NEXT_VARIANT (t))
in that case we want each typedef names to get it's own distinct type if (constp == TYPE_READONLY (t) && volatilep == TYPE_VOLATILE (t)
node, even if the type of this new typedef is the same as some other && TYPE_NAME (t) == TYPE_NAME (type))
(existing) type. */ return t;
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;
/* We need a new one. */ /* We need a new one. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment