Commit 6abc6f40 by Richard Henderson Committed by Richard Henderson

alpha.c (alpha_ra_ever_killed): Inspect the topmost sequence, not whatever we're generating now.

        * alpha.c (alpha_ra_ever_killed): Inspect the topmost sequence,
        not whatever we're generating now.
        * alpha.c (set_frame_related_p, FRP): New.
        (alpha_expand_prologue): Mark frame related insns.
        (alpha_expand_epilogue): Likewise, but with a null FRP.
        * alpha.h (INCOMING_RETURN_ADDR_RTX): New.
        * alpha.md (exception_receiver): New.
        * alpha/crtbegin.asm (.eh_frame): New beginning.
        (__do_frame_setup, __do_frame_takedown): New.
        * alpha/crtend.asm (.eh_frame): New ending.
        * alpha/elf.h (DWARF2_DEBUGGING_INFO): Define.
        (ASM_SPEC): Don't emit both dwarf2 and mdebug.
        (ASM_FILE_START): Don't emit .file for dwarf2.

From-SVN: r22277
parent 07ebc930
Sat Sep 5 22:05:25 1998 Richard Henderson <rth@cygnus.com>
* alpha.c (alpha_ra_ever_killed): Inspect the topmost sequence,
not whatever we're generating now.
* alpha.c (set_frame_related_p, FRP): New.
(alpha_expand_prologue): Mark frame related insns.
(alpha_expand_epilogue): Likewise, but with a null FRP.
* alpha.h (INCOMING_RETURN_ADDR_RTX): New.
* alpha.md (exception_receiver): New.
* alpha/crtbegin.asm (.eh_frame): New beginning.
(__do_frame_setup, __do_frame_takedown): New.
* alpha/crtend.asm (.eh_frame): New ending.
* alpha/elf.h (DWARF2_DEBUGGING_INFO): Define.
(ASM_SPEC): Don't emit both dwarf2 and mdebug.
(ASM_FILE_START): Don't emit .file for dwarf2.
* rtl.h (enum reg_note): Add REG_FRAME_RELATED_EXPR.
* rtl.c (reg_note_name): Likewise.
* rtl.texi (REG_NOTES): Likewise.
......
......@@ -1301,6 +1301,9 @@ extern void alpha_initialize_trampoline ();
#define RETURN_ADDR_RTX alpha_return_addr
extern struct rtx_def *alpha_return_addr ();
/* Before the prologue, RA lives in $26. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)
/* Initialize data used by insn expanders. This is called from insn_emit,
once for every function before code is generated. */
......
......@@ -39,6 +39,7 @@
;; 4 trapb
;; 5 prologue_stack_probe_loop
;; 6 realign
;; 7 exception_receiver
;; Processor type -- this attribute must exactly match the processor_type
;; enumeration in alpha.h.
......@@ -5177,7 +5178,14 @@
(define_insn ""
[(unspec_volatile [(match_operand 0 "" "")] 2)]
"! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT"
"br $27,$LSJ%=\\n$LSJ%=:\;ldgp $29,0($27)"
"br $29,$LSJ%=\\n$LSJ%=:\;ldgp $29,0($29)"
[(set_attr "length" "12")
(set_attr "type" "multi")])
(define_insn "exception_receiver"
[(unspec_volatile [(const_int 0)] 7)]
"! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT"
"br $29,$LSJ%=\\n$LSJ%=:\;ldgp $29,0($29)"
[(set_attr "length" "12")
(set_attr "type" "multi")])
......
......@@ -50,6 +50,8 @@ __CTOR_LIST__:
__DTOR_LIST__:
.quad -1
.section .eh_frame,"aw"
__EH_FRAME_BEGIN__:
#
# Fragment of the ELF _fini routine that invokes our dtor cleanup.
......@@ -67,18 +69,33 @@ __DTOR_LIST__:
1: ldgp $29,0($29)
jsr $26,__do_global_dtors_aux
# Ideally this call would go in crtend.o, except that we can't
# get hold of __EH_FRAME_BEGIN__ there.
jsr $26,__do_frame_takedown
# Must match the alignment we got from crti.o else we get
# zero-filled holes in our _fini function and then SIGILL.
.align 3
#
# Fragment of the ELF _init routine that sets up the frame info.
#
.section .init,"ax"
br $29,1f
1: ldgp $29,0($29)
jsr $26,__do_frame_setup
.align 3
#
# Invoke our destructors in order.
#
.data
# Support recursive calls to exit.
9: .quad __DTOR_LIST__
$ptr: .quad __DTOR_LIST__
.text
......@@ -86,15 +103,14 @@ __DTOR_LIST__:
.ent __do_global_dtors_aux
__do_global_dtors_aux:
ldgp $29,0($27)
lda $30,-16($30)
.frame $30,16,$26,0
stq $9,8($30)
stq $26,0($30)
.mask 0x4000200,-16
.prologue 1
.prologue 0
lda $9,9b
lda $9,$ptr
br 1f
0: stq $1,0($9)
jsr $26,($27)
......@@ -109,3 +125,68 @@ __do_global_dtors_aux:
ret
.end __do_global_dtors_aux
#
# Install our frame info.
#
# ??? How can we rationally keep this size correct?
.section .bss
.type $object,@object
.align 3
$object:
.zero 48
.size $object, 48
.text
.align 3
.ent __do_frame_setup
__do_frame_setup:
ldgp $29,0($27)
lda $30,-16($30)
.frame $30,16,$26,0
stq $26,0($30)
.mask 0x4000000,-16
.prologue 1
lda $1,__register_frame_info
beq $1,0f
lda $16,__EH_FRAME_BEGIN__
lda $17,$object
jsr $26,__register_frame_info
ldq $26,0($30)
0: lda $30,16($30)
ret
.end __do_frame_setup
#
# Remove our frame info.
#
.align 3
.ent __do_frame_takedown
__do_frame_takedown:
ldgp $29,0($27)
lda $30,-16($30)
.frame $30,16,$26,0
stq $26,0($30)
.mask 0x4000000,-16
.prologue 1
lda $1,__deregister_frame_info
beq $1,0f
lda $16,__EH_FRAME_BEGIN__
jsr $26,__deregister_frame_info
ldq $26,0($30)
0: lda $30,16($30)
ret
.end __do_frame_takedown
.weak __register_frame_info
.weak __deregister_frame_info
......@@ -50,6 +50,9 @@ __CTOR_END__:
__DTOR_END__:
.quad 0
.section .eh_frame,"aw"
__FRAME_END__:
.quad 0
#
# Fragment of the ELF _init routine that invokes our ctor startup
......
......@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#define OBJECT_FORMAT_ELF
#define DBX_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
......@@ -34,7 +35,7 @@ Boston, MA 02111-1307, USA. */
#define CC1_SPEC "%{G*}"
#undef ASM_SPEC
#define ASM_SPEC "%{G*} %{relax:-relax}"
#define ASM_SPEC "%{G*} %{relax:-relax} %{gdwarf*:-no-mdebug}"
#undef LINK_SPEC
#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
......@@ -49,18 +50,21 @@ Boston, MA 02111-1307, USA. */
/* Output at beginning of assembler file. */
#undef ASM_FILE_START
#define ASM_FILE_START(FILE) \
{ \
alpha_write_verstamp (FILE); \
output_file_directive (FILE, main_input_filename); \
do { \
if (write_symbols != DWARF2_DEBUG) \
{ \
alpha_write_verstamp (FILE); \
output_file_directive (FILE, main_input_filename); \
} \
fprintf (FILE, "\t.set noat\n"); \
fprintf (FILE, "\t.set noreorder\n"); \
fprintf (FILE, "\t.set noreorder\n"); \
if (TARGET_BWX | TARGET_MAX | TARGET_CIX) \
{ \
fprintf (FILE, "\t.arch %s\n", \
(alpha_cpu == PROCESSOR_EV6 ? "ev6" \
: TARGET_MAX ? "pca56" : "ev56")); \
} \
}
} while (0)
extern void output_file_directive ();
......
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