Commit 823fbbce by John David Anglin Committed by John David Anglin

pa-linux.h (INCOMING_RETURN_ADDR_RTX): Move.

	* pa-linux.h (INCOMING_RETURN_ADDR_RTX): Move.
	(DWARF_FRAME_RETURN_COLUMN): Move.
	(ASM_PREFERRED_EH_DATA_FORMAT): Define.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Define.
	* pa.c (except.h, predict.h): Include.
	(FRP): Delete.
	(store_reg_modify, set_reg_plus_d): Revise prototypes.
	(output_ascii): Add cast.
	(store_reg_modify): Revise to add frame notes.
	(set_reg_plus_d): Likewise.
	(compute_frame_size): Include space for eh data registers in frame if
	the current function calls eh_return.
	(hppa_expand_prologue):  Ensure register %r2 is saved if the current
	function calls eh_return.  Save eh data registers if the current
	function calls eh_return.  Fix code to add frame notes.  Emit
	blockage to prevent insns with frame notes being scheduled in the
	delay slot of calls.
	(hppa_expand_epilogue): Restore eh data registers and do final stack
	adjustment if the current function calls eh_return.  Don't add frame
	notes.
	(output_call): Revise for change in length of call insn.  Don't do
	return pointer adjustment for an unconditional jump in the delay slot
	of a call when using frame notes.
	* pa.h (EH_RETURN_DATA_REGNO): Revise for TARGET_64BIT compatibility.
	(EH_RETURN_HANDLER_RTX): Use saved value on stack.
	(ARG_POINTER_CFA_OFFSET): Define.
	* pa.md (return_external_pic): New pattern.
	(prologue): Correct formatting.  Use return_external_pic if current
	function calls eh_return.
	(call_internal_symref, call_value_internal_symref,
	sibcall_internal_symref, sibcall_value_internal_symref): Change default
	lengths of short, long non-pic, and long pic calls to 8, 68, and 84,
	respectively.
	(exception_receiver): Use hppa_pic_save_rtx () to restore pic register.

	* configure.in ("assembler dwarf2 debug_line support"): Add hppa*-*-* to
	list of targets to check using "nop" insn.
	* configure: Rebuilt.

