Commit 62910663 by John David Anglin Committed by John David Anglin

pa.c (update_total_code_bytes): Use new macro IN_NAMED_SECTION_P.

	* pa.c (update_total_code_bytes): Use new macro IN_NAMED_SECTION_P.
	(attr_length_millicode_call): Likewise.
	(attr_length_call): Likewise.  Revise some maximum insn lengths.
	(attr_length_indirect_call): Likewise.
	(output_call): Fix thinko that added extra nop.
	* pa.h (IN_NAMED_SECTION_P): Define.

From-SVN: r70241
parent cb99b61a
2003-08-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2003-08-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.c (update_total_code_bytes): Use new macro IN_NAMED_SECTION_P.
(attr_length_millicode_call): Likewise.
(attr_length_call): Likewise. Revise some maximum insn lengths.
(attr_length_indirect_call): Likewise.
(output_call): Fix thinko that added extra nop.
* pa.h (IN_NAMED_SECTION_P): Define.
PR c++/11712 PR c++/11712
* pa-hpux.h, pa-hpux10.h, pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define * pa-hpux.h, pa-hpux10.h, pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define
__STDC_EXT__ when using C++ dialect. __STDC_EXT__ when using C++ dialect.
......
...@@ -3694,7 +3694,7 @@ update_total_code_bytes (nbytes) ...@@ -3694,7 +3694,7 @@ update_total_code_bytes (nbytes)
int nbytes; int nbytes;
{ {
if ((TARGET_PORTABLE_RUNTIME || !TARGET_GAS || !TARGET_SOM) if ((TARGET_PORTABLE_RUNTIME || !TARGET_GAS || !TARGET_SOM)
&& in_text_section ()) && !IN_NAMED_SECTION_P (cfun->decl))
{ {
if (INSN_ADDRESSES_SET_P ()) if (INSN_ADDRESSES_SET_P ())
{ {
...@@ -6571,7 +6571,7 @@ attr_length_millicode_call (insn) ...@@ -6571,7 +6571,7 @@ attr_length_millicode_call (insn)
rtx insn; rtx insn;
{ {
unsigned long distance = -1; unsigned long distance = -1;
unsigned long total = in_text_section () ? total_code_bytes : 0; unsigned long total = IN_NAMED_SECTION_P (cfun->decl) ? 0 : total_code_bytes;
if (INSN_ADDRESSES_SET_P ()) if (INSN_ADDRESSES_SET_P ())
{ {
...@@ -6758,9 +6758,10 @@ output_millicode_call (insn, call_dest) ...@@ -6758,9 +6758,10 @@ output_millicode_call (insn, call_dest)
/* Return the attribute length of the call instruction INSN. The SIBCALL /* Return the attribute length of the call instruction INSN. The SIBCALL
flag indicates whether INSN is a regular call or a sibling call. The flag indicates whether INSN is a regular call or a sibling call. The
length must match the code generated by output_call. We include the delay length returned must be longer than the code generated by output_call.
slot in the returned length as it is better to over estimate the length When the target supports jumps in the delay slot, we need an extra
than to under estimate it. */ four bytes to handle the situation where the jump can't reach its
destination. */
int int
attr_length_call (insn, sibcall) attr_length_call (insn, sibcall)
...@@ -6768,7 +6769,7 @@ attr_length_call (insn, sibcall) ...@@ -6768,7 +6769,7 @@ attr_length_call (insn, sibcall)
int sibcall; int sibcall;
{ {
unsigned long distance = -1; unsigned long distance = -1;
unsigned long total = in_text_section ()? total_code_bytes : 0; unsigned long total = IN_NAMED_SECTION_P (cfun->decl) ? 0 : total_code_bytes;
if (INSN_ADDRESSES_SET_P ()) if (INSN_ADDRESSES_SET_P ())
{ {
...@@ -6793,7 +6794,7 @@ attr_length_call (insn, sibcall) ...@@ -6793,7 +6794,7 @@ attr_length_call (insn, sibcall)
return 8; return 8;
if (TARGET_LONG_ABS_CALL && !flag_pic) if (TARGET_LONG_ABS_CALL && !flag_pic)
return 12; return 16;
if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL) if ((TARGET_SOM && TARGET_LONG_PIC_SDIFF_CALL)
|| (TARGET_GAS && TARGET_LONG_PIC_PCREL_CALL)) || (TARGET_GAS && TARGET_LONG_PIC_PCREL_CALL))
...@@ -6805,7 +6806,7 @@ attr_length_call (insn, sibcall) ...@@ -6805,7 +6806,7 @@ attr_length_call (insn, sibcall)
} }
else else
{ {
int length = 0; int length = 28;
if (TARGET_SOM) if (TARGET_SOM)
length += length_fp_args (insn); length += length_fp_args (insn);
...@@ -6813,8 +6814,11 @@ attr_length_call (insn, sibcall) ...@@ -6813,8 +6814,11 @@ attr_length_call (insn, sibcall)
if (flag_pic) if (flag_pic)
length += 4; length += 4;
if (!sibcall)
length += 4;
if (TARGET_PA_20) if (TARGET_PA_20)
return (length + 32); return length;
if (!TARGET_NO_SPACE_REGS) if (!TARGET_NO_SPACE_REGS)
length += 8; length += 8;
...@@ -6822,7 +6826,7 @@ attr_length_call (insn, sibcall) ...@@ -6822,7 +6826,7 @@ attr_length_call (insn, sibcall)
if (!sibcall) if (!sibcall)
length += 8; length += 8;
return (length + 32); return length;
} }
} }
} }
...@@ -7077,7 +7081,7 @@ output_call (insn, call_dest, sibcall) ...@@ -7077,7 +7081,7 @@ output_call (insn, call_dest, sibcall)
} }
} }
if (seq_length == 0 || (delay_insn_deleted && !delay_slot_filled)) if (!delay_slot_filled && (seq_length == 0 || delay_insn_deleted))
output_asm_insn ("nop", xoperands); output_asm_insn ("nop", xoperands);
/* We are done if there isn't a jump in the delay slot. */ /* We are done if there isn't a jump in the delay slot. */
...@@ -7133,7 +7137,7 @@ attr_length_indirect_call (insn) ...@@ -7133,7 +7137,7 @@ attr_length_indirect_call (insn)
rtx insn; rtx insn;
{ {
unsigned long distance = -1; unsigned long distance = -1;
unsigned long total = in_text_section () ? total_code_bytes : 0; unsigned long total = IN_NAMED_SECTION_P (cfun->decl) ? 0 : total_code_bytes;
if (INSN_ADDRESSES_SET_P ()) if (INSN_ADDRESSES_SET_P ())
{ {
......
...@@ -1515,6 +1515,11 @@ do { \ ...@@ -1515,6 +1515,11 @@ do { \
#define TARGET_ASM_SELECT_SECTION pa_select_section #define TARGET_ASM_SELECT_SECTION pa_select_section
/* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION_P(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
&& DECL_SECTION_NAME (DECL) != NULL_TREE)
/* Define this macro if references to a symbol must be treated /* Define this macro if references to a symbol must be treated
differently depending on something about the variable or differently depending on something about the variable or
function named by the symbol (such as what section it is in). function named by the symbol (such as what section it is in).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment