sparc.c (function_arg_slotno): Align TImode arguments on a 16-byte boundary in the parameter array if ARCH64.

* config/sparc/sparc.c (function_arg_slotno): Align TImode
	arguments on a 16-byte boundary in the parameter array if ARCH64.
	Split handling of TFmode.

From-SVN: r77107
This commit is contained in:
Eric Botcazou 2004-02-02 13:20:52 +01:00 committed by Eric Botcazou
parent 6f626d1bdf
commit d560b0aa2a
4 changed files with 54 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2004-02-02 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.c (function_arg_slotno): Align TImode
arguments on a 16-byte boundary in the parameter array if ARCH64.
Split handling of TFmode.
2004-02-02 Paolo Bonzini <bonzini@gnu.org>
* rtlanal.c (reg_overlap_mentioned_p) [!ENABLE_CHECKING]:

View File

@ -4979,19 +4979,27 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode,
See emit_call_1. */
return -1;
case TImode : case CTImode :
if (TARGET_ARCH64 && (slotno & 1) != 0)
slotno++, *ppadding = 1;
/* fallthrough */
case QImode : case CQImode :
case HImode : case CHImode :
case SImode : case CSImode :
case DImode : case CDImode :
case TImode : case CTImode :
if (slotno >= SPARC_INT_ARG_MAX)
return -1;
regno = regbase + slotno;
break;
case TFmode : case TCmode :
if (TARGET_ARCH64 && (slotno & 1) != 0)
slotno++, *ppadding = 1;
/* fallthrough */
case SFmode : case SCmode :
case DFmode : case DCmode :
case TFmode : case TCmode :
if (TARGET_ARCH32)
{
if (slotno >= SPARC_INT_ARG_MAX)
@ -5000,9 +5008,6 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode,
}
else
{
if ((mode == TFmode || mode == TCmode)
&& (slotno & 1) != 0)
slotno++, *ppadding = 1;
if (TARGET_FPU && named)
{
if (slotno >= SPARC_FP_ARG_MAX)

View File

@ -1,3 +1,7 @@
2004-02-02 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/titype-1.c: New test.
2004-02-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/13957

View File

@ -0,0 +1,34 @@
/* { dg-do compile } */
/* Not all platforms support TImode integers. */
#if defined(__LP64__) || defined(__sparc__)
typedef int TItype __attribute__ ((mode (TI))); /* { dg-error "no data type for mode" "TI" { target sparc-sun-solaris2.[0-6]* } } */
#else
typedef long TItype;
#endif
#include <stdarg.h>
extern void abort(void);
void foo(int i, ...)
{
TItype q;
va_list va;
va_start(va, i);
q = va_arg(va, TItype);
va_end(va);
if (q != 5)
abort();
}
int main(void)
{
TItype q = 5;
foo(1, q);
return 0;
}