From 01c985700000ecfa510dde907812cb389d28695e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 10 Aug 2004 14:02:18 -0400 Subject: [PATCH] function.c (expand_function_start): Handle DECL_BY_REFERENCE on the RESULT_DECL. * function.c (expand_function_start): Handle DECL_BY_REFERENCE on the RESULT_DECL. From-SVN: r85763 --- gcc/ChangeLog | 5 +++++ gcc/function.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6db90d9bb669..88c4d8f06efb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-10 Jason Merrill + + * function.c (expand_function_start): Handle DECL_BY_REFERENCE on + the RESULT_DECL. + 2004-08-10 Geoffrey Keating * tree-vn.c (val_expr_pair_expr_eq): Compare vuses, to match the diff --git a/gcc/function.c b/gcc/function.c index ed7821b4f7b4..e59f002cb5cb 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4005,8 +4005,12 @@ expand_function_start (tree subr) } if (value_address) { - rtx x = gen_rtx_MEM (DECL_MODE (DECL_RESULT (subr)), value_address); - set_mem_attributes (x, DECL_RESULT (subr), 1); + rtx x = value_address; + if (!DECL_BY_REFERENCE (DECL_RESULT (subr))) + { + x = gen_rtx_MEM (DECL_MODE (DECL_RESULT (subr)), x); + set_mem_attributes (x, DECL_RESULT (subr), 1); + } SET_DECL_RTL (DECL_RESULT (subr), x); } } -- 2.43.5