This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH target/16559: Incorrect code generated for function pointer
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Jul 2004 22:43:17 -0700
- Subject: PATCH target/16559: Incorrect code generated for function pointer
Here is a testcase patch for gcc 3.3.
H.J.
---
2004-07-19 H.J. Lu <hongjiu.lu@intel.com>
PR target/16559
* gcc.dg/ia64-fptr-1.c: New file.
--- gcc/testsuite/gcc.dg/ia64-fptr-1.c.fptr 2004-07-19 22:34:43.452485626 -0700
+++ gcc/testsuite/gcc.dg/ia64-fptr-1.c 2004-07-19 22:36:10.988147798 -0700
@@ -0,0 +1,37 @@
+/* { dg-do run { target ia64-*-* } } */
+/* { dg-options "-O2" } */
+
+/* Test function descriptor access. */
+
+extern unsigned long *_GLOBAL_OFFSET_TABLE_;
+extern void abort(void);
+
+struct ia64_fdesc
+{
+ unsigned long func;
+ unsigned long gp;
+};
+
+void
+os_boot_rendez (void)
+{
+}
+
+static int
+check (unsigned long gp)
+{
+ return gp != (unsigned long) &_GLOBAL_OFFSET_TABLE_;
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ int res = 0;
+
+ for (i = 0; i < 1; i++)
+ res += check (((struct ia64_fdesc *) os_boot_rendez)->gp);
+ if (res)
+ abort ();
+ return res;
+}