From-SVN: r51836
parent 4078e224
2002-04-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa-linux.h (INCOMING_RETURN_ADDR_RTX): Move.
(DWARF_FRAME_RETURN_COLUMN): Move.
(ASM_PREFERRED_EH_DATA_FORMAT): Define.
(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Define.
* pa.c (except.h, predict.h): Include.
(FRP): Delete.
(store_reg_modify, set_reg_plus_d): Revise prototypes.
(output_ascii): Add cast.
(store_reg_modify): Revise to add frame notes.
(set_reg_plus_d): Likewise.
(compute_frame_size): Include space for eh data registers in frame if
the current function calls eh_return.
(hppa_expand_prologue): Ensure register %r2 is saved if the current
function calls eh_return. Save eh data registers if the current
function calls eh_return. Fix code to add frame notes. Emit
blockage to prevent insns with frame notes being scheduled in the
delay slot of calls.
(hppa_expand_epilogue): Restore eh data registers and do final stack
adjustment if the current function calls eh_return. Don't add frame
notes.
(output_call): Revise for change in length of call insn. Don't do
return pointer adjustment for an unconditional jump in the delay slot
of a call when using frame notes.
* pa.h (EH_RETURN_DATA_REGNO): Revise for TARGET_64BIT compatibility.
(EH_RETURN_HANDLER_RTX): Use saved value on stack.
(ARG_POINTER_CFA_OFFSET): Define.
* pa.md (return_external_pic): New pattern.
(prologue): Correct formatting. Use return_external_pic if current
function calls eh_return.
(call_internal_symref, call_value_internal_symref,
sibcall_internal_symref, sibcall_value_internal_symref): Change default
lengths of short, long non-pic, and long pic calls to 8, 68, and 84,
respectively.
(exception_receiver): Use hppa_pic_save_rtx () to restore pic register.
* configure.in ("assembler dwarf2 debug_line support"): Add hppa*-*-* to
list of targets to check using "nop" insn.
* configure: Rebuilt.
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/t-linux64 (EXTRA_MULTILIB_PARTS): Define.
......
......@@ -24,6 +24,39 @@ Boston, MA 02111-1307, USA. */
#define DWARF2_ASM_LINE_DEBUG_INFO 1
#define DWARF2_UNWIND_INFO 1
/* A C expression whose value is RTL representing the location of the
incoming return address at the beginning of any function, before the
prologue. You only need to define this macro if you want to support
call frame debugging information like that provided by DWARF 2. */
#define INCOMING_RETURN_ADDR_RTX (gen_rtx_REG (word_mode, 2))
#define DWARF_FRAME_RETURN_COLUMN (DWARF_FRAME_REGNUM (2))
/* This macro chooses the encoding of pointers embedded in the exception
handling sections. If at all possible, this should be defined such
that the exception handling section will not require dynamic relocations,
and so may be read-only.
FIXME: We use DW_EH_PE_aligned to output a PLABEL constructor for
global function pointers. */
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(CODE == 2 && GLOBAL ? DW_EH_PE_aligned : DW_EH_PE_absptr)
/* Handle special EH pointer encodings. Absolute, pc-relative, and
indirect are handled automatically. Since pc-relative encoding is
not possible on the PA and we don't have the infrastructure for
data relative encoding, we use aligned plabels for global function
pointers. */
#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
do { \
if (((ENCODING) & 0x0F) == DW_EH_PE_aligned) \
{ \
fputs (integer_asm_op (SIZE, FALSE), FILE); \
fputs ("P%", FILE); \
assemble_name (FILE, XSTR (ADDR, 0)); \
goto DONE; \
} \
} while (0)
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian"
......@@ -64,12 +97,6 @@ Boston, MA 02111-1307, USA. */
else \
readonly_data_section ();
/* A C expression whose value is RTL representing the location of the
incoming return address at the beginning of any function, before the
prologue. */
#define INCOMING_RETURN_ADDR_RTX (gen_rtx_REG (word_mode, 2))
#define DWARF_FRAME_RETURN_COLUMN (DWARF_FRAME_REGNUM (2))
/* Define the strings used for the special svr4 .type and .size directives.
These strings generally do not vary from one system running svr4 to
another, but if a given system (e.g. m88k running svr) needs to use
......
......@@ -506,10 +506,22 @@ extern struct rtx_def *hppa_pic_save_rtx PARAMS ((void));
#define STRUCT_VALUE_REGNUM 28
/* Describe how we implement __builtin_eh_return. */
/* FIXME: What's a good choice for the EH data registers on TARGET_64BIT? */
#define EH_RETURN_DATA_REGNO(N) \
((N) < 3 ? (N) + 20 : (N) == 4 ? 31 : INVALID_REGNUM)
(TARGET_64BIT \
? ((N) < 4 ? (N) + 4 : INVALID_REGNUM) \
: ((N) < 3 ? (N) + 20 : (N) == 4 ? 31 : INVALID_REGNUM))
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 29)
#define EH_RETURN_HANDLER_RTX gen_rtx_REG (Pmode, 2)
#define EH_RETURN_HANDLER_RTX \
gen_rtx_MEM (word_mode, \
gen_rtx_PLUS (word_mode, frame_pointer_rtx, \
TARGET_64BIT ? GEN_INT (-16) : GEN_INT (-20)))
/* Offset from the argument pointer register value to the top of
stack. This is different from FIRST_PARM_OFFSET because of the
frame marker. */
#define ARG_POINTER_CFA_OFFSET(FNDECL) 0
/* The letters I, J, K, L and M in a register constraint string
can be used to stand for particular ranges of immediate operands.
......
......@@ -5568,6 +5568,21 @@
[(set_attr "type" "branch")
(set_attr "length" "4")])
;; Use the PIC register to ensure it's restored after a
;; call in PIC mode. This is used for eh returns which
;; bypass the return stub.
(define_insn "return_external_pic"
[(return)
(use (match_operand 0 "register_operand" "r"))
(use (reg:SI 2))
(clobber (reg:SI 1))]
"flag_pic
&& current_function_calls_eh_return
&& true_regnum (operands[0]) == PIC_OFFSET_TABLE_REGNUM"
"ldsid (%%sr0,%%r2),%%r1\;mtsp %%r1,%%sr0\;be%* 0(%%sr0,%%r2)"
[(set_attr "type" "branch")
(set_attr "length" "12")])
(define_expand "prologue"
[(const_int 0)]
""
......@@ -5590,15 +5605,24 @@
/* Try to use the trivial return first. Else use the full
epilogue. */
if (hppa_can_use_return_insn_p ())
emit_jump_insn (gen_return ());
emit_jump_insn (gen_return ());
else
{
rtx x;
hppa_expand_epilogue ();
if (flag_pic)
x = gen_return_internal_pic (gen_rtx_REG (word_mode,
PIC_OFFSET_TABLE_REGNUM));
{
rtx pic = gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM);
/* EH returns bypass the normal return stub. Thus, we must do an
interspace branch to return from functions that call eh_return.
This is only a problem for returns from shared code. */
if (current_function_calls_eh_return)
x = gen_return_external_pic (pic);
else
x = gen_return_internal_pic (pic);
}
else
x = gen_return_internal ();
emit_jump_insn (x);
......@@ -5856,18 +5880,19 @@
[(set_attr "type" "call")
(set (attr "length")
;; If we're sure that we can either reach the target or that the
;; linker can use a long-branch stub, then the length is 4 bytes.
;; linker can use a long-branch stub, then the length is at most
;; 8 bytes.
;;
;; For long-calls the length will be either 52 bytes (non-pic)
;; or 68 bytes (pic). */
;; For long-calls the length will be at most 68 bytes (non-pic)
;; or 84 bytes (pic). */
;; Else we have to use a long-call;
(if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
(const_int 240000))
(const_int 4)
(const_int 8)
(if_then_else (eq (symbol_ref "flag_pic")
(const_int 0))
(const_int 52)
(const_int 68))))])
(const_int 68)
(const_int 84))))])
(define_insn "call_internal_reg_64bit"
[(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
......@@ -6029,18 +6054,19 @@
[(set_attr "type" "call")
(set (attr "length")
;; If we're sure that we can either reach the target or that the
;; linker can use a long-branch stub, then the length is 4 bytes.
;; linker can use a long-branch stub, then the length is at most
;; 8 bytes.
;;
;; For long-calls the length will be either 52 bytes (non-pic)
;; or 68 bytes (pic). */
;; For long-calls the length will be at most 68 bytes (non-pic)
;; or 84 bytes (pic). */
;; Else we have to use a long-call;
(if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
(const_int 240000))
(const_int 4)
(const_int 8)
(if_then_else (eq (symbol_ref "flag_pic")
(const_int 0))
(const_int 52)
(const_int 68))))])
(const_int 68)
(const_int 84))))])
(define_insn "call_value_internal_reg_64bit"
[(set (match_operand 0 "" "=rf")
......@@ -6200,18 +6226,19 @@
[(set_attr "type" "call")
(set (attr "length")
;; If we're sure that we can either reach the target or that the
;; linker can use a long-branch stub, then the length is 4 bytes.
;; linker can use a long-branch stub, then the length is at most
;; 8 bytes.
;;
;; For long-calls the length will be either 52 bytes (non-pic)
;; or 68 bytes (pic). */
;; For long-calls the length will be at most 68 bytes (non-pic)
;; or 84 bytes (pic). */
;; Else we have to use a long-call;
(if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
(const_int 240000))
(const_int 4)
(const_int 8)
(if_then_else (eq (symbol_ref "flag_pic")
(const_int 0))
(const_int 52)
(const_int 68))))])
(const_int 68)
(const_int 84))))])
(define_expand "sibcall_value"
[(parallel [(set (match_operand 0 "" "")
......@@ -6258,18 +6285,19 @@
[(set_attr "type" "call")
(set (attr "length")
;; If we're sure that we can either reach the target or that the
;; linker can use a long-branch stub, then the length is 4 bytes.
;; linker can use a long-branch stub, then the length is at most
;; 8 bytes.
;;
;; For long-calls the length will be either 52 bytes (non-pic)
;; or 68 bytes (pic). */
;; For long-calls the length will be at most 68 bytes (non-pic)
;; or 84 bytes (pic). */
;; Else we have to use a long-call;
(if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
(const_int 240000))
(const_int 4)
(const_int 8)
(if_then_else (eq (symbol_ref "flag_pic")
(const_int 0))
(const_int 52)
(const_int 68))))])
(const_int 68)
(const_int 84))))])
(define_insn "nop"
[(const_int 0)]
......@@ -7216,16 +7244,12 @@
;; restore the PIC register.
(define_expand "exception_receiver"
[(const_int 4)]
"!TARGET_PORTABLE_RUNTIME && flag_pic"
"flag_pic"
"
{
/* Load the PIC register from the stack slot (in our caller's
frame). */
emit_move_insn (pic_offset_table_rtx,
gen_rtx_MEM (SImode,
plus_constant (stack_pointer_rtx, -32)));
emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
emit_insn (gen_blockage ());
/* Restore the PIC register using hppa_pic_save_rtx (). The
PIC register is not saved in the frame in 64-bit ABI. */
emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
DONE;
}")
......
......@@ -2229,7 +2229,7 @@ EOF
fi
# Find some useful tools
for ac_prog in gawk mawk nawk awk
for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
......@@ -7480,7 +7480,7 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
echo "configure:7430: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
echo "configure:7484: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7522,7 +7522,7 @@ EOF
case "$tm_file" in
*64*)
echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6
echo "configure:7487: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
echo "configure:7526: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7567,7 +7567,7 @@ EOF
if test "x$gcc_cv_as_flags64" != xno; then
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
echo "configure:7532: checking for assembler offsetable %lo() support" >&5
echo "configure:7571: checking for assembler offsetable %lo() support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -7607,7 +7607,7 @@ EOF
i[34567]86-*-* | x86_64-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
echo "configure:7572: checking assembler instructions" >&5
echo "configure:7611: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
......@@ -7634,7 +7634,7 @@ EOF
echo "$ac_t""$gcc_cv_as_instructions" 1>&6
echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
echo "configure:7599: checking assembler GOTOFF in data directives" >&5
echo "configure:7638: checking assembler GOTOFF in data directives" >&5
gcc_cv_as_gotoff_in_data=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
then
......@@ -7664,7 +7664,7 @@ EOF
esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
echo "configure:7629: checking assembler dwarf2 debug_line support" >&5
echo "configure:7668: checking assembler dwarf2 debug_line support" >&5
gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
......@@ -7673,7 +7673,7 @@ gcc_cv_as_dwarf2_debug_line=no
# ??? Once 2.11 is released, probably need to add first known working
# version to the per-target configury.
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-*)
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-* | hppa*-*-*)
insn="nop"
;;
ia64*-*-*)
......@@ -7720,7 +7720,7 @@ fi
echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
echo "configure:7685: checking assembler --gdwarf2 support" >&5
echo "configure:7724: checking assembler --gdwarf2 support" >&5
gcc_cv_as_gdwarf2_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
......@@ -7749,7 +7749,7 @@ fi
echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
echo "configure:7714: checking assembler --gstabs support" >&5
echo "configure:7753: checking assembler --gstabs support" >&5
gcc_cv_as_gstabs_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
......@@ -7777,7 +7777,7 @@ fi
echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
echo "configure:7742: checking linker PT_GNU_EH_FRAME support" >&5
echo "configure:7781: checking linker PT_GNU_EH_FRAME support" >&5
gcc_cv_ld_eh_frame_hdr=no
if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
......@@ -7940,7 +7940,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
echo "configure:7905: checking whether to enable maintainer-specific portions of Makefiles" >&5
echo "configure:7944: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
......
......@@ -1929,7 +1929,7 @@ gcc_cv_as_dwarf2_debug_line=no
# ??? Once 2.11 is released, probably need to add first known working
# version to the per-target configury.
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-*)
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-* | hppa*-*-*)
insn="nop"
;;
ia64*-*-*)
......
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