examine_argument (nat_mode, type, 0, &needed_intregs, &needed_sseregs);
- need_temp = (!REG_P (container)
+ bool container_in_reg = false;
+ if (REG_P (container))
+ container_in_reg = true;
+ else if (GET_CODE (container) == PARALLEL
+ && GET_MODE (container) == BLKmode
+ && XVECLEN (container, 0) == 1)
+ {
+ /* Check if it is a PARALLEL BLKmode container of an EXPR_LIST
+ expression in a TImode register. In this case, temp isn't
+ needed. Otherwise, the TImode variable will be put in the
+ GPR save area which guarantees only 8-byte alignment. */
+ rtx x = XVECEXP (container, 0, 0);
+ if (GET_CODE (x) == EXPR_LIST
+ && REG_P (XEXP (x, 0))
+ && XEXP (x, 1) == const0_rtx)
+ container_in_reg = true;
+ }
+
+ need_temp = (!container_in_reg
&& ((needed_intregs && TYPE_ALIGN (type) > 64)
|| TYPE_ALIGN (type) > 128));
/* In case we are passing structure, verify that it is consecutive block
on the register save area. If not we need to do moves. */
- if (!need_temp && !REG_P (container))
+ if (!need_temp && !container_in_reg)
{
/* Verify that all registers are strictly consecutive */
if (SSE_REGNO_P (REGNO (XEXP (XVECEXP (container, 0, 0), 0))))
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdarg.h>
+#include <string.h>
+
+union S8302
+{
+ union
+ {
+ double b;
+ int c;
+ } a;
+ long double d;
+ unsigned short int f[5];
+};
+
+union S8302 s8302;
+extern void check8302va (int i, ...);
+
+int
+main (void)
+{
+ memset (&s8302, '\0', sizeof (s8302));
+ s8302.a.b = -221438.250000;
+ check8302va (1, s8302);
+ return 0;
+}
+
+__attribute__((noinline, noclone))
+void
+check8302va (int z, ...)
+{
+ union S8302 arg, *p;
+ va_list ap;
+
+ __builtin_va_start (ap, z);
+ p = &s8302;
+ arg = __builtin_va_arg (ap, union S8302);
+ if (p->a.b != arg.a.b)
+ __builtin_abort ();
+ __builtin_va_end (ap);
+}