aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nrv.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-10-09 08:21:46 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-10-09 08:21:46 +0000
commit77ed39034fda4f949fea955bfadbdab36df5d94a (patch)
tree610e9548bdb57884321119dfa71eec2a16b74bd6 /gcc/tree-nrv.c
parentee68591e69621b4fdbbd925044b66b6147800cf9 (diff)
downloadgcc-77ed39034fda4f949fea955bfadbdab36df5d94a.zip
gcc-77ed39034fda4f949fea955bfadbdab36df5d94a.tar.gz
gcc-77ed39034fda4f949fea955bfadbdab36df5d94a.tar.bz2
re PR lto/61969 (wrong code by LTO on i?86-linux-gnu (affecting trunk, 4.9.x, and 4.8.x))
2014-10-09 Richard Biener <rguenther@suse.de> PR tree-optimization/61969 * tree-nrv.c (pass_nrv::execute): Properly test for automatic variables. From-SVN: r216029
Diffstat (limited to 'gcc/tree-nrv.c')
-rw-r--r--gcc/tree-nrv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index f2f3147..02a4af9 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -216,8 +216,7 @@ pass_nrv::execute (function *fun)
same type and alignment as the function's result. */
if (TREE_CODE (found) != VAR_DECL
|| TREE_THIS_VOLATILE (found)
- || DECL_CONTEXT (found) != current_function_decl
- || TREE_STATIC (found)
+ || !auto_var_in_fn_p (found, current_function_decl)
|| TREE_ADDRESSABLE (found)
|| DECL_ALIGN (found) > DECL_ALIGN (result)
|| !useless_type_conversion_p (result_type,