diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-24 20:19:36 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-24 20:19:36 +0000 |
commit | bfc01d2443742aaf5d0a1a770804d46c6db2bcb1 (patch) | |
tree | 89c073f6216329698dde15b2256c05fc2dccd7b4 /gcc/tree-inline.c | |
parent | b253c2668fdabbcd395bce075f95dca71af5a88d (diff) | |
download | gcc-bfc01d2443742aaf5d0a1a770804d46c6db2bcb1.tar.gz |
* tree-inline.c (copy_body_r): Explicitly copy a constant if the
type will be remapped.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91192 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 82a6a92a377..a6629895b43 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -516,6 +516,25 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data) else if (TYPE_P (*tp)) *tp = remap_type (*tp, id); + /* If this is a constant, we have to copy the node iff the type will be + remapped. copy_tree_r will not copy a constant. */ + else if (TREE_CODE_CLASS (TREE_CODE (*tp)) == tcc_constant) + { + tree new_type = remap_type (TREE_TYPE (*tp), id); + + if (new_type == TREE_TYPE (*tp)) + *walk_subtrees = 0; + + else if (TREE_CODE (*tp) == INTEGER_CST) + *tp = build_int_cst_wide (new_type, TREE_INT_CST_LOW (*tp), + TREE_INT_CST_HIGH (*tp)); + else + { + *tp = copy_node (*tp); + TREE_TYPE (*tp) = new_type; + } + } + /* Otherwise, just copy the node. Note that copy_tree_r already knows not to copy VAR_DECLs, etc., so this is safe. */ else |