From: Zack Weinberg Date: Wed, 11 Aug 2004 06:28:00 +0000 (+0000) Subject: stmt.c (expand_return): If asked to return the RESULT_DECL, just call expand_value_re... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f4a43e029d1e36130a9ff55128a1d101cf32ec5;p=gcc.git stmt.c (expand_return): If asked to return the RESULT_DECL, just call expand_value_return on result_rtl. * stmt.c (expand_return): If asked to return the RESULT_DECL, just call expand_value_return on result_rtl. From-SVN: r85795 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ffa4aeeaa88..b0c3d9c4ff8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-10 Zack Weinberg + + * stmt.c (expand_return): If asked to return the RESULT_DECL, + just call expand_value_return on result_rtl. + 2004-08-10 Richard Henderson * builtins.def (BUILT_IN_STACK_ALLOC): Remove. @@ -107,7 +112,7 @@ * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. - + 2004-08-10 David Edelsohn * config/rs6000/rs6000-protos.h (expand_block_clear): Declare. @@ -121,7 +126,7 @@ * varasm.c (unlikely_section_label): New global variable. (unlikely_text_section_name): New global variable. (text_section): Remove alignment statement. - (unlikely_text_section): Remove alignment statement; use + (unlikely_text_section): Remove alignment statement; use unlikely_section_label rather than hard-coded string. (assemble_start_function): Initialize unlikely_section_label and unlikely_text_section_name; make sure cold section is properly @@ -138,7 +143,7 @@ ("*tmqi_mem"): Remove SUBREG from pattern. ("*anddi3_cconly"): Prevent accidentally matching TM pattern. ("*andsi3_cconly"): Likewise. - + 2004-08-10 H.J. Lu PR target/16909 @@ -171,9 +176,9 @@ * tree-cfg.c (bsi_insert_before, bsi_insert_after): Call modify_stmt after linking stmt into the program. (bsi_remove): Don't call modify_stmt. - * tree-complex.c (update_complex_assignment, + * tree-complex.c (update_complex_assignment, expand_complex_comparison): Call modify_stmt after changing the stmt. - * tree-outof-ssa.c (rewrite_trees): Call modify_stmt only if not + * tree-outof-ssa.c (rewrite_trees): Call modify_stmt only if not removing the stmt. * tree-ssa-ccp.c (substitute_and_fold): Call modify_stmt after changing the stmt, and only if needed. @@ -182,14 +187,14 @@ (simplify_rhs_and_lookup_avail_expr): Don't take an annotation param. (simplify_cond_and_lookup_avail_expr): Use modify_stmt. (simplify_switch_and_lookup_avail_expr): Don't take an annotation param. - (eliminate_redundant_computations): Don't pass an annotation. Call + (eliminate_redundant_computations): Don't pass an annotation. Call modify_stmt rather than setting the annotation directly. (record_equivalences_from_stmt): Remove unused local 'j'. (cprop_operand): Take a stmt rather than an annotation as a parameter. Call modify_stmt. (cprop_into_stmt): Pass stmt rather than annotation. (update_rhs_and_lookup_avail_expr): Call modify_stmt. - * tree-ssa-loop-im.c (schedule_sm): Call get_stmt_ann rather than + * tree-ssa-loop-im.c (schedule_sm): Call get_stmt_ann rather than modify_stmt. * tree-ssa.c (propagate_into_addr): Dont call modify_stmt. diff --git a/gcc/stmt.c b/gcc/stmt.c index 86d4fe98dd3..9425cffc89e 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1635,8 +1635,6 @@ expand_return (tree retval) expand_null_return (); return; } - else if (TREE_CODE (retval) == RESULT_DECL) - retval_rhs = retval; else if ((TREE_CODE (retval) == MODIFY_EXPR || TREE_CODE (retval) == INIT_EXPR) && TREE_CODE (TREE_OPERAND (retval, 0)) == RESULT_DECL) @@ -1646,6 +1644,11 @@ expand_return (tree retval) result_rtl = DECL_RTL (DECL_RESULT (current_function_decl)); + /* If we are returning the RESULT_DECL, then the value has already + been stored into it, so we don't have to do anything special. */ + if (TREE_CODE (retval_rhs) == RESULT_DECL) + expand_value_return (result_rtl); + /* If the result is an aggregate that is being returned in one (or more) registers, load the registers here. The compiler currently can't handle copying a BLKmode value into registers. We could put this code in a @@ -1653,9 +1656,9 @@ expand_return (tree retval) call/return), but until this feature is generally usable it is kept here (and in expand_call). */ - if (retval_rhs != 0 - && TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode - && REG_P (result_rtl)) + else if (retval_rhs != 0 + && TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode + && REG_P (result_rtl)) { int i; unsigned HOST_WIDE_INT bitpos, xbitpos;