Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / config / ia64 / vms.h
blob1e1a04fd5770964771e7910687f8356f7a647a72
1 /* Definitions of target machine GNU compiler. IA64-VMS version.
2 Copyright (C) 2003-2010 Free Software Foundation, Inc.
3 Contributed by Douglas B Rupp (rupp@gnat.com).
5 This file is part of GCC.
7 GCC 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 3, or (at your option)
10 any later version.
12 GCC 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.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #define TARGET_OBJECT_SUFFIX ".obj"
22 #define TARGET_EXECUTABLE_SUFFIX ".exe"
24 #define OBJECT_FORMAT_ELF
26 #define TARGET_OS_CPP_BUILTINS() \
27 do { \
28 builtin_define_std ("vms"); \
29 builtin_define_std ("VMS"); \
30 builtin_define ("__IA64"); \
31 builtin_assert ("system=vms"); \
32 builtin_define ("__IEEE_FLOAT"); \
33 } while (0)
35 /* By default, allow $ to be part of an identifier. */
36 #define DOLLARS_IN_IDENTIFIERS 2
38 #undef TARGET_ABI_OPEN_VMS
39 #define TARGET_ABI_OPEN_VMS 1
41 #undef TARGET_NAME
42 #define TARGET_NAME "OpenVMS/IA64"
43 #undef TARGET_VERSION
44 #define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME);
46 /* Need .debug_line info generated from gcc and gas. */
47 #undef TARGET_DEFAULT
48 #define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS)
50 #define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
52 /* "long" is 32 bits, but 64 bits for Ada. */
53 #undef LONG_TYPE_SIZE
54 #define LONG_TYPE_SIZE 32
55 #define ADA_LONG_TYPE_SIZE 64
57 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
58 #undef POINTER_SIZE
59 #define POINTER_SIZE 32
60 #define POINTERS_EXTEND_UNSIGNED 0
62 #undef MAX_OFILE_ALIGNMENT
63 #define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
65 /* Widest floating-point type efficiently supported by hardware and OS. */
66 #undef WIDEST_HARDWARE_FP_SIZE
67 #define WIDEST_HARDWARE_FP_SIZE 64
69 /* The structure return address arrives as an "argument" on VMS. */
70 #undef PCC_STATIC_STRUCT_RETURN
72 /* Turn on VMS specific Dwarf2 features. */
73 #define VMS_DEBUGGING_INFO 1
75 #define ASM_OUTPUT_DWARF_VMS_DELTA(FILE,SIZE,LABEL1,LABEL2) \
76 do { \
77 fprintf (FILE, "\tdata4.ua\t@slotcount("); \
78 assemble_name (FILE, LABEL1); \
79 fprintf (FILE, "-"); \
80 assemble_name (FILE, LABEL2); \
81 fprintf (FILE, ")"); \
82 } while (0)
84 #undef STARTFILE_SPEC
85 #define STARTFILE_SPEC \
86 "%{!shared:%{mvms-return-codes:vcrt0.o%s} %{!mvms-return-codes:pcrt0.o%s} \
87 crtbegin.o%s} \
88 %{!static:%{shared:crtinitS.o%s crtbeginS.o%s}}"
90 #undef ENDFILE_SPEC
91 #define ENDFILE_SPEC \
92 "%{!shared:crtend.o%s} %{!static:%{shared:crtendS.o%s}}"
94 #define LINK_GCC_C_SEQUENCE_SPEC "%G"
96 #undef LINK_SPEC
97 #define LINK_SPEC "%{g*} %{map} %{save-temps} %{shared} %{v}"
99 #undef LIB_SPEC
100 #define LIB_SPEC ""
102 #undef ASM_SPEC
103 #define ASM_SPEC \
104 "%{mno-gnu-as:-N so -N vms_upcase -W DVLoc_off} %{mconstant-gp:-M const_gp} \
105 %{mauto-pic:-M no_plabel} %{source-listing:-ahdl=%b.lis}"
107 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
108 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
109 do { \
110 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
111 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function"); \
112 } while (0)
114 /* Set the function to change the names of the division and modulus
115 functions. */
116 #undef TARGET_INIT_LIBFUNCS
117 #define TARGET_INIT_LIBFUNCS ia64_vms_init_libfuncs
119 #define NAME__MAIN "__gccmain"
120 #define SYMBOL__MAIN __gccmain
122 #define CTOR_LIST_BEGIN asm (".global\tLIB$INITIALIZE#\n"); \
123 STATIC func_ptr __CTOR_LIST__[1] \
124 __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) \
125 = { (func_ptr) (-1) };
127 #undef INIT_SECTION_ASM_OP
128 #define INIT_SECTION_ASM_OP ".section\tLIB$INITIALIZE#,\"a\",@progbits"
130 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
131 asm (SECTION_OP "\n\tdata4 @fptr(" #FUNC"#)\n"); \
132 FORCE_CODE_SECTION_ALIGN \
133 asm (TEXT_SECTION_ASM_OP);
135 #undef FINI_SECTION_ASM_OP
137 /* Maybe same as HPUX? Needs to be checked. */
138 #define JMP_BUF_SIZE (8 * 76)
140 typedef struct crtl_name_spec
142 const char *const name;
143 const char *deccname;
144 int referenced;
145 } crtl_name_spec;
147 #include "config/vms/vms-crtl.h"
149 /* Alias CRTL names to 32/64bit DECCRTL functions.
150 Fixme: This should do a binary search. */
151 #define DO_CRTL_NAMES \
152 do \
154 int i; \
155 static crtl_name_spec vms_crtl_names[] = CRTL_NAMES; \
156 static int malloc64_init = 0; \
158 if ((malloc64_init == 0) && TARGET_MALLOC64) \
160 for (i=0; vms_crtl_names [i].name; i++) \
162 if (strcmp ("calloc", vms_crtl_names [i].name) == 0) \
163 vms_crtl_names [i].deccname = "decc$_calloc64"; \
164 else \
165 if (strcmp ("malloc", vms_crtl_names [i].name) == 0) \
166 vms_crtl_names [i].deccname = "decc$_malloc64"; \
167 else \
168 if (strcmp ("realloc", vms_crtl_names [i].name) == 0) \
169 vms_crtl_names [i].deccname = "decc$_realloc64"; \
170 else \
171 if (strcmp ("strdup", vms_crtl_names [i].name) == 0) \
172 vms_crtl_names [i].deccname = "decc$_strdup64"; \
174 malloc64_init = 1; \
176 for (i=0; vms_crtl_names [i].name; i++) \
177 if (!vms_crtl_names [i].referenced && \
178 (strcmp (name, vms_crtl_names [i].name) == 0)) \
180 fprintf (file, "\t.alias %s, \"%s\"\n", \
181 name, vms_crtl_names [i].deccname); \
182 vms_crtl_names [i].referenced = 1; \
184 } while (0)
186 #undef SUBTARGET_OPTIMIZATION_OPTIONS
187 #define SUBTARGET_OPTIMIZATION_OPTIONS \
188 { OPT_LEVELS_ALL, OPT_fmerge_constants, NULL, 0 }
190 /* Define this to be nonzero if static stack checking is supported. */
191 #define STACK_CHECK_STATIC_BUILTIN 1
193 #define MD_UNWIND_SUPPORT "config/ia64/vms-unwind.h"
195 #define UNW_IVMS_MODE(HEADER) (((HEADER) >> 44) & 0x3L)
196 #define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) (!UNW_IVMS_MODE (HEADER))
198 /* Minimum amount of stack required to recover from an anticipated stack
199 overflow detection. The default value conveys an estimate of the amount
200 of stack required to propagate an exception. */
201 #define STACK_CHECK_PROTECT (24 * 1024)
203 #undef ASM_OUTPUT_ALIGNED_DECL_COMMON
204 #define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
205 ia64_vms_output_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN)
207 #undef TARGET_VALID_POINTER_MODE
208 #define TARGET_VALID_POINTER_MODE ia64_vms_valid_pointer_mode
210 #undef TARGET_ASM_NAMED_SECTION
211 #define TARGET_ASM_NAMED_SECTION ia64_vms_elf_asm_named_section