This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix sibcalls with partial-nregs



When emitting calls in gcc/calls.c, the flag ECF_SIBCALL tells the
code whether to emit the reg in args[].reg (if ECF_SIBCALL is
clear) or args[].tail_call_reg (if ECF_SIBCALL is set).

One place did not follow this, store_one_arg() which is handling
partial nregs cases.

I'll be shortly checking in a testcase (a small bit of code extracted
from the gdb sources) which triggers this bug on 32-bit sparc
targets.  It will be named gcc.c-torture/execute/20020404-1.c

2002-04-04  David S. Miller  <davem@redhat.com>

	* calls.c (store_one_arg): If ECF_SIBCALL, use tail_call_reg.

--- calls.c.~1~	Mon Mar 18 14:21:30 2002
+++ calls.c	Thu Apr  4 02:19:18 2002
@@ -4356,7 +4356,13 @@
   /* If this isn't going to be placed on both the stack and in registers,
      set up the register and number of words.  */
   if (! arg->pass_on_stack)
-    reg = arg->reg, partial = arg->partial;
+    {
+      if (flags & ECF_SIBCALL)
+	reg = arg->tail_call_reg;
+      else
+	reg = arg->reg;
+      partial = arg->partial;
+    }
 
   if (reg != 0 && partial == 0)
     /* Being passed entirely in a register.  We shouldn't be called in


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]