summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-03 18:08:01 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-03 18:08:01 +0000
commit463cc2564a4b4ea073a816e5d90450aa72717042 (patch)
tree07b2104b534faffa886609f1d43a8463761aacb1 /gcc/tree-inline.c
parent2e9edbc98892d32e8b79c31607e284beb6c00636 (diff)
downloadgcc-463cc2564a4b4ea073a816e5d90450aa72717042.tar.gz
2009-03-03 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/39345 * tree-inline.c (remapped_type): New. (can_be_nonlocal): Call remapped_type instead of remap_type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144581 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 88154bf91f3..63392e21c4b 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -426,6 +426,26 @@ remap_type (tree type, copy_body_data *id)
return tmp;
}
+/* Return previously remapped type of TYPE in ID. Return NULL if TYPE
+ is NULL or TYPE has not been remapped before. */
+
+static tree
+remapped_type (tree type, copy_body_data *id)
+{
+ tree *node;
+
+ if (type == NULL)
+ return type;
+
+ /* See if we have remapped this type. */
+ node = (tree *) pointer_map_contains (id->decl_map, type);
+ if (node)
+ return *node;
+ else
+ return NULL;
+}
+
+ /* The type only needs remapping if it's variably modified. */
/* Decide if DECL can be put into BLOCK_NONLOCAL_VARs. */
static bool
@@ -446,8 +466,10 @@ can_be_nonlocal (tree decl, copy_body_data *id)
if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != PARM_DECL)
return false;
- /* We must use global type. */
- if (TREE_TYPE (decl) != remap_type (TREE_TYPE (decl), id))
+ /* We must use global type. We call remapped_type instead of
+ remap_type since we don't want to remap this type here if it
+ hasn't been remapped before. */
+ if (TREE_TYPE (decl) != remapped_type (TREE_TYPE (decl), id))
return false;
/* Wihtout SSA we can't tell if variable is used. */