builtin-apply2.c: Set size of stack argument data to 64.
authorEric Botcazou <ebotcazou@libertysurf.fr>
Fri, 28 Nov 2003 16:35:52 +0000 (17:35 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 28 Nov 2003 16:35:52 +0000 (16:35 +0000)
* gcc.dg/builtin-apply2.c: Set size of stack argument data to 64.
* gcc.dg/builtin-apply3.c: New test.

From-SVN: r74022

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtin-apply2.c
gcc/testsuite/gcc.dg/builtin-apply3.c [new file with mode: 0644]

index cd7670f26c273b66539d01ac307e61e0a62bdea4..cbac84803d49091ddcd3bea34f53769685731c60 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 56b27a1dd17e14de6b78c0fca2df4b67cfb7ffae..a1ba20fce531e34db487e929070b8473263b5a2f 100644 (file)
@@ -9,8 +9,6 @@
 
 #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)
@@ -21,14 +19,7 @@ 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)
diff --git a/gcc/testsuite/gcc.dg/builtin-apply3.c b/gcc/testsuite/gcc.dg/builtin-apply3.c
new file mode 100644 (file)
index 0000000..1335d09
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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;
+}