PATCH: PR target/31628: stdcall function is miscompiled

H. J. Lu hjl@lucon.org
Fri May 18 15:58:00 GMT 2007


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



More information about the Gcc-patches mailing list