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]

[committed] Fix millicode calls to $$dyncall under hpux


Unfortunately, the patch installed to fix PR target/16459 broke bootstrap
under hpux because the linker plays games with short pc-relative branches
to $$dyncall.

Tested on hppa-unknown-linux-gnu and hppa2.0-hp-hpux11.00.  Committed
to 3.3/3.4/3.5.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2004-07-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* pa.c (output_indirect_call): Only use %r2 as the link register in
	indirect calls with the long PA 2.0 pc-relative branch.

Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.257
diff -u -3 -p -r1.257 pa.c
--- config/pa/pa.c	9 Jul 2004 20:11:59 -0000	1.257
+++ config/pa/pa.c	10 Jul 2004 05:10:43 -0000
@@ -7545,7 +7545,15 @@ output_indirect_call (rtx insn, rtx call
      No need to check target flags as the length uniquely identifies
      the remaining cases.  */
   if (attr_length_indirect_call (insn) == 8)
-    return ".CALL\tARGW0=GR\n\t{bl|b,l} $$dyncall,%%r2\n\tcopy %%r2,%%r31";
+    {
+      /* The HP linker substitutes a BLE for millicode calls using
+	 the short PIC PCREL form.  Thus, we must use %r31 as the
+	 link register when generating PA 1.x code.  */
+      if (TARGET_PA_20)
+	return ".CALL\tARGW0=GR\n\tb,l $$dyncall,%%r2\n\tcopy %%r2,%%r31";
+      else
+	return ".CALL\tARGW0=GR\n\tbl $$dyncall,%%r31\n\tcopy %%r31,%%r2";
+    }
 
   /* Long millicode call, but we are not generating PIC or portable runtime
      code.  */


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