* config/arm/arm.c (arm_setup_incoming_varargs): If last named
argument needs double word alignment and cum->nregs is odd, account
for the inserted padding.
* gcc.c-torture/execute/
20071213-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131196
138bc75d-0d04-0410-961f-
82ee72b054a4
2007-12-27 Jakub Jelinek <jakub@redhat.com>
+ PR target/34281
+ * config/arm/arm.c (arm_setup_incoming_varargs): If last named
+ argument needs double word alignment and cum->nregs is odd, account
+ for the inserted padding.
+
PR debug/34535
* tree-mudflap.c (mf_make_builtin): Make decl artificial
and don't emit debug info for it.
static void
arm_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
- enum machine_mode mode ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED,
+ enum machine_mode mode,
+ tree type,
int *pretend_size,
int second_time ATTRIBUTE_UNUSED)
{
+ int nregs = cum->nregs;
+ if (nregs & 1
+ && ARM_DOUBLEWORD_ALIGN
+ && arm_needs_doubleword_align (mode, type))
+ nregs++;
+
cfun->machine->uses_anonymous_args = 1;
- if (cum->nregs < NUM_ARG_REGS)
- *pretend_size = (NUM_ARG_REGS - cum->nregs) * UNITS_PER_WORD;
+ if (nregs < NUM_ARG_REGS)
+ *pretend_size = (NUM_ARG_REGS - nregs) * UNITS_PER_WORD;
}
/* Return nonzero if the CONSUMER instruction (a store) does not need
+2007-12-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/34281
+ * gcc.c-torture/execute/20071213-1.c: New test.
+
2007-12-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/34560
--- /dev/null
+/* PR target/34281 */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+void
+h (int x, va_list ap)
+{
+ switch (x)
+ {
+ case 1:
+ if (va_arg (ap, int) != 3 || va_arg (ap, int) != 4)
+ abort ();
+ return;
+ case 5:
+ if (va_arg (ap, int) != 9 || va_arg (ap, int) != 10)
+ abort ();
+ return;
+ default:
+ abort ();
+ }
+}
+
+void
+f1 (int i, long long int j, ...)
+{
+ va_list ap;
+ va_start (ap, j);
+ h (i, ap);
+ if (i != 1 || j != 2)
+ abort ();
+ va_end (ap);
+}
+
+void
+f2 (int i, int j, int k, long long int l, ...)
+{
+ va_list ap;
+ va_start (ap, l);
+ h (i, ap);
+ if (i != 5 || j != 6 || k != 7 || l != 8)
+ abort ();
+ va_end (ap);
+}
+
+int
+main ()
+{
+ f1 (1, 2, 3, 4);
+ f2 (5, 6, 7, 8, 9, 10);
+ return 0;
+}