diff options
author | Jim Wilson <wilson@cygnus.com> | 2000-02-26 05:32:24 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2000-02-25 21:32:24 -0800 |
commit | 3431f196c04ff06ff8fef740e46612c176fb73eb (patch) | |
tree | b8babba7ab35efed2b8a2b8c15216c0c034665f7 /gcc | |
parent | 0268c5010749bc52f40c599be83108607c4bbbe2 (diff) | |
download | gcc-3431f196c04ff06ff8fef740e46612c176fb73eb.zip gcc-3431f196c04ff06ff8fef740e46612c176fb73eb.tar.gz gcc-3431f196c04ff06ff8fef740e46612c176fb73eb.tar.bz2 |
Fix 3 ia64 g++ testsuite failures, and groff miscompilation.
* optimize.c (expand_call_inline): Emit the return label before
evaluating the return value.
From-SVN: r32169
Diffstat (limited to 'gcc')
-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 96ad5bd..d482875 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 e18f956..f5db6a1 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); |