diff options
author | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-01 20:16:04 +0000 |
---|---|---|
committer | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-01 20:16:04 +0000 |
commit | 83accbc0d8c7414cba0520ed917f6ba1819af322 (patch) | |
tree | 12fb6765596785cdd40ed2f4afd15f1223c7721e /gcc/config/vax/vax.c | |
parent | f777f44e36399c3734420141b4c812c2480dfec1 (diff) | |
download | gcc-83accbc0d8c7414cba0520ed917f6ba1819af322.tar.gz |
2002-10-01 Matt Thomas <matt@3am-software.com>
Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (vax-*-netbsdelf*): Enable configuration.
* config/elfos.h (PCC_BITFIELD_TYPE_MATTERS): Define only
if not already defined.
* config/vax/elf.h: New file.
* config/vax/netbsd-elf.h: New file.
* config/vax/vax.c: Include "debug.h".
(vax_output_function_prologue): Add dwarf2 support. Use
MAIN_NAME_P when checking for VMS_TARGET stack adjust.
* config/vax/vax.h (CONST_OK_FOR_LETTER_P): Add cases for
'J' [0..63], 'K' [-128..127], 'L' [-32768..32767],
'M' [0..255], 'N' [0..65535], and, 'O' [-63..-1].
(VAX_ISTREAM_SYNC): Remove.
(INITIALIZE_TRAMPOLINE): Use gen_sync_istream.
(JUMP_TABLES_IN_TEXT_SECTION): Define.
(ASM_OUTPUT_REG_POP): Use reg_names for the stack pointer.
(ASM_OUTPUT_ADDR_VEC_ELT): Use ASM_GENERATE_INTERNAL_LABEL
and assemble_name.
(ASM_OUTPUT_ADDR_DIFF_ELT): Likewise.
(PRINT_OPERAND_PUNCT_VALID_P): Accept '|'.
(PRINT_OPERAND): Output REGISTER_PREFIX for '|'.
(INCOMING_RETURN_ADDR_RTX): Define.
* config/vax/vax.md (VUNSPEC_BLOCKAGE)
(VUNSPEC_SYNC_ISTREAM): Define.
(blockage): Use VUNSPEC_BLOCKAGE.
(sync_istream): New insn.
2002-10-01 Richard Henderson <rth@redhat.com>
* config/vax/vax.md (call_pop, *call_pop, call_value_pop)
(*call_value_pop, call, call_value): Add dwarf2 EH support.
(*call): New insn.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/vax/vax.c')
-rw-r--r-- | gcc/config/vax/vax.c | 56 |
1 files changed, 24 insertions, 32 deletions
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 1a83eba2ff8..f8b0a0d3343 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */ #include "recog.h" #include "expr.h" #include "flags.h" +#include "debug.h" #include "tm_p.h" #include "target.h" #include "target-def.h" @@ -101,40 +102,31 @@ vax_output_function_prologue (file, size) fprintf (file, "\t.word 0x%x\n", mask); - if (VMS_TARGET) + if (dwarf2out_do_frame ()) { - /* - * This works for both gcc and g++. It first checks to see if - * the current routine is "main", which will only happen for - * GCC, and add the jsb if it is. If is not the case then try - * and see if __MAIN_NAME is part of current_function_name, - * which will only happen if we are running g++, and add the jsb - * if it is. In gcc there should never be a paren in the - * function name, and in g++ there is always a "(" in the - * function name, thus there should never be any confusion. - * - * Adjusting the stack pointer by 4 before calling C$MAIN_ARGS - * is required when linking with the VMS POSIX version of the C - * run-time library; using `subl2 $4,r0' is adequate but we use - * `clrl -(sp)' instead. The extra 4 bytes could be removed - * after the call because STARTING_FRAME_OFFSET's setting of -4 - * will end up adding them right back again, but don't bother. - */ - - const char *p = current_function_name; - int is_main = strcmp ("main", p) == 0; -# define __MAIN_NAME " main(" - - while (!is_main && *p != '\0') - { - if (*p == *__MAIN_NAME - && strncmp (p, __MAIN_NAME, sizeof __MAIN_NAME - sizeof "") == 0) - is_main = 1; - else - p++; - } + const char *label = dwarf2out_cfi_label (); + int offset = 0; + + for (regno = FIRST_PSEUDO_REGISTER-1; regno >= 0; --regno) + if (regs_ever_live[regno] && !call_used_regs[regno]) + dwarf2out_reg_save (label, regno, offset -= 4); - if (is_main) + dwarf2out_reg_save (label, PC_REGNUM, offset -= 4); + dwarf2out_reg_save (label, FRAME_POINTER_REGNUM, offset -= 4); + dwarf2out_reg_save (label, ARG_POINTER_REGNUM, offset -= 4); + dwarf2out_def_cfa (label, FRAME_POINTER_REGNUM, -(offset - 4)); + } + + if (VMS_TARGET) + { + /* Adjusting the stack pointer by 4 before calling C$MAIN_ARGS + is required when linking with the VMS POSIX version of the C + run-time library; using `subl2 $4,r0' is adequate but we use + `clrl -(sp)' instead. The extra 4 bytes could be removed + after the call because STARTING_FRAME_OFFSET's setting of -4 + will end up adding them right back again, but don't bother. */ + + if (MAIN_NAME_P (DECL_NAME (current_function_decl))) fprintf (file, "\tclrl -(%ssp)\n\tjsb _C$MAIN_ARGS\n", REGISTER_PREFIX); } |