comparison gcc/config/alpha/vms.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children f6334be47118
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
1 /* Output variables, constants and external declarations, for GNU compiler. 1 /* Output variables, constants and external declarations, for GNU compiler.
2 Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2004, 2005, 2007, 2008 2 Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2004, 2005, 2007, 2008,
3 2009
3 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
4 5
5 This file is part of GCC. 6 This file is part of GCC.
6 7
7 GCC is free software; you can redistribute it and/or modify 8 GCC is free software; you can redistribute it and/or modify
18 along with GCC; see the file COPYING3. If not see 19 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */ 20 <http://www.gnu.org/licenses/>. */
20 21
21 #define TARGET_OBJECT_SUFFIX ".obj" 22 #define TARGET_OBJECT_SUFFIX ".obj"
22 #define TARGET_EXECUTABLE_SUFFIX ".exe" 23 #define TARGET_EXECUTABLE_SUFFIX ".exe"
24
25 /* Alpha/VMS object format is not really Elf, but this makes compiling
26 crtstuff.c and dealing with shared library initialization much easier. */
27 #define OBJECT_FORMAT_ELF
23 28
24 /* This enables certain macros in alpha.h, which will make an indirect 29 /* This enables certain macros in alpha.h, which will make an indirect
25 reference to an external symbol an invalid address. This needs to be 30 reference to an external symbol an invalid address. This needs to be
26 defined before we include alpha.h, since it determines which macros 31 defined before we include alpha.h, since it determines which macros
27 are used for GO_IF_*. */ 32 are used for GO_IF_*. */
48 #undef TARGET_NAME 53 #undef TARGET_NAME
49 #define TARGET_NAME "OpenVMS/Alpha" 54 #define TARGET_NAME "OpenVMS/Alpha"
50 #undef TARGET_VERSION 55 #undef TARGET_VERSION
51 #define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME); 56 #define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME);
52 57
58 #define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
59
53 #undef PCC_STATIC_STRUCT_RETURN 60 #undef PCC_STATIC_STRUCT_RETURN
54 61
55 /* "long" is 32 bits, but 64 bits for Ada. */ 62 /* "long" is 32 bits, but 64 bits for Ada. */
56 #undef LONG_TYPE_SIZE 63 #undef LONG_TYPE_SIZE
57 #define LONG_TYPE_SIZE 32 64 #define LONG_TYPE_SIZE 32
60 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */ 67 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
61 #undef POINTER_SIZE 68 #undef POINTER_SIZE
62 #define POINTER_SIZE 32 69 #define POINTER_SIZE 32
63 #define POINTERS_EXTEND_UNSIGNED 0 70 #define POINTERS_EXTEND_UNSIGNED 0
64 71
72 #define HANDLE_SYSV_PRAGMA 1
73
65 #define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */ 74 #define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
75
76 /* The maximum alignment 'malloc' honors. */
77 #undef MALLOC_ALIGNMENT
78 #define MALLOC_ALIGNMENT ((TARGET_MALLOC64 ? 16 : 8) * BITS_PER_UNIT)
66 79
67 #undef FIXED_REGISTERS 80 #undef FIXED_REGISTERS
68 #define FIXED_REGISTERS \ 81 #define FIXED_REGISTERS \
69 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 82 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
70 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \ 83 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \
127 140
128 /* Define registers used by the epilogue and return instruction. */ 141 /* Define registers used by the epilogue and return instruction. */
129 #undef EPILOGUE_USES 142 #undef EPILOGUE_USES
130 #define EPILOGUE_USES(REGNO) ((REGNO) == 26 || (REGNO) == 29) 143 #define EPILOGUE_USES(REGNO) ((REGNO) == 26 || (REGNO) == 29)
131 144
132 #undef CAN_ELIMINATE
133 #define CAN_ELIMINATE(FROM, TO) \
134 ((TO) != STACK_POINTER_REGNUM || ! alpha_using_fp ())
135
136 #undef INITIAL_ELIMINATION_OFFSET 145 #undef INITIAL_ELIMINATION_OFFSET
137 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 146 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
138 { switch (FROM) \ 147 ((OFFSET) = alpha_vms_initial_elimination_offset(FROM, TO))
139 { \ 148
140 case FRAME_POINTER_REGNUM: \
141 (OFFSET) = alpha_sa_size () + alpha_pv_save_size (); \
142 break; \
143 case ARG_POINTER_REGNUM: \
144 (OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \
145 + get_frame_size () \
146 + crtl->args.pretend_args_size) \
147 - crtl->args.pretend_args_size); \
148 break; \
149 default: \
150 gcc_unreachable (); \
151 } \
152 if ((TO) == STACK_POINTER_REGNUM) \
153 (OFFSET) += ALPHA_ROUND (crtl->outgoing_args_size); \
154 }
155 149
156 /* Define a data type for recording info about an argument list 150 /* Define a data type for recording info about an argument list
157 during the scan of that argument list. This data type should 151 during the scan of that argument list. This data type should
158 hold all necessary information about the function itself 152 hold all necessary information about the function itself
159 and about the args processed so far, enough to enable macros 153 and about the args processed so far, enough to enable macros
191 (CUM).atypes[(CUM).num_args] = alpha_arg_type (MODE); \ 185 (CUM).atypes[(CUM).num_args] = alpha_arg_type (MODE); \
192 \ 186 \
193 (CUM).num_args += ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \ 187 (CUM).num_args += ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \
194 } 188 }
195 189
196 /* ABI has stack checking, but it's broken. */ 190 #define DEFAULT_PCC_STRUCT_RETURN 0
197 #undef STACK_CHECK_BUILTIN 191
198 #define STACK_CHECK_BUILTIN 0 192 #undef ASM_WEAKEN_LABEL
193 #define ASM_WEAKEN_LABEL(FILE, NAME) \
194 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
195 fputc ('\n', FILE); } while (0)
199 196
200 #define READONLY_DATA_SECTION_ASM_OP "\t.rdata" 197 #define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
201 #define CTORS_SECTION_ASM_OP "\t.ctors" 198 #define CTORS_SECTION_ASM_OP "\t.ctors"
202 #define DTORS_SECTION_ASM_OP "\t.dtors" 199 #define DTORS_SECTION_ASM_OP "\t.dtors"
200 #define SDATA_SECTION_ASM_OP "\t.sdata"
201 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
202 asm (SECTION_OP "\n\t.long " #FUNC"\n");
203 203
204 #undef ASM_OUTPUT_ADDR_DIFF_ELT 204 #undef ASM_OUTPUT_ADDR_DIFF_ELT
205 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) gcc_unreachable () 205 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) gcc_unreachable ()
206 206
207 #undef ASM_OUTPUT_ADDR_VEC_ELT 207 #undef ASM_OUTPUT_ADDR_VEC_ELT
219 /* This says how to output assembler code to declare an 219 /* This says how to output assembler code to declare an
220 uninitialized external linkage data object. */ 220 uninitialized external linkage data object. */
221 221
222 #define COMMON_ASM_OP "\t.comm\t" 222 #define COMMON_ASM_OP "\t.comm\t"
223 223
224 #undef ASM_OUTPUT_ALIGNED_COMMON 224 #undef ASM_OUTPUT_ALIGNED_DECL_COMMON
225 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 225 #define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
226 do { \ 226 vms_output_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN)
227 fprintf ((FILE), "%s", COMMON_ASM_OP); \
228 assemble_name ((FILE), (NAME)); \
229 fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
230 } while (0)
231
232 227
233 /* Output assembler code for a block containing the constant parts
234 of a trampoline, leaving space for the variable parts.
235
236 The trampoline should set the static chain pointer to value placed
237 into the trampoline and should branch to the specified routine.
238 Note that $27 has been set to the address of the trampoline, so we can
239 use it for addressability of the two data items. */
240
241 #undef TRAMPOLINE_TEMPLATE
242 #define TRAMPOLINE_TEMPLATE(FILE) \
243 { \
244 fprintf (FILE, "\t.quad 0\n"); \
245 fprintf (FILE, "\t.linkage __tramp\n"); \
246 fprintf (FILE, "\t.quad 0\n"); \
247 }
248
249 /* Length in units of the trampoline for entering a nested function. */
250
251 #undef TRAMPOLINE_SIZE
252 #define TRAMPOLINE_SIZE 32
253
254 /* The alignment of a trampoline, in bits. */
255
256 #undef TRAMPOLINE_ALIGNMENT
257 #define TRAMPOLINE_ALIGNMENT 64
258
259 /* Emit RTL insns to initialize the variable parts of a trampoline.
260 FNADDR is an RTX for the address of the function's pure code.
261 CXT is an RTX for the static chain value for the function. */
262
263 #undef INITIALIZE_TRAMPOLINE
264 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
265 alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, -1)
266
267 /* Control how constructors and destructors are emitted. */ 228 /* Control how constructors and destructors are emitted. */
268 #define TARGET_ASM_CONSTRUCTOR vms_asm_out_constructor 229 #define TARGET_ASM_CONSTRUCTOR vms_asm_out_constructor
269 #define TARGET_ASM_DESTRUCTOR vms_asm_out_destructor 230 #define TARGET_ASM_DESTRUCTOR vms_asm_out_destructor
270 231
271 #undef SDB_DEBUGGING_INFO 232 #undef SDB_DEBUGGING_INFO
280 #undef EH_RETURN_HANDLER_RTX 241 #undef EH_RETURN_HANDLER_RTX
281 #define EH_RETURN_HANDLER_RTX \ 242 #define EH_RETURN_HANDLER_RTX \
282 gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, 8)) 243 gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, 8))
283 244
284 #define LINK_EH_SPEC "vms-dwarf2eh.o%s " 245 #define LINK_EH_SPEC "vms-dwarf2eh.o%s "
246 #define LINK_GCC_C_SEQUENCE_SPEC "%G"
247
248 #ifdef IN_LIBGCC2
249 /* Get the definition for MD_FALLBACK_FRAME_STATE_FOR from a separate
250 file. This avoids having to recompile the world instead of libgcc only
251 when changes to this macro are exercised. */
285 252
286 #define MD_UNWIND_SUPPORT "config/alpha/vms-unwind.h" 253 #define MD_UNWIND_SUPPORT "config/alpha/vms-unwind.h"
254 #endif
255
256 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
257 avms_asm_output_external (FILE, DECL, NAME)
258
259 typedef struct crtl_name_spec
260 {
261 const char *const name;
262 const char *deccname;
263 int referenced;
264 } crtl_name_spec;
265
266 #include "config/vms/vms-crtl.h"
267
268 /* Alias CRTL names to 32/64bit DECCRTL functions.
269 Fixme: This should do a binary search. */
270 #define DO_CRTL_NAMES \
271 do \
272 { \
273 int i; \
274 static crtl_name_spec vms_crtl_names[] = CRTL_NAMES; \
275 static int malloc64_init = 0; \
276 \
277 if ((malloc64_init == 0) && TARGET_MALLOC64) \
278 { \
279 for (i=0; vms_crtl_names [i].name; i++) \
280 { \
281 if (strcmp ("calloc", vms_crtl_names [i].name) == 0) \
282 vms_crtl_names [i].deccname = "decc$_calloc64"; \
283 else \
284 if (strcmp ("malloc", vms_crtl_names [i].name) == 0) \
285 vms_crtl_names [i].deccname = "decc$_malloc64"; \
286 else \
287 if (strcmp ("realloc", vms_crtl_names [i].name) == 0) \
288 vms_crtl_names [i].deccname = "decc$_realloc64"; \
289 else \
290 if (strcmp ("strdup", vms_crtl_names [i].name) == 0) \
291 vms_crtl_names [i].deccname = "decc$_strdup64"; \
292 } \
293 malloc64_init = 1; \
294 } \
295 for (i=0; vms_crtl_names [i].name; i++) \
296 if (!vms_crtl_names [i].referenced && \
297 (strcmp (name, vms_crtl_names [i].name) == 0)) \
298 { \
299 fprintf (file, "\t%s=%s\n", \
300 name, vms_crtl_names [i].deccname); \
301 vms_crtl_names [i].referenced = 1; \
302 } \
303 } while (0)
287 304
288 /* This is how to output an assembler line 305 /* This is how to output an assembler line
289 that says to advance the location counter 306 that says to advance the location counter
290 to a multiple of 2**LOG bytes. */ 307 to a multiple of 2**LOG bytes. */
291 308
316 333
317 #undef ASM_SPEC 334 #undef ASM_SPEC
318 #undef ASM_FINAL_SPEC 335 #undef ASM_FINAL_SPEC
319 336
320 /* The VMS convention is to always provide minimal debug info 337 /* The VMS convention is to always provide minimal debug info
321 for a traceback unless specifically overridden. Defaulting this here 338 for a traceback unless specifically overridden. */
322 is a kludge. */ 339
323
324 #define OPTIMIZATION_OPTIONS(OPTIMIZE, OPTIMIZE_SIZE) \
325 { \
326 write_symbols = VMS_DEBUG; \
327 debug_info_level = (enum debug_info_level) 1; \
328 }
329
330 /* Override traceback debug info on -g0. */
331 #undef OVERRIDE_OPTIONS 340 #undef OVERRIDE_OPTIONS
332 #define OVERRIDE_OPTIONS \ 341 #define OVERRIDE_OPTIONS \
333 { \ 342 { \
334 if (write_symbols == NO_DEBUG) \ 343 if (write_symbols == NO_DEBUG \
335 debug_info_level = (enum debug_info_level) 0; \ 344 && debug_info_level == DINFO_LEVEL_NONE) \
336 override_options (); \ 345 { \
346 write_symbols = VMS_DEBUG; \
347 debug_info_level = DINFO_LEVEL_TERSE; \
348 } \
349 override_options (); \
337 } 350 }
338 351
339 /* Link with vms-dwarf2.o if -g (except -g0). This causes the 352 /* Link with vms-dwarf2.o if -g (except -g0). This causes the
340 VMS link to pull all the dwarf2 debug sections together. */ 353 VMS link to pull all the dwarf2 debug sections together. */
341 #undef LINK_SPEC 354 #undef LINK_SPEC
342 #define LINK_SPEC "%{g:-g vms-dwarf2.o%s} %{g0} %{g1:-g1 vms-dwarf2.o%s} \ 355 #define LINK_SPEC "%{g:-g vms-dwarf2.o%s} %{g0} %{g1:-g1 vms-dwarf2.o%s} \
343 %{g2:-g2 vms-dwarf2.o%s} %{g3:-g3 vms-dwarf2.o%s} %{shared} %{v} %{map}" 356 %{g2:-g2 vms-dwarf2.o%s} %{g3:-g3 vms-dwarf2.o%s} %{shared} %{v} %{map}"
344 357
345 #undef STARTFILE_SPEC 358 #undef STARTFILE_SPEC
346 #define STARTFILE_SPEC "%{!shared:%{mvms-return-codes:vcrt0.o%s} \ 359 #define STARTFILE_SPEC \
347 %{!mvms-return-codes:pcrt0.o%s}}" 360 "%{!shared:%{mvms-return-codes:vcrt0.o%s} %{!mvms-return-codes:pcrt0.o%s} \
348 361 crtbegin.o%s} \
349 #undef LIB_SPEC 362 %{!static:%{shared:crtbeginS.o%s}}"
350 #define LIB_SPEC "-lc" 363
364 #define ENDFILE_SPEC \
365 "%{!shared:crtend.o%s} %{!static:%{shared:crtendS.o%s}}"
351 366
352 #define NAME__MAIN "__gccmain" 367 #define NAME__MAIN "__gccmain"
353 #define SYMBOL__MAIN __gccmain 368 #define SYMBOL__MAIN __gccmain
354 369
355 #define MD_EXEC_PREFIX "/gnu/lib/gcc-lib/" 370 #define INIT_SECTION_ASM_OP "\t.section LIB$INITIALIZE,GBL,NOWRT"
356 #define MD_STARTFILE_PREFIX "/gnu/lib/gcc-lib/"
357
358 /* Specify the list of include file directories. */
359 #define INCLUDE_DEFAULTS \
360 { \
361 { "/gnu/lib/gcc-lib/include", 0, 0, 0 }, \
362 { "/gnu_gxx_include", 0, 1, 1 }, \
363 { "/gnu_cc_include", 0, 0, 0 }, \
364 { "/gnu/include", 0, 0, 0 }, \
365 { 0, 0, 0, 0 } \
366 }
367 371
368 #define LONGLONG_STANDALONE 1 372 #define LONGLONG_STANDALONE 1
373
374 #undef TARGET_VALID_POINTER_MODE
375 #define TARGET_VALID_POINTER_MODE vms_valid_pointer_mode