2017-12-21 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/83487
+ * config/i386/i386.c (ix86_function_arg_boundary): Return
+ PARM_BOUNDARY for TYPE_EMPTY_P types.
+
PR c/83448
* gimple-ssa-sprintf.c (maybe_warn): Don't call set_caret_index
if navail is >= dir.len.
the main variant type. */
type = TYPE_MAIN_VARIANT (type);
align = TYPE_ALIGN (type);
+ if (TYPE_EMPTY_P (type))
+ return PARM_BOUNDARY;
}
else
align = GET_MODE_ALIGNMENT (mode);
2017-12-21 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/83487
+ * gcc.c-torture/compile/pr83487.c: New test.
+ * gcc.dg/compat/pr83487-1.h: New file.
+ * gcc.dg/compat/pr83487-1_main.c: New test.
+ * gcc.dg/compat/pr83487-1_x.c: New file.
+ * gcc.dg/compat/pr83487-1_y.c: New file.
+ * gcc.dg/compat/pr83487-2_main.c: New test.
+ * gcc.dg/compat/pr83487-2_x.c: New file.
+ * gcc.dg/compat/pr83487-2_y.c: New file.
+ * g++.dg/abi/pr83487.C: New test.
+ * g++.dg/compat/abi/pr83487-1_main.C: New test.
+ * g++.dg/compat/abi/pr83487-1_x.C: New file.
+ * g++.dg/compat/abi/pr83487-1_y.C: New file.
+ * g++.dg/compat/abi/pr83487-2_main.C: New test.
+ * g++.dg/compat/abi/pr83487-2_x.C: New file.
+ * g++.dg/compat/abi/pr83487-2_y.C: New file.
+
PR c/83448
* gcc.c-torture/compile/pr83448.c: New test.
* gcc.dg/tree-ssa/builtin-snprintf-warn-4.c: New test.
--- /dev/null
+/* PR middle-end/83487 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct __attribute__ ((__aligned__)) A {};
+struct A a;
+void bar (int, int, int, int, int, int, int, struct A);
+
+void
+foo ()
+{
+ bar (0, 1, 2, 3, 4, 5, 6, a);
+}
--- /dev/null
+extern void do_test (void);
+
+int
+main ()
+{
+ do_test ();
+ return 0;
+}
--- /dev/null
+#include "../../../gcc.dg/compat/pr83487-1_x.c"
--- /dev/null
+#include "../../../gcc.dg/compat/pr83487-1_y.c"
--- /dev/null
+extern void do_test (void);
+
+int
+main ()
+{
+ do_test ();
+ return 0;
+}
--- /dev/null
+#include "../../../gcc.dg/compat/pr83487-2_x.c"
--- /dev/null
+#include "../../../gcc.dg/compat/pr83487-2_y.c"
--- /dev/null
+/* PR middle-end/83487 */
+
+struct __attribute__ ((aligned)) A {};
+struct A a;
+void bar (int, int, int, int, int, int, int, struct A);
+
+void
+foo (void)
+{
+ bar (0, 1, 2, 3, 4, 5, 6, a);
+}
--- /dev/null
+#ifdef PR83487_LARGE
+struct __attribute__ ((aligned (128))) A {};
+struct B {};
+struct C { struct B c[128]; };
+#else
+struct __attribute__ ((aligned (16))) A {};
+struct B {};
+struct C { struct B c[16]; };
+#endif
--- /dev/null
+extern void do_test (void);
+
+int
+main ()
+{
+ do_test ();
+ return 0;
+}
--- /dev/null
+#include "pr83487-1.h"
+
+extern
+#ifdef __cplusplus
+"C"
+#endif
+void abort ();
+
+void
+f1 (int i, int j, int k, int l, int m, int n, int o, struct A x)
+{
+ if (i != 6 || j != 0 || k != 1 || l != 2 || m != 3 || n != 4 || o != 5)
+ abort ();
+}
+
+void
+f2 (int i, int j, int k, int l, int m, int n, int o, struct A x, int p, int q)
+{
+ if (i != 6 || j != 0 || k != 1 || l != 2 || m != 3 || n != 4 || o != 5 || p != 7 || q != 8)
+ abort ();
+}
+
+void
+f3 (int i, int j, int k, int l, int m, int n, int o, struct B x, int p, int q)
+{
+ if (i != 6 || j != 0 || k != 1 || l != 2 || m != 3 || n != 4 || o != 5 || p != 7 || q != 8)
+ abort ();
+}
+
+void
+f4 (int i, int j, int k, int l, int m, int n, int o, struct C x, int p, int q)
+{
+ if (i != 6 || j != 0 || k != 1 || l != 2 || m != 3 || n != 4 || o != 5 || p != 7 || q != 8)
+ abort ();
+}
+
+void
+f5 (int o, struct A x)
+{
+ if (o != 5)
+ abort ();
+}
+
+void
+f6 (int o, struct A x, int p, int q)
+{
+ if (o != 5 || p != 7 || q != 8)
+ abort ();
+}
+
+void
+f7 (int o, struct B x, int p, int q)
+{
+ if (o != 5 || p != 7 || q != 8)
+ abort ();
+}
+
+void
+f8 (int o, struct C x, int p, int q)
+{
+ if (o != 5 || p != 7 || q != 8)
+ abort ();
+}
--- /dev/null
+#include "pr83487-1.h"
+
+struct A a;
+struct B b;
+struct C c;
+
+extern void f1 (int i, int j, int k, int l, int m, int n, int o, struct A);
+extern void f2 (int i, int j, int k, int l, int m, int n, int o, struct A, int p, int q);
+extern void f3 (int i, int j, int k, int l, int m, int n, int o, struct B, int p, int q);
+extern void f4 (int i, int j, int k, int l, int m, int n, int o, struct C, int p, int q);
+extern void f5 (int o, struct A);
+extern void f6 (int o, struct A, int p, int q);
+extern void f7 (int o, struct B, int p, int q);
+extern void f8 (int o, struct C, int p, int q);
+
+void
+do_test ()
+{
+ f1 (6, 0, 1, 2, 3, 4, 5, a);
+ f2 (6, 0, 1, 2, 3, 4, 5, a, 7, 8);
+ f3 (6, 0, 1, 2, 3, 4, 5, b, 7, 8);
+ f4 (6, 0, 1, 2, 3, 4, 5, c, 7, 8);
+ f5 (5, a);
+ f6 (5, a, 7, 8);
+ f7 (5, b, 7, 8);
+ f8 (5, c, 7, 8);
+}
--- /dev/null
+#include "pr83487-1_main.c"
--- /dev/null
+#define PR83487_LARGE
+#include "pr83487-1_x.c"
--- /dev/null
+#define PR83487_LARGE
+#include "pr83487-1_y.c"