Commit ba5ce70d by Richard Kenner

(c_build_type_variant): Don't change TYPE_MAIN_VARIANT of new type.

From-SVN: r7427
parent 7bc7696c
...@@ -1972,14 +1972,16 @@ c_build_type_variant (type, constp, volatilep) ...@@ -1972,14 +1972,16 @@ c_build_type_variant (type, constp, volatilep)
{ {
if (TREE_CODE (type) == ARRAY_TYPE) if (TREE_CODE (type) == ARRAY_TYPE)
{ {
tree real_main_variant = TYPE_MAIN_VARIANT (type);
push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type)); push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
type = build_array_type (c_build_type_variant (TREE_TYPE (type), type = build_array_type (c_build_type_variant (TREE_TYPE (type),
constp, volatilep), constp, volatilep),
TYPE_DOMAIN (type)); TYPE_DOMAIN (type));
TYPE_MAIN_VARIANT (type) = real_main_variant;
pop_obstacks (); pop_obstacks ();
/* If the old TYPE had variants, we lose them here. However,
since the new TYPE can be in the permanent obstack and the
old one may not be, preserving this chain would cause permanent
objects to point to non-permanent ones. */
} }
return build_type_variant (type, constp, volatilep); return build_type_variant (type, constp, volatilep);
} }
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