]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pa.c (output_indirect_call): Only use %r2 as the link register in indirect calls...
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sun, 11 Jul 2004 04:31:51 +0000 (04:31 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 11 Jul 2004 04:31:51 +0000 (04:31 +0000)
* pa.c (output_indirect_call): Only use %r2 as the link register in
indirect calls with the long PA 2.0 pc-relative branch.

From-SVN: r84492

gcc/ChangeLog
gcc/config/pa/pa.c

index 58350654df1b8f44f8f4298757045f00780a6d10..2cde39f75100a24a636e781c32f115a72c1e8fdf 100644 (file)
@@ -1,4 +1,7 @@
-2004-07-09  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+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.
 
        PR target/16459
        * pa.c (output_indirect_call): Use %r2 as the link register when
index 907f0d69432b41dc4e49545970e9134cd4c6cc6f..b3a264588f4d85a3f73ea0b0bba6ed4213e9f38e 100644 (file)
@@ -6932,7 +6932,15 @@ output_indirect_call (insn, call_dest)
      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.  */