From: rguenth Date: Mon, 7 May 2012 12:59:05 +0000 (+0000) Subject: 2012-05-07 Richard Guenther X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29f2d4e5684a8466b17557477f4aa0d07288dba5;p=thirdparty%2Fgcc.git 2012-05-07 Richard Guenther PR tree-optimization/53195 * tree-inline.c (setup_one_parameter): Properly add referenced vars from the parameters new known value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187235 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a73b9e34dbce..dd7073b7448d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-05-07 Richard Guenther + + PR tree-optimization/53195 + * tree-inline.c (setup_one_parameter): Properly add referenced + vars from the parameters new known value. + 2012-05-07 Steven Bosscher * config/m68k/m68k.c (m68k_sched_branch_type): Remove. @@ -5,8 +11,8 @@ (m68k_sched_md_init_global): Don't allocate it. (m68k_sched_md_finish_global): Don't free it. * config/m68k/m68k.h (m68k_sched_branch_type): Remove prototype. - * config/m68k/m68k.md: Set the type of insns using m68k_sched_branch_type - to bcc directly. + * config/m68k/m68k.md: Set the type of insns using + m68k_sched_branch_type to bcc directly. 2012-05-07 Rainer Orth diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index ef0346581abd..057087e62a6a 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