aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-05-07 12:59:05 +0000
committerRichard Guenther <rguenther@suse.de>2012-05-07 12:59:05 +0000
commit9a7aadaf81b34b87cd352e651c843a41ebd4da1b (patch)
tree5e462c295d8eed0f315faa926d6272ff53f3c01d /gcc/tree-inline.c
parentcfbcabcd0b98755b65d3b5a0cc8767489566d497 (diff)
2012-05-07 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53195 * tree-inline.c (setup_one_parameter): Properly add referenced vars from the parameters new known value. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187235 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index ef0346581ab..057087e62a6 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2608,6 +2608,17 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
/* Make gimplifier happy about this variable. */
DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
+ /* We are eventually using the value - make sure all variables
+ referenced therein are properly recorded. */
+ if (value
+ && gimple_in_ssa_p (cfun)
+ && TREE_CODE (value) == ADDR_EXPR)
+ {
+ tree base = get_base_address (TREE_OPERAND (value, 0));
+ if (base && TREE_CODE (base) == VAR_DECL)
+ add_referenced_var (base);
+ }
+
/* If the parameter is never assigned to, has no SSA_NAMEs created,
we would not need to create a new variable here at all, if it
weren't for debug info. Still, we can just use the argument