Commit 90dcfecb by Eric Botcazou Committed by Eric Botcazou

utils.c (copy_type): Unshare the language-specific data and the contents of the…

utils.c (copy_type): Unshare the language-specific data and the contents of the language-specific...

	* gcc-interface/utils.c (copy_type): Unshare the language-specific data
	and the contents of the language-specific slot if needed.

From-SVN: r154678
parent da49a783
2009-11-26 Eric Botcazou <ebotcazou@adacore.com> 2009-11-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (copy_type): Unshare the language-specific data
and the contents of the language-specific slot if needed.
2009-11-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gnat_to_gnu) <N_In>: Set the source location * gcc-interface/trans.c (gnat_to_gnu) <N_In>: Set the source location
of the operator on both branches of the test in the generic case. of the operator on both branches of the test in the generic case.
......
...@@ -1157,6 +1157,23 @@ copy_type (tree type) ...@@ -1157,6 +1157,23 @@ copy_type (tree type)
{ {
tree new_type = copy_node (type); tree new_type = copy_node (type);
/* Unshare the language-specific data. */
if (TYPE_LANG_SPECIFIC (type))
{
TYPE_LANG_SPECIFIC (new_type) = NULL;
SET_TYPE_LANG_SPECIFIC (new_type, GET_TYPE_LANG_SPECIFIC (type));
}
/* And the contents of the language-specific slot if needed. */
if ((INTEGRAL_TYPE_P (type) || TREE_CODE (type) == REAL_TYPE)
&& TYPE_RM_VALUES (type))
{
TYPE_RM_VALUES (new_type) = NULL_TREE;
SET_TYPE_RM_SIZE (new_type, TYPE_RM_SIZE (type));
SET_TYPE_RM_MIN_VALUE (new_type, TYPE_RM_MIN_VALUE (type));
SET_TYPE_RM_MAX_VALUE (new_type, TYPE_RM_MAX_VALUE (type));
}
/* copy_node clears this field instead of copying it, because it is /* copy_node clears this field instead of copying it, because it is
aliased with TREE_CHAIN. */ aliased with TREE_CHAIN. */
TYPE_STUB_DECL (new_type) = TYPE_STUB_DECL (type); TYPE_STUB_DECL (new_type) = TYPE_STUB_DECL (type);
......
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