This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 ();
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]