+2005-12-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/24306
+ * builtins.c (std_gimplify_va_arg_expr): Do not align
+ va frame for zero sized types.
+ * config/i386/i386.c (ix86_gimplify_va_arg): Likewise.
+
2005-12-20 Kazu Hirata <kazu@codesourcery.com>
PR tree-optimization/25501
/* va_list pointer is aligned to PARM_BOUNDARY. If argument actually
requires greater alignment, we must perform dynamic alignment. */
- if (boundary > align)
+ if (boundary > align
+ && !integer_zerop (TYPE_SIZE (type)))
{
t = fold_convert (TREE_TYPE (valist), size_int (boundary - 1));
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
/* ... otherwise out of the overflow area. */
/* Care for on-stack alignment if needed. */
- if (FUNCTION_ARG_BOUNDARY (VOIDmode, type) <= 64)
+ if (FUNCTION_ARG_BOUNDARY (VOIDmode, type) <= 64
+ || integer_zerop (TYPE_SIZE (type)))
t = ovf;
else
{
+2005-12-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/24306
+ * gcc.target/i386/pr24306.c: New testcase.
+
2005-12-20 Kazu Hirata <kazu@codesourcery.com>
PR tree-optimization/25501
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-msse" } */
+
+extern void abort(void);
+typedef int __attribute__ ((vector_size (16))) foo_t;
+
+struct s
+{
+ foo_t f[0];
+} s1;
+
+void
+check (int x, ...) __attribute__((noinline));
+void
+check (int x, ...)
+{
+ int y;
+ __builtin_va_list ap;
+
+ __builtin_va_start (ap, x);
+ __builtin_va_arg (ap, struct s);
+ y = __builtin_va_arg (ap, int);
+
+ if (y != 7)
+ abort ();
+}
+
+int main()
+{
+ check (3, s1, 7);
+ return 0;
+}