diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-18 16:15:12 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-18 16:15:12 +0000 |
| commit | 80ac742d926c6c87d9eb1648f4a501a34a3ac70a (patch) | |
| tree | 70263e15f7a28d4f44a057ee1783e8a0095c5f9a /gcc/expr.c | |
| parent | f6664feec514b2e3b3f36fb59c9b1b14dc5a52fc (diff) | |
| download | ppe42-gcc-80ac742d926c6c87d9eb1648f4a501a34a3ac70a.tar.gz ppe42-gcc-80ac742d926c6c87d9eb1648f4a501a34a3ac70a.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43445 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
| -rw-r--r-- | gcc/expr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 230cf9f1e6e..9b81988521b 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -1773,6 +1773,7 @@ emit_block_move (x, y, size, align) DECL_EXTERNAL (fn) = 1; TREE_PUBLIC (fn) = 1; DECL_ARTIFICIAL (fn) = 1; + TREE_NOTHROW (fn) = 1; make_decl_rtl (fn, NULL); assemble_external (fn); } @@ -2659,7 +2660,7 @@ clear_storage (object, size, align) For targets where libcalls and normal calls have different conventions for returning pointers, we could end up generating - incorrect code. + incorrect code. So instead of using a libcall sequence we build up a suitable CALL_EXPR and expand the call in the normal fashion. */ @@ -2677,6 +2678,7 @@ clear_storage (object, size, align) DECL_EXTERNAL (fn) = 1; TREE_PUBLIC (fn) = 1; DECL_ARTIFICIAL (fn) = 1; + TREE_NOTHROW (fn) = 1; make_decl_rtl (fn, NULL); assemble_external (fn); } @@ -4547,7 +4549,7 @@ store_constructor (exp, target, align, cleared, size) /* If the constructor has fewer fields than the structure or if we are initializing the structure to mostly zeros, - clear the whole structure first. Don't do this is TARGET is + clear the whole structure first. Don't do this if TARGET is a register whose mode size isn't equal to SIZE since clear_storage can't handle this case. */ else if (size > 0 |

