aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-06-18 12:56:42 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2005-06-18 12:56:42 +0100
commit6d409ca872d76ffce2b945153486992787e74250 (patch)
treef05c8531caa36a1bfb5ac10864d6e0c8e637dd7d /gcc
parent189ed82c09bb8bfc5243bd0f60f6bdca4b4daf9a (diff)
downloadgcc-6d409ca872d76ffce2b945153486992787e74250.zip
gcc-6d409ca872d76ffce2b945153486992787e74250.tar.gz
gcc-6d409ca872d76ffce2b945153486992787e74250.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/ia64/ia64.c13
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/ia64/float80-varargs-1.c33
4 files changed, 55 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dd22a3f..8ebd800 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 8d20992..0475c94 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -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);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 98b3d23..992b176 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+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
diff --git a/gcc/testsuite/gcc.target/ia64/float80-varargs-1.c b/gcc/testsuite/gcc.target/ia64/float80-varargs-1.c
new file mode 100644
index 0000000..96524be
--- /dev/null
+++ b/gcc/testsuite/gcc.target/ia64/float80-varargs-1.c
@@ -0,0 +1,33 @@
+/* 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);
+}