OSDN Git Service

* stmt.c (expand_return): If asked to return the RESULT_DECL,
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Aug 2004 06:28:00 +0000 (06:28 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Aug 2004 06:28:00 +0000 (06:28 +0000)
just call expand_value_return on result_rtl.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85795 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stmt.c

index ffa4aee..b0c3d9c 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-10  Zack Weinberg  <zack@codesourcery.com>
+
+       * stmt.c (expand_return): If asked to return the RESULT_DECL,
+       just call expand_value_return on result_rtl.
+
 2004-08-10  Richard Henderson  <rth@redhat.com>
 
        * builtins.def (BUILT_IN_STACK_ALLOC): Remove.
        * 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  <edelsohn@gnu.org>
 
        * config/rs6000/rs6000-protos.h (expand_block_clear): Declare.
        * 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
        ("*tmqi_mem"): Remove SUBREG from pattern.
        ("*anddi3_cconly"): Prevent accidentally matching TM pattern.
        ("*andsi3_cconly"): Likewise.
-       
+
 2004-08-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/16909
        * 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.
        (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.
 
index 86d4fe9..9425cff 100644 (file)
@@ -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;