aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index e0e9d8d..98896f8 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -12542,4 +12542,23 @@ get_tree_code_name (enum tree_code code)
return tree_code_name[code];
}
+/* Drops the TREE_OVERFLOW flag from T. */
+
+tree
+drop_tree_overflow (tree t)
+{
+ gcc_checking_assert (TREE_OVERFLOW (t));
+
+ /* For tree codes with a sharing machinery re-build the result. */
+ if (TREE_CODE (t) == INTEGER_CST)
+ return build_int_cst_wide (TREE_TYPE (t),
+ TREE_INT_CST_LOW (t), TREE_INT_CST_HIGH (t));
+
+ /* Otherwise, as all tcc_constants are possibly shared, copy the node
+ and drop the flag. */
+ t = copy_node (t);
+ TREE_OVERFLOW (t) = 0;
+ return t;
+}
+
#include "gt-tree.h"