function.c (expand_function_start): Handle DECL_BY_REFERENCE on the RESULT_DECL.
authorJason Merrill <jason@redhat.com>
Tue, 10 Aug 2004 18:02:18 +0000 (14:02 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 10 Aug 2004 18:02:18 +0000 (14:02 -0400)
        * function.c (expand_function_start): Handle DECL_BY_REFERENCE on
        the RESULT_DECL.

From-SVN: r85763

gcc/ChangeLog
gcc/function.c

index 6db90d9bb66912057832d5556dfbb986a97af1c7..88c4d8f06efbd1e0bf8e3b56bc0735a16e3d4d9d 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-10  Jason Merrill  <jason@redhat.com>
+
+       * function.c (expand_function_start): Handle DECL_BY_REFERENCE on
+       the RESULT_DECL.
+
 2004-08-10  Geoffrey Keating  <geoffk@apple.com>
 
        * tree-vn.c (val_expr_pair_expr_eq): Compare vuses, to match the
index ed7821b4f7b4846546646d6cc081bdcc5c6672bb..e59f002cb5cb0c0fbc3af3066a608e8fb4b1f4b2 100644 (file)
@@ -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);
        }
     }