Commit 6d409ca8 by Joseph Myers Committed by Joseph Myers

ia64.c (ia64_function_arg): Set up a PARALLEL for a big-endian unnamed __float80 value.

	* config/ia64/ia64.c (ia64_function_arg): Set up a PARALLEL for a
	big-endian unnamed __float80 value.

testsuite:
	* gcc.target/ia64/float80-varargs-1.c: New test.

From-SVN: r101153
parent 189ed82c
2005-06-18 Joseph S. Myers <joseph@codesourcery.com>
* config/ia64/ia64.c (ia64_function_arg): Set up a PARALLEL for a
big-endian unnamed __float80 value.
2005-06-18 Richard Henderson <rth@redhat.com>
PR tree-opt/22103
......
......@@ -3822,6 +3822,19 @@ ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode, basereg + cum->words + offset),
const0_rtx)));
/* Similarly, an anonymous XFmode value must be split into two
registers and padded appropriately. */
else if (BYTES_BIG_ENDIAN && mode == XFmode)
{
rtx loc[2];
loc[0] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode, basereg + cum->words + offset),
const0_rtx);
loc[1] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode, basereg + cum->words + offset + 1),
GEN_INT (UNITS_PER_WORD));
return gen_rtx_PARALLEL (mode, gen_rtvec_v (2, loc));
}
else
return gen_rtx_REG (mode, basereg + cum->words + offset);
}
......
2005-06-18 Joseph S. Myers <joseph@codesourcery.com>
* gcc.target/ia64/float80-varargs-1.c: New test.
2005-06-18 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR tree-opt/22035
......
/* Test for a bug with passing __float80 in varargs. The __float80
value was wrongly passed, leading to an abort. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do run } */
/* { dg-options "" } */
#include <stdarg.h>
extern void abort (void);
extern void exit (int);
__float80 s = 1.234L;
__float80 d;
void vf (int a0, ...);
int
main (void)
{
vf (0, s);
if (d != s)
abort ();
exit (0);
}
void
vf (int a0, ...)
{
va_list ap;
va_start (ap, a0);
d = va_arg (ap, __float80);
va_end (ap);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment