From: John David Anglin Date: Fri, 7 Feb 2003 22:59:30 +0000 (+0000) Subject: pa.c (output_millicode_call): Use $PIC_pcrel$0 for long PIC millicode calls when... X-Git-Tag: releases/gcc-3.2.3~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b34046d651a37e1a8954789590327e57e972e6b8;p=thirdparty%2Fgcc.git pa.c (output_millicode_call): Use $PIC_pcrel$0 for long PIC millicode calls when... * pa.c (output_millicode_call): Use $PIC_pcrel$0 for long PIC millicode calls when !TARGET_SOM and TARGET_GAS is true. * pa.md (jump): Likewise. From-SVN: r62556 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a458046d03b0..257001738cb3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-02-07 John David Anglin + + * pa.c (output_millicode_call): Use $PIC_pcrel$0 for long PIC + millicode calls when !TARGET_SOM and TARGET_GAS is true. + * pa.md (jump): Likewise. + 2003-02-06 Eric Botcazou Richard Henderson diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 18c7fbdb2789..0e17b4e34a91 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -5926,10 +5926,19 @@ output_millicode_call (insn, call_dest) output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands); /* Add %r1 to the offset of our target from the next insn. */ - output_asm_insn ("addil L%%%0-%1,%%r1", xoperands); - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", - CODE_LABEL_NUMBER (xoperands[1])); - output_asm_insn ("ldo R%%%0-%1(%%r1),%%r1", xoperands); + if (TARGET_SOM || !TARGET_GAS) + { + output_asm_insn ("addil L%%%0-%1,%%r1", xoperands); + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", + CODE_LABEL_NUMBER (xoperands[1])); + output_asm_insn ("ldo R%%%0-%1(%%r1),%%r1", xoperands); + } + else + { + output_asm_insn ("addil L'%0-$PIC_pcrel$0+8,%%r1", xoperands); + output_asm_insn ("ldo R'%0-$PIC_pcrel$0+12(%%r1),%%r1", + xoperands); + } /* Get the return address into %r31. */ output_asm_insn ("blr 0,%3", xoperands); diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index e1a5364dd50b..df26bdfc14d0 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5681,12 +5681,21 @@ xoperands[0] = operands[0]; xoperands[1] = gen_label_rtx (); - output_asm_insn (\"{bl|b,l} .+8,%%r1\\n\\taddil L'%l0-%l1,%%r1\", - xoperands); - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", - CODE_LABEL_NUMBER (xoperands[1])); - output_asm_insn (\"ldo R'%l0-%l1(%%r1),%%r1\\n\\tbv %%r0(%%r1)\", - xoperands); + if (TARGET_SOM || !TARGET_GAS) + { + output_asm_insn (\"{bl|b,l} .+8,%%r1\\n\\taddil L'%l0-%l1,%%r1\", + xoperands); + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", + CODE_LABEL_NUMBER (xoperands[1])); + output_asm_insn (\"ldo R'%l0-%l1(%%r1),%%r1\\n\\tbv %%r0(%%r1)\", + xoperands); + } + else + { + output_asm_insn (\"{bl|b,l} .+8,%%r1\", xoperands); + output_asm_insn (\"addil L'%l0-$PIC_pcrel$0+4,%%r1\", xoperands); + output_asm_insn (\"ldo R'%l0-$PIC_pcrel$0+8(%%r1),%%r1\", xoperands); + } } else output_asm_insn (\"ldil L'%l0,%%r1\\n\\tbe R'%l0(%%sr4,%%r1)\", operands);;