summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-25 20:26:11 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-25 20:26:11 +0000
commiteaf1e5768d9418a24b0da872017e2f0882dc015b (patch)
tree4b88d16d1ec638d995e6e57ed4c9c3b58437eff7
parente684d543c44c50358b58ef7ce1d75b0b91bc3af4 (diff)
downloadgcc-eaf1e5768d9418a24b0da872017e2f0882dc015b.tar.gz
PR lto/52178
* tree-inline.c (remap_gimple_op_r): Fix handling of FIELD_DECL. * tree.c (RETURN_TRUE_IF_VAR): Do not return true for PLACEHOLDER_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187892 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-inline.c9
-rw-r--r--gcc/tree.c7
3 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d8af885ee33..136855a9959 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR lto/52178
+ * tree-inline.c (remap_gimple_op_r): Fix handling of FIELD_DECL.
+ * tree.c (RETURN_TRUE_IF_VAR): Do not return true for PLACEHOLDER_EXPR.
+
2012-05-25 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/t-linux64: Delete the 32-bit multilib that uses
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a987ff0f8ae..0190aa953f5 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -818,6 +818,15 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
|| decl_function_context (*tp) == id->src_fn))
/* These may need to be remapped for EH handling. */
*tp = remap_decl (*tp, id);
+ else if (TREE_CODE (*tp) == FIELD_DECL)
+ {
+ /* If the enclosing record type is variably_modified_type_p, the field
+ has already been remapped. Otherwise, it need not be. */
+ tree *n = (tree *) pointer_map_contains (id->decl_map, *tp);
+ if (n)
+ *tp = *n;
+ *walk_subtrees = 0;
+ }
else if (TYPE_P (*tp))
/* Types may need remapping as well. */
*tp = remap_type (*tp, id);
diff --git a/gcc/tree.c b/gcc/tree.c
index 1ee3f1db51e..de4a1c04202 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8477,8 +8477,11 @@ variably_modified_type_p (tree type, tree fn)
a variable in FN. */
#define RETURN_TRUE_IF_VAR(T) \
do { tree _t = (T); \
- if (_t && _t != error_mark_node && TREE_CODE (_t) != INTEGER_CST \
- && (!fn || walk_tree (&_t, find_var_from_fn, fn, NULL))) \
+ if (_t != NULL_TREE \
+ && _t != error_mark_node \
+ && TREE_CODE (_t) != INTEGER_CST \
+ && TREE_CODE (_t) != PLACEHOLDER_EXPR \
+ && (!fn || walk_tree (&_t, find_var_from_fn, fn, NULL))) \
return true; } while (0)
if (type == error_mark_node)