aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2008-03-11 23:37:11 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2008-03-11 23:37:11 +0000
commit9dbd54bebbd5a8bd2041ee0aed885b6005d57822 (patch)
treed6bba49c62a890cfdc564a3f9c7b0ec38bd48069 /gcc/config
parent76a7d3ca5162b468a9d44ecbc3efcd2ecfd15f9a (diff)
downloadgcc-9dbd54bebbd5a8bd2041ee0aed885b6005d57822.zip
gcc-9dbd54bebbd5a8bd2041ee0aed885b6005d57822.tar.gz
gcc-9dbd54bebbd5a8bd2041ee0aed885b6005d57822.tar.bz2
pa.h (TARGET_LONG_PIC_SDIFF_CALL): Conditionalize define on TARGET_HPUX.
* pa.h (TARGET_LONG_PIC_SDIFF_CALL): Conditionalize define on TARGET_HPUX. Revise comment. (TARGET_LONG_PIC_PCREL_CALL): Revise comment. * pa.c (output_call): Update for revised TARGET_LONG_PIC_SDIFF_CALL. Use sr4 variant of `be' instruction when not generating PIC code. (attr_length_call): Adjust for above change. From-SVN: r133123
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/pa/pa.c24
-rw-r--r--gcc/config/pa/pa.h23
2 files changed, 23 insertions, 24 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index c270e4b..8076c40 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -7417,14 +7417,13 @@ attr_length_call (rtx insn, int sibcall)
length += 12;
/* long pc-relative branch sequence. */
- else if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
- || (TARGET_64BIT && !TARGET_GAS)
+ else if (TARGET_LONG_PIC_SDIFF_CALL
|| (TARGET_GAS && !TARGET_SOM
&& (TARGET_LONG_PIC_PCREL_CALL || local_call)))
{
length += 20;
- if (!TARGET_PA_20 && !TARGET_NO_SPACE_REGS)
+ if (!TARGET_PA_20 && !TARGET_NO_SPACE_REGS && flag_pic)
length += 8;
}
@@ -7444,7 +7443,7 @@ attr_length_call (rtx insn, int sibcall)
if (!sibcall)
length += 8;
- if (!TARGET_NO_SPACE_REGS)
+ if (!TARGET_NO_SPACE_REGS && flag_pic)
length += 8;
}
}
@@ -7528,7 +7527,7 @@ output_call (rtx insn, rtx call_dest, int sibcall)
of increasing length and complexity. In most cases,
they don't allow an instruction in the delay slot. */
if (!((TARGET_LONG_ABS_CALL || local_call) && !flag_pic)
- && !(TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
+ && !TARGET_LONG_PIC_SDIFF_CALL
&& !(TARGET_GAS && !TARGET_SOM
&& (TARGET_LONG_PIC_PCREL_CALL || local_call))
&& !TARGET_64BIT)
@@ -7574,13 +7573,12 @@ output_call (rtx insn, rtx call_dest, int sibcall)
}
else
{
- if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
- || (TARGET_64BIT && !TARGET_GAS))
+ if (TARGET_LONG_PIC_SDIFF_CALL)
{
/* The HP assembler and linker can handle relocations
- for the difference of two symbols. GAS and the HP
- linker can't do this when one of the symbols is
- external. */
+ for the difference of two symbols. The HP assembler
+ recognizes the sequence as a pc-relative call and
+ the linker provides stubs when needed. */
xoperands[1] = gen_label_rtx ();
output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands);
output_asm_insn ("addil L'%0-%l1,%%r1", xoperands);
@@ -7665,20 +7663,20 @@ output_call (rtx insn, rtx call_dest, int sibcall)
}
else
{
- if (!TARGET_NO_SPACE_REGS)
+ if (!TARGET_NO_SPACE_REGS && flag_pic)
output_asm_insn ("ldsid (%%r1),%%r31\n\tmtsp %%r31,%%sr0",
xoperands);
if (sibcall)
{
- if (TARGET_NO_SPACE_REGS)
+ if (TARGET_NO_SPACE_REGS || !flag_pic)
output_asm_insn ("be 0(%%sr4,%%r1)", xoperands);
else
output_asm_insn ("be 0(%%sr0,%%r1)", xoperands);
}
else
{
- if (TARGET_NO_SPACE_REGS)
+ if (TARGET_NO_SPACE_REGS || !flag_pic)
output_asm_insn ("ble 0(%%sr4,%%r1)", xoperands);
else
output_asm_insn ("ble 0(%%sr0,%%r1)", xoperands);
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index f8cf9d2..07f675e 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -101,17 +101,18 @@ extern int flag_pa_unix;
calls. They are used only in non-pic code. */
#define TARGET_LONG_ABS_CALL (TARGET_SOM && !TARGET_GAS)
-/* Define to a C expression evaluating to true to use long pic symbol
- difference calls. This is a call variant similar to the long pic
- pc-relative call. Long pic symbol difference calls are only used with
- the HP SOM linker. Currently, only the HP assembler supports these
- calls. GAS doesn't allow an arbitrary difference of two symbols. */
-#define TARGET_LONG_PIC_SDIFF_CALL (!TARGET_GAS)
-
-/* Define to a C expression evaluating to true to use long pic
- pc-relative calls. Long pic pc-relative calls are only used with
- GAS. Currently, they are usable for calls within a module but
- not for external calls. */
+/* Define to a C expression evaluating to true to use long PIC symbol
+ difference calls. Long PIC symbol difference calls are only used with
+ the HP assembler and linker. The HP assembler detects this instruction
+ sequence and treats it as long pc-relative call. Currently, GAS only
+ allows a difference of two symbols in the same subspace, and it doesn't
+ detect the sequence as a pc-relative call. */
+#define TARGET_LONG_PIC_SDIFF_CALL (!TARGET_GAS && TARGET_HPUX)
+
+/* Define to a C expression evaluating to true to use long PIC
+ pc-relative calls. Long PIC pc-relative calls are only used with
+ GAS. Currently, they are usable for calls which bind local to a
+ module but not for external calls. */
#define TARGET_LONG_PIC_PCREL_CALL 0
/* Define to a C expression evaluating to true to use SOM secondary