This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR target/31628: stdcall function is miscompiled
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com
- Date: Fri, 18 May 2007 08:57:48 -0700
- Subject: PATCH: PR target/31628: stdcall function is miscompiled
The patch for
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31628
breaks Linux/x86-64:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31989
This patch adds a testcase for PR 31628. OK to install on mainline?
H.J.
---
2007-05-18 H.J. Lu <hongjiu.lu@intel.com>
PR target/31628
* gcc.target/i386/pr31628.c: New.
--- gcc/testsuite/gcc.target/i386/pr31628.c.foo 2007-05-18 08:52:06.000000000 -0700
+++ gcc/testsuite/gcc.target/i386/pr31628.c 2007-05-18 08:50:26.000000000 -0700
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-m32 -fPIC -O2" } */
+
+typedef int tt, *lptt;
+
+int __attribute__((__stdcall__)) bar(lptt);
+
+int __attribute__((__stdcall__)) bar(tt *x)
+{
+ return 0;
+}
+
+int
+foo (void)
+{
+ return bar (0);
+}
+
+int
+main()
+{
+ return foo ();
+}