+2003-11-28 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/builtin-apply2.c: Set size of stack argument data to 64.
+ * gcc.dg/builtin-apply3.c: New test.
+
2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
* lib/compat.exp (compat-obj): New xfaildata parameter.
#define INTEGER_ARG 5
-typedef __SIZE_TYPE__ size_t;
-
extern void abort(void);
void foo(char *name, double d, double e, double f, int g)
void bar(char *name, ...)
{
- size_t size;
- void *arguments;
-
- size = sizeof(char *) + 3 * sizeof(double) + sizeof(int);
-
- arguments = __builtin_apply_args();
-
- __builtin_apply(foo, arguments, size);
+ __builtin_apply(foo, __builtin_apply_args(), 64);
}
int main(void)
--- /dev/null
+/* PR middle-end/12210 */
+/* Origin: Ossadchy Yury A. <waspcoder@mail.ru> */
+
+/* This used to fail on i686 because the argument was not copied
+ to the right location by __builtin_apply after the direct call. */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(int arg)
+{
+ if (arg != INTEGER_ARG)
+ abort();
+}
+
+void bar(int arg)
+{
+ foo(arg);
+ __builtin_apply(foo, __builtin_apply_args(), 16);
+}
+
+int main(void)
+{
+ bar(INTEGER_ARG);
+
+ return 0;
+}