OSDN Git Service

* config/vax/elf.h (FUNCTION_PROFILER): Fix __mcount call.
[pf3gnuchains/gcc-fork.git] / gcc / config / vax / elf.h
1 /* Target definitions for GNU compiler for VAX using ELF
2    Copyright (C) 2002 Free Software Foundation, Inc.
3    Contributed by Matt Thomas (matt@3am-software.com)
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #undef REGISTER_PREFIX
23 #undef REGISTER_NAMES
24 #define REGISTER_PREFIX "%"
25 #define REGISTER_NAMES \
26 {"%r0", "%r1",  "%r2",  "%r3", "%r4", "%r5", "%r6", "%r7", \
27  "%r8", "%r9", "%r10", "%r11", "%ap", "%fp", "%sp", "%pc"}
28   
29 #undef SIZE_TYPE
30 #define SIZE_TYPE "long unsigned int"
31
32 #undef PTRDIFF_TYPE
33 #define PTRDIFF_TYPE "long int"
34
35 /* Profiling routine.  */
36 #undef FUNCTION_PROFILER
37 #define FUNCTION_PROFILER(FILE, LABELNO)  \
38   fprintf (FILE, "\tmovab .LP%d,%sr0\n\tjsb __mcount\n", (LABELNO), \
39            REGISTER_PREFIX)
40   
41 /*  Let's be re-entrant.  */
42 #undef PCC_STATIC_STRUCT_RETURN
43
44 /* Make sure .stabs for a function are always the same section.  */
45 #define DBX_OUTPUT_FUNCTION_END(file,decl) function_section(decl)
46
47 /* Before the prologue, the top of the frame is below the argument
48    count pushed by the CALLS and before the start of the saved registers.  */
49 #define INCOMING_FRAME_SP_OFFSET 0
50
51 /* We use R2-R5 (call-clobbered) registers for exceptions.  */
52 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 2 : INVALID_REGNUM)
53
54 /* Place the top of the stack for the DWARF2 EH stackadj value.  */
55 #define EH_RETURN_STACKADJ_RTX                                          \
56   gen_rtx_MEM (SImode,                                                  \
57                plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM), \
58                               -4))
59
60 /* Simple store the return handler into the call frame.  */
61 #define EH_RETURN_HANDLER_RTX                                           \
62   gen_rtx_MEM (Pmode,                                                   \
63                plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM), \
64                               16))
65
66
67 /* Reserve the top of the stack for exception handler stackadj value.  */
68 #undef STARTING_FRAME_OFFSET
69 #define STARTING_FRAME_OFFSET -4
70
71 /* The VAX wants no space between the case instruction and the jump table.  */
72 #undef  ASM_OUTPUT_BEFORE_CASE_LABEL
73 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE)
74
75 /* Get the udiv/urem calls out of the user's namespace.  */
76 #undef  UDIVSI3_LIBCALL
77 #define UDIVSI3_LIBCALL "*__udiv"
78 #undef  UMODSI3_LIBCALL
79 #define UMODSI3_LIBCALL "*__urem"
80
81 #undef OVERRIDE_OPTIONS
82 #define OVERRIDE_OPTIONS                        \
83   do                                            \
84     {                                           \
85       /* Do generic VAX overrides.  */          \
86       override_options ();                      \
87                                                 \
88       /* Turn off function CSE if we're         \
89          doing PIC.  */                         \
90       if (flag_pic) flag_no_function_cse = 1;   \
91     }                                           \
92   while (0)
93
94 /* VAX ELF is always gas; override the generic VAX ASM_SPEC.  */
95
96 #undef ASM_SPEC
97 #define ASM_SPEC ""