]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pa.md (call_internal_reg, [...]): If TARGET_GAS and not TARGET_SOM...
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Fri, 24 Jan 2003 15:51:25 +0000 (15:51 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 24 Jan 2003 15:51:25 +0000 (15:51 +0000)
* pa.md (call_internal_reg, call_value_internal_reg): If TARGET_GAS and
not TARGET_SOM, use $PIC_pcrel$0 rather than symbol difference for long
PIC calls to $$dyncall.
* pa.c (output_call): Likewise.

From-SVN: r61699

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

index 62d07e13c2aa49d19959bc838e2cada1696dc2e8..576d3cad72072d10bd9d474aaace5a29c93620d2 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-24  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * pa.md (call_internal_reg, call_value_internal_reg): If TARGET_GAS and
+       not TARGET_SOM, use $PIC_pcrel$0 rather than symbol difference for long
+       PIC calls to $$dyncall.
+       * pa.c (output_call): Likewise.
+
 2003-01-23  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        PR java/6748
index 533cdd48e89aa34530328ecec316e4fd493a6529..25d52f0e306a95c22fd3922eacb603744b563e58 100644 (file)
@@ -6153,10 +6153,20 @@ output_call (insn, call_dest, sibcall)
              output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands);
 
              /* Add %r1 to the offset of dyncall from the next insn.  */
-             output_asm_insn ("addil L%%$$dyncall-%1,%%r1", xoperands);
-             ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
-                                        CODE_LABEL_NUMBER (xoperands[1]));
-             output_asm_insn ("ldo R%%$$dyncall-%1(%%r1),%%r1", xoperands);
+             if (TARGET_SOM || !TARGET_GAS)
+               {
+                 output_asm_insn ("addil L%%$$dyncall-%1,%%r1", xoperands);
+                 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+                                            CODE_LABEL_NUMBER (xoperands[1]));
+                 output_asm_insn ("ldo R%%$$dyncall-%1(%%r1),%%r1", xoperands);
+               }
+             else
+               {
+                 output_asm_insn ("addil L%%$$dyncall-$PIC_pcrel$0+4,%%r1",
+                                  xoperands);
+                 output_asm_insn ("ldo R%%$$dyncall-$PIC_pcrel$0+8(%%r1),%%r1",
+                                  xoperands);
+               }
 
              /* Get the return address into %r31.  */
              output_asm_insn ("blr %%r0,%%r31", xoperands);
index ce0de67a1a132b6d4763156384ce144fa1841a7b..e1a5364dd50b9f043704dd41db289aca69c142e1 100644 (file)
 
   /* If we're generating PIC code.  */
   xoperands[0] = operands[0];
-  xoperands[1] = gen_label_rtx ();
   output_asm_insn (\"{bl|b,l} .+8,%%r1\", xoperands);
-  output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
-  ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
-                            CODE_LABEL_NUMBER (xoperands[1]));
-  output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
+  if (TARGET_SOM || !TARGET_GAS)
+    {
+      xoperands[1] = gen_label_rtx ();
+      output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
+      ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+                                CODE_LABEL_NUMBER (xoperands[1]));
+      output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
+    }
+  else
+    {
+      output_asm_insn (\"addil L%%$$dyncall-$PIC_pcrel$0+4,%%r1\", xoperands);
+      output_asm_insn (\"ldo R%%$$dyncall-$PIC_pcrel$0+8(%%r1),%%r1\",
+                      xoperands);
+    }
   output_asm_insn (\"blr %%r0,%%r2\", xoperands);
   output_asm_insn (\"bv,n %%r0(%%r1)\\n\\tnop\", xoperands);
   return \"\";
 
   /* If we're generating PIC code.  */
   xoperands[0] = operands[1];
-  xoperands[1] = gen_label_rtx ();
   output_asm_insn (\"{bl|b,l} .+8,%%r1\", xoperands);
-  output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
-  ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
-                            CODE_LABEL_NUMBER (xoperands[1]));
-  output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
+  if (TARGET_SOM || !TARGET_GAS)
+    {
+      xoperands[1] = gen_label_rtx ();
+      output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
+      ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+                                CODE_LABEL_NUMBER (xoperands[1]));
+      output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
+    }
+  else
+    {
+      output_asm_insn (\"addil L%%$$dyncall-$PIC_pcrel$0+4,%%r1\", xoperands);
+      output_asm_insn (\"ldo R%%$$dyncall-$PIC_pcrel$0+8(%%r1),%%r1\",
+                      xoperands);
+    }
   output_asm_insn (\"blr %%r0,%%r2\", xoperands);
   output_asm_insn (\"bv,n %%r0(%%r1)\\n\\tnop\", xoperands);
   return \"\";