aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/tree-nrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/tree-nrv.c')
-rw-r--r--gcc-4.9/gcc/tree-nrv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc-4.9/gcc/tree-nrv.c b/gcc-4.9/gcc/tree-nrv.c
index b443388a2..028ac9af7 100644
--- a/gcc-4.9/gcc/tree-nrv.c
+++ b/gcc-4.9/gcc/tree-nrv.c
@@ -187,8 +187,7 @@ tree_nrv (void)
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,