]> gcc.gnu.org Git - gcc.git/commitdiff
calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for an invalid result register...
authorRichard Henderson <rth@redhat.com>
Sun, 23 Dec 2001 13:02:18 +0000 (05:02 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 23 Dec 2001 13:02:18 +0000 (05:02 -0800)
        * calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for
        an invalid result register; do end the sequence properly.
        (emit_library_call_value_1): Likewise.

From-SVN: r48287

gcc/ChangeLog
gcc/calls.c

index 8f1873c06263456fe6213ec0a4bef925fa607925..3db09bb78395dc71d5df89f28384197e074de266 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-23  Richard Henderson  <rth@redhat.com>
+
+       * calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for
+       an invalid result register; do end the sequence properly.
+       (emit_library_call_value_1): Likewise.
+
 2001-12-22  Aldy Hernandez  <aldyh@redhat.com>
 
         * config/rs6000/rs6000.h (rs6000_builtins): Add vsldoi variants.
index 2049bd2f9c831e2ce684c40151db86da8e6a3cd4..a6c999c01253fd26dba5a3084e7329b608eae9a9 100644 (file)
@@ -2937,9 +2937,6 @@ expand_call (exp, target, ignore)
            valreg = hard_function_value (TREE_TYPE (exp), fndecl, (pass == 0));
        }
 
-      if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
-        flags &= ~ECF_LIBCALL_BLOCK;
-
       /* Precompute all register parameters.  It isn't safe to compute anything
         once we have started filling any specific hard regs.  */
       precompute_register_parameters (num_actuals, args, &reg_parm_seen);
@@ -3071,32 +3068,45 @@ expand_call (exp, target, ignore)
         we have no way to move such values into a pseudo register.  */
       if (pass && (flags & ECF_LIBCALL_BLOCK))
        {
-         rtx note = 0;
-         rtx temp = gen_reg_rtx (GET_MODE (valreg));
          rtx insns;
 
-         /* Mark the return value as a pointer if needed.  */
-         if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
-           mark_reg_pointer (temp, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
-
-         /* Construct an "equal form" for the value which mentions all the
-            arguments in order as well as the function name.  */
-         for (i = 0; i < num_actuals; i++)
-           note = gen_rtx_EXPR_LIST (VOIDmode, args[i].initial_value, note);
-         note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
-
-         insns = get_insns ();
-         end_sequence ();
-
-         if (flags & ECF_PURE)
-           note = gen_rtx_EXPR_LIST (VOIDmode,
-              gen_rtx_USE (VOIDmode,
-                           gen_rtx_MEM (BLKmode,
-                                        gen_rtx_SCRATCH (VOIDmode))), note);
-
-         emit_libcall_block (insns, temp, valreg, note);
-
-         valreg = temp;
+         if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
+           {
+             insns = get_insns ();
+             end_sequence ();
+             emit_insns (insns);
+           }
+         else
+           {
+             rtx note = 0;
+             rtx temp = gen_reg_rtx (GET_MODE (valreg));
+
+             /* Mark the return value as a pointer if needed.  */
+             if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
+               mark_reg_pointer (temp,
+                                 TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
+
+             /* Construct an "equal form" for the value which mentions all the
+                arguments in order as well as the function name.  */
+             for (i = 0; i < num_actuals; i++)
+               note = gen_rtx_EXPR_LIST (VOIDmode,
+                                         args[i].initial_value, note);
+             note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
+
+             insns = get_insns ();
+             end_sequence ();
+
+             if (flags & ECF_PURE)
+               note = gen_rtx_EXPR_LIST (VOIDmode,
+                       gen_rtx_USE (VOIDmode,
+                                    gen_rtx_MEM (BLKmode,
+                                                 gen_rtx_SCRATCH (VOIDmode))),
+                       note);
+
+             emit_libcall_block (insns, temp, valreg, note);
+
+             valreg = temp;
+           }
        }
       else if (pass && (flags & ECF_MALLOC))
        {
@@ -4021,8 +4031,6 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
   NO_DEFER_POP;
   valreg = (mem_value == 0 && outmode != VOIDmode
            ? hard_libcall_value (outmode) : NULL_RTX);
-  if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
-    flags &= ~ECF_LIBCALL_BLOCK;
 
   /* Stack must be properly aligned now.  */
   if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1))
@@ -4078,29 +4086,40 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
      we have no way to move such values into a pseudo register.  */
   if (flags & ECF_LIBCALL_BLOCK)
     {
-      rtx note = 0;
-      rtx temp = gen_reg_rtx (GET_MODE (valreg));
       rtx insns;
-      int i;
 
-      /* Construct an "equal form" for the value which mentions all the
-        arguments in order as well as the function name.  */
-      for (i = 0; i < nargs; i++)
-       note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
-      note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
+      if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
+       {
+         insns = get_insns ();
+         end_sequence ();
+         emit_insns (insns);
+       }
+      else
+       {
+         rtx note = 0;
+         rtx temp = gen_reg_rtx (GET_MODE (valreg));
+         int i;
 
-      insns = get_insns ();
-      end_sequence ();
+         /* Construct an "equal form" for the value which mentions all the
+            arguments in order as well as the function name.  */
+         for (i = 0; i < nargs; i++)
+           note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
+         note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
 
-      if (flags & ECF_PURE)
-       note = gen_rtx_EXPR_LIST (VOIDmode,
-          gen_rtx_USE (VOIDmode,
-                       gen_rtx_MEM (BLKmode,
-                                    gen_rtx_SCRATCH (VOIDmode))), note);
+         insns = get_insns ();
+         end_sequence ();
 
-      emit_libcall_block (insns, temp, valreg, note);
+         if (flags & ECF_PURE)
+           note = gen_rtx_EXPR_LIST (VOIDmode,
+                       gen_rtx_USE (VOIDmode,
+                                    gen_rtx_MEM (BLKmode,
+                                                 gen_rtx_SCRATCH (VOIDmode))),
+                       note);
+
+         emit_libcall_block (insns, temp, valreg, note);
 
-      valreg = temp;
+         valreg = temp;
+       }
     }
   pop_temp_slots ();
 
This page took 0.088579 seconds and 5 git commands to generate.