Implement the Named Return Value optimization.
authorJason Merrill <jason@redhat.com>
Mon, 18 Jun 2001 16:15:12 +0000 (12:15 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 18 Jun 2001 16:15:12 +0000 (12:15 -0400)
commit0d97bf4c2c4e599beee17c3a99f6dfdd8884d09a
tree70263e15f7a28d4f44a057ee1783e8a0095c5f9a
parent923cbdc322ee080c02b94a95eece0618a2a78b47
Implement the Named Return Value optimization.

        * c-common.h (RETURN_NULLIFIED_P): New macro.
        * c-semantics.c (genrtl_return_stmt): Check it.
        * cp-tree.h (struct cp_language_function): Add x_return_value.
        (current_function_return_value): Now a macro.
        * decl.c: Don't define it.
        (define_label, finish_case_label): Don't clear it.
        (init_decl_processing): Don't register it with GC.
        * semantics.c (genrtl_finish_function): Don't check it for
        no_return_label.  Copy the RTL from the return value to
        current_function_return_value and walk, calling...
        (nullify_returns_r): ...this new fn.
        * typeck.c (check_return_expr): Set current_function_return_value.

        * expr.c (clear_storage): Set TREE_NOTHROW on the decl for memset.
        (emit_block_move): Likewise.

From-SVN: r43445
gcc/ChangeLog
gcc/c-common.h
gcc/c-semantics.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/expr.c