comparison gcc/config/alpha/osf5.h @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents a06113de4d67
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
1 /* Definitions of target machine for GNU compiler, for DEC Alpha on Tru64 5. 1 /* Definitions of target machine for GNU compiler, for DEC Alpha on
2 Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 2 Tru64 UNIX V5.1.
3 3 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
4 This file is part of GCC. 4 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
5 5 Free Software Foundation, Inc.
6 GCC is free software; you can redistribute it and/or modify 6 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
7 it under the terms of the GNU General Public License as published by 7
8 the Free Software Foundation; either version 3, or (at your option) 8 This file is part of GCC.
9 any later version. 9
10 10 GCC is free software; you can redistribute it and/or modify
11 GCC is distributed in the hope that it will be useful, 11 it under the terms of the GNU General Public License as published by
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 the Free Software Foundation; either version 3, or (at your option)
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 any later version.
14 GNU General Public License for more details. 14
15 15 GCC is distributed in the hope that it will be useful,
16 You should have received a copy of the GNU General Public License 16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see 21 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */ 22 <http://www.gnu.org/licenses/>. */
19 23
20 /* Tru64 5.1 uses IEEE QUAD format. */ 24 /* As of DEC OSF/1 V4.0, as can subtract adjacent labels. */
25
26 #undef TARGET_AS_CAN_SUBTRACT_LABELS
27 #define TARGET_AS_CAN_SUBTRACT_LABELS 1
28
29 /* The GEM libraries for X_float are present, though not used by C. */
30
31 #undef TARGET_HAS_XFLOATING_LIBS
32 #define TARGET_HAS_XFLOATING_LIBS 1
33
34 /* Tru64 UNIX V5.1 uses IEEE QUAD format. */
21 #undef TARGET_DEFAULT 35 #undef TARGET_DEFAULT
22 #define TARGET_DEFAULT (MASK_FPREGS | MASK_LONG_DOUBLE_128) 36 #define TARGET_DEFAULT (MASK_FPREGS | MASK_LONG_DOUBLE_128)
23
24 /* In Tru64 UNIX V5.1, Compaq introduced a new assembler
25 (/usr/lib/cmplrs/cc/adu) which currently (versions between 3.04.29 and
26 3.04.32) breaks mips-tfile. Passing the undocumented -oldas flag reverts
27 to using the old assembler (/usr/lib/cmplrs/cc/as[01]).
28
29 The V5.0 and V5.0A assemblers silently ignore -oldas, so it can be
30 specified here.
31
32 It is clearly not desirable to depend on this undocumented flag, and
33 Compaq wants -oldas to go away soon, but until they have released a
34 new adu that works with mips-tfile, this is the only option.
35
36 In some versions of the DTK, the assembler driver invokes ld after
37 assembly. This has been fixed in current versions, but adding -c
38 works as expected for all versions. */
39
40 #undef ASM_OLDAS_SPEC
41 #define ASM_OLDAS_SPEC "-oldas -c"
42 37
43 /* The linker appears to perform invalid code optimizations that result 38 /* The linker appears to perform invalid code optimizations that result
44 in the ldgp emitted for the exception_receiver pattern being incorrectly 39 in the ldgp emitted for the exception_receiver pattern being incorrectly
45 linked. */ 40 linked. */
46 #undef TARGET_LD_BUGGY_LDGP 41 #undef TARGET_LD_BUGGY_LDGP
47 #define TARGET_LD_BUGGY_LDGP 1 42 #define TARGET_LD_BUGGY_LDGP 1
48 43
49 /* Tru64 v5.1 has the float and long double forms of math functions. */ 44 /* Tru64 UNIX V5.1 has the float and long double forms of math functions. */
50 #undef TARGET_C99_FUNCTIONS 45 #undef TARGET_C99_FUNCTIONS
51 #define TARGET_C99_FUNCTIONS 1 46 #define TARGET_C99_FUNCTIONS 1
47
48 /* Names to predefine in the preprocessor for this target machine. */
49
50 #define TARGET_OS_CPP_BUILTINS() \
51 do { \
52 builtin_define_std ("unix"); \
53 builtin_define_std ("SYSTYPE_BSD"); \
54 builtin_define ("_SYSTYPE_BSD"); \
55 builtin_define ("__osf__"); \
56 builtin_define ("__digital__"); \
57 builtin_define ("__arch64__"); \
58 builtin_define ("_LONGLONG"); \
59 builtin_assert ("system=unix"); \
60 builtin_assert ("system=xpg4"); \
61 /* Tru64 UNIX V5 has a 16 byte long \
62 double type and requires __X_FLOAT \
63 to be defined for <math.h>. */ \
64 if (LONG_DOUBLE_TYPE_SIZE == 128) \
65 builtin_define ("__X_FLOAT"); \
66 \
67 /* Tru64 UNIX V4/V5 provide several ISO C94 \
68 features protected by the corresponding \
69 __STDC_VERSION__ macro. libstdc++ v3 \
70 needs them as well. */ \
71 if (c_dialect_cxx ()) \
72 builtin_define ("__STDC_VERSION__=199409L"); \
73 } while (0)
74
75 /* Accept DEC C flags for multithreaded programs. We use _PTHREAD_USE_D4
76 instead of PTHREAD_USE_D4 since both have the same effect and the former
77 doesn't invade the users' namespace. */
78
79 #undef CPP_SPEC
80 #define CPP_SPEC \
81 "%{pthread|threads:-D_REENTRANT} %{threads:-D_PTHREAD_USE_D4}"
82
83 /* Under DEC OSF/1 V4, -p and -pg require -lprof1, and -lprof1 requires
84 -lpdf. */
85
86 #define LIB_SPEC \
87 "%{p|pg:-lprof1%{pthread|threads:_r} -lpdf} %{a:-lprof2} \
88 %{threads: -lpthreads} %{pthread|threads: -lpthread -lmach -lexc} -lc"
89
90 /* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are
91 optimizing, -O1 if we are not. Pass -S to silence `weak symbol
92 multiply defined' warnings. Pass -shared, -non_shared or
93 -call_shared as appropriate. Pass -hidden_symbol so that our
94 constructor and call-frame data structures are not accidentally
95 overridden. */
96 #define LINK_SPEC \
97 "-G 8 %{O*:-O3} %{!O*:-O1} -S %{static:-non_shared} \
98 %{!static:%{shared:-shared -hidden_symbol _GLOBAL_*} \
99 %{!shared:-call_shared}} %{pg} %{taso} %{rpath*}"
100
101 #define STARTFILE_SPEC \
102 "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
103
104 #define ENDFILE_SPEC \
105 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
106
107 #define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
108
109 /* In Tru64 UNIX V5.1, Compaq introduced a new assembler
110 (/usr/lib/cmplrs/cc/adu) which currently (versions between 3.04.29 and
111 3.04.32) breaks mips-tfile. Passing the undocumented -oldas flag reverts
112 to using the old assembler (/usr/lib/cmplrs/cc/as[01]).
113
114 It is clearly not desirable to depend on this undocumented flag, and
115 Compaq wants -oldas to go away soon, but until they have released a
116 new adu that works with mips-tfile, this is the only option.
117
118 In some versions of the DTK, the assembler driver invokes ld after
119 assembly. This has been fixed in current versions, but adding -c
120 works as expected for all versions. */
121
122 #define ASM_OLDAS_SPEC "-oldas -c"
123
124 /* In OSF/1 v3.2c, the assembler by default does not output file names which
125 causes mips-tfile to fail. Passing -g to the assembler fixes this problem.
126 ??? Strictly speaking, we need -g only if the user specifies -g. Passing
127 it always means that we get slightly larger than necessary object files
128 if the user does not specify -g. If we don't pass -g, then mips-tfile
129 will need to be fixed to work in this case. Pass -O0 since some
130 optimization are broken and don't help us anyway. Pass -nocpp because
131 there's no point in running CPP on our assembler output. */
132 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0
133 #define ASM_SPEC "%{malpha-as:-g " ASM_OLDAS_SPEC " -nocpp %{pg} -O0}"
134 #else
135 #define ASM_SPEC "%{!mgas:-g " ASM_OLDAS_SPEC " -nocpp %{pg} -O0}"
136 #endif
137
138 /* Specify to run a post-processor, mips-tfile after the assembler
139 has run to stuff the ecoff debug information into the object file.
140 This is needed because the Alpha assembler provides no way
141 of specifying such information in the assembly file. */
142
143 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0
144
145 #define ASM_FINAL_SPEC "\
146 %{malpha-as: %{!mno-mips-tfile: \
147 \n mips-tfile %{v*: -v} \
148 %{K: -I %b.o~} \
149 %{!K: %{save-temps: -I %b.o~}} \
150 %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
151 %{,assembler:%i;:%g.s}}}"
152
153 #else
154 #define ASM_FINAL_SPEC "\
155 %{!mgas: %{!mno-mips-tfile: \
156 \n mips-tfile %{v*: -v} \
157 %{K: -I %b.o~} \
158 %{!K: %{save-temps: -I %b.o~}} \
159 %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
160 %{,assembler:%i;:%g.s}}}"
161
162 #endif
163
164 /* Indicate that we have a stamp.h to use. */
165 #ifndef CROSS_DIRECTORY_STRUCTURE
166 #define HAVE_STAMP_H 1
167 #endif
168
169 /* Attempt to turn on access permissions for the stack. */
170
171 #define ENABLE_EXECUTE_STACK \
172 void \
173 __enable_execute_stack (void *addr) \
174 { \
175 extern int mprotect (const void *, size_t, int); \
176 long size = getpagesize (); \
177 long mask = ~(size-1); \
178 char *page = (char *) (((long) addr) & mask); \
179 char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
180 \
181 /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
182 if (mprotect (page, end - page, 7) < 0) \
183 perror ("mprotect of trampoline code"); \
184 }
185
186 /* Digital UNIX V4.0E (1091)/usr/include/sys/types.h 4.3.49.9 1997/08/14 */
187 #define SIZE_TYPE "long unsigned int"
188 #define PTRDIFF_TYPE "long int"
189
190 #define SIG_ATOMIC_TYPE "int"
191
192 #define INT8_TYPE "signed char"
193 #define INT16_TYPE "short int"
194 #define INT32_TYPE "int"
195 #define INT64_TYPE "long int"
196 #define UINT8_TYPE "unsigned char"
197 #define UINT16_TYPE "short unsigned int"
198 #define UINT32_TYPE "unsigned int"
199 #define UINT64_TYPE "long unsigned int"
200
201 #define INT_LEAST8_TYPE "signed char"
202 #define INT_LEAST16_TYPE "short int"
203 #define INT_LEAST32_TYPE "int"
204 #define INT_LEAST64_TYPE "long int"
205 #define UINT_LEAST8_TYPE "unsigned char"
206 #define UINT_LEAST16_TYPE "short unsigned int"
207 #define UINT_LEAST32_TYPE "unsigned int"
208 #define UINT_LEAST64_TYPE "long unsigned int"
209
210 #define INT_FAST8_TYPE "signed char"
211 #define INT_FAST16_TYPE "int"
212 #define INT_FAST32_TYPE "int"
213 #define INT_FAST64_TYPE "long int"
214 #define UINT_FAST8_TYPE "unsigned char"
215 #define UINT_FAST16_TYPE "unsigned int"
216 #define UINT_FAST32_TYPE "unsigned int"
217 #define UINT_FAST64_TYPE "long unsigned int"
218
219 #define INTPTR_TYPE "long int"
220 #define UINTPTR_TYPE "long unsigned int"
221
222 /* The linker will stick __main into the .init section. */
223 #define HAS_INIT_SECTION
224 #define LD_INIT_SWITCH "-init"
225 #define LD_FINI_SWITCH "-fini"
226
227 /* Select a format to encode pointers in exception handling data. CODE
228 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
229 true if the symbol may be affected by dynamic relocations.
230
231 We really ought to be using the SREL32 relocations that ECOFF has,
232 but no version of the native assembler supports creating such things,
233 and Compaq has no plans to rectify this. Worse, the dynamic loader
234 cannot handle unaligned relocations, so we have to make sure that
235 things get padded appropriately. */
236 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
237 (TARGET_GAS \
238 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
239 : DW_EH_PE_aligned)
240
241 /* The Tru64 UNIX assembler warns on .lcomm with SIZE 0, so use 1 in that
242 case. */
243 #undef ASM_OUTPUT_LOCAL
244 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \
245 ( fputs ("\t.lcomm ", (FILE)), \
246 assemble_name ((FILE), (NAME)), \
247 fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE) ? (SIZE) : 1))
248
249 /* This is how we tell the assembler that a symbol is weak. */
250
251 #define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
252 do \
253 { \
254 (*targetm.asm_out.globalize_label) (FILE, NAME); \
255 fputs ("\t.weakext\t", FILE); \
256 assemble_name (FILE, NAME); \
257 if (VALUE) \
258 { \
259 fputc (' ', FILE); \
260 assemble_name (FILE, VALUE); \
261 } \
262 fputc ('\n', FILE); \
263 } \
264 while (0)
265
266 #define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0)
52 267
53 /* The native assembler doesn't understand parenthesis. */ 268 /* The native assembler doesn't understand parenthesis. */
54 #define TARGET_ASM_OPEN_PAREN "" 269 #define TARGET_ASM_OPEN_PAREN ""
55 #define TARGET_ASM_CLOSE_PAREN "" 270 #define TARGET_ASM_CLOSE_PAREN ""
56 271
272 /* Handle #pragma weak and #pragma pack. */
273 #define HANDLE_SYSV_PRAGMA 1
274
275 /* Handle #pragma extern_prefix. */
276 #define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX 1