diff options
| author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-26 05:32:24 +0000 |
|---|---|---|
| committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-26 05:32:24 +0000 |
| commit | 0ccef7e31cdcffa8a0cba861f0300d44395d537e (patch) | |
| tree | b8babba7ab35efed2b8a2b8c15216c0c034665f7 | |
| parent | 5a146b62a7f24eda3fc7d35c349fb1900d48b837 (diff) | |
| download | ppe42-gcc-0ccef7e31cdcffa8a0cba861f0300d44395d537e.tar.gz ppe42-gcc-0ccef7e31cdcffa8a0cba861f0300d44395d537e.zip | |
Fix 3 ia64 g++ testsuite failures, and groff miscompilation.
* optimize.c (expand_call_inline): Emit the return label before
evaluating the return value.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32169 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/optimize.c | 17 |
2 files changed, 13 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 96ad5bd9958..d4828755eaa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 25 14:52:33 2000 Jim Wilson <wilson@cygnus.com> + + * optimize.c (expand_call_inline): Emit the return label before + evaluating the return value. + 2000-02-24 Mark Mitchell <mark@codesourcery.com> * lex.c (check_newline): Use push_srcloc and pop_srcloc, rather diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index e18f9568b82..f5db6a10082 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -39,11 +39,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA are not needed. o Provide heuristics to clamp inlining of recursive template - calls? + calls? */ - o It looks like the return label is not being placed in the optimal - place. Shouldn't it come before the returned value? */ - /* Data required for function inlining. */ typedef struct inline_data @@ -644,6 +641,13 @@ expand_call_inline (tp, walk_subtrees, data) STMT_EXPR_STMT (expr) = chainon (STMT_EXPR_STMT (expr), scope_stmt); + /* After the body of the function comes the RET_LABEL. This must come + before we evaluate the returned value below, because that evalulation + may cause RTL to be generated. */ + STMT_EXPR_STMT (expr) + = chainon (STMT_EXPR_STMT (expr), + build_min_nt (LABEL_STMT, id->ret_label)); + /* Finally, mention the returned value so that the value of the statement-expression is the returned value of the function. */ STMT_EXPR_STMT (expr) = chainon (STMT_EXPR_STMT (expr), use_stmt); @@ -652,11 +656,6 @@ expand_call_inline (tp, walk_subtrees, data) splay_tree_delete (id->decl_map); id->decl_map = st; - /* After the body of the function comes the RET_LABEL. */ - STMT_EXPR_STMT (expr) - = chainon (STMT_EXPR_STMT (expr), - build_min_nt (LABEL_STMT, id->ret_label)); - /* The new expression has side-effects if the old one did. */ TREE_SIDE_EFFECTS (expr) = TREE_SIDE_EFFECTS (t); |

