summaryrefslogtreecommitdiffstats
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-26 17:47:48 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-26 17:47:48 +0000
commit170d361e1530b73097ec5c24e88f5ee27e892e4f (patch)
treef723e62fba44367868ca69c568eb0c1239b6f03e /gcc/ada/gcc-interface/utils.c
parenta06b7970582a546a28bf6b7ac12d43e8c2814d2f (diff)
downloadppe42-gcc-170d361e1530b73097ec5c24e88f5ee27e892e4f.tar.gz
ppe42-gcc-170d361e1530b73097ec5c24e88f5ee27e892e4f.zip
* gcc-interface/utils.c (copy_type): Unshare the language-specific data
and the contents of the language-specific slot if needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154678 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 4d1cd97e9dc..38795a0cea6 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1157,6 +1157,23 @@ copy_type (tree 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
aliased with TREE_CHAIN. */
TYPE_STUB_DECL (new_type) = TYPE_STUB_DECL (type);
OpenPOWER on IntegriCloud