OSDN Git Service

PR c++/16707
[pf3gnuchains/gcc-fork.git] / gcc / config / ia64 / hpux.h
1 /* Definitions of target machine GNU compiler.  IA-64 version.
2    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
3    Free Software Foundation, Inc.
4    Contributed by Steve Ellcey <sje@cup.hp.com> and
5                   Reva Cuthbertson <reva@cup.hp.com>
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING.  If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.  */
23
24 /* This macro is a C statement to print on `stderr' a string describing the
25    particular machine description choice.  */
26
27 #define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
28
29 /* Enable HPUX ABI quirks.  */
30 #undef  TARGET_HPUX
31 #define TARGET_HPUX 1
32
33 /* Target OS builtins.  */
34 #define TARGET_OS_CPP_BUILTINS()                        \
35 do {                                                    \
36         builtin_assert("system=hpux");                  \
37         builtin_assert("system=posix");                 \
38         builtin_assert("system=unix");                  \
39         builtin_define_std("hpux");                     \
40         builtin_define_std("unix");                     \
41         builtin_define("__IA64__");                     \
42         builtin_define("_LONGLONG");                    \
43         builtin_define("_INCLUDE_LONGLONG");            \
44         builtin_define("_UINT128_T");                   \
45         if (c_dialect_cxx () || !flag_iso)              \
46           {                                             \
47             builtin_define("_HPUX_SOURCE");             \
48             builtin_define("__STDC_EXT__");             \
49             builtin_define("__STDCPP__");               \
50           }                                             \
51         if (TARGET_ILP32)                               \
52           builtin_define("_ILP32");                     \
53 } while (0)
54
55 #undef CPP_SPEC
56 #define CPP_SPEC \
57   "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
58 /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD.  These
59    affect only aCC's C++ library (Rogue Wave-derived) which we do not
60    use, and they violate the user's name space.  */
61
62 #undef  ASM_EXTRA_SPEC
63 #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
64
65 #undef ENDFILE_SPEC
66
67 #undef STARTFILE_SPEC
68 #define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s}}"
69
70 #undef LINK_SPEC
71 #define LINK_SPEC \
72   "+Accept TypeMismatch \
73    %{shared:-b} \
74    %{!shared: \
75      -u main \
76      %{static:-noshared}}"
77
78 #undef  LIB_SPEC
79 #define LIB_SPEC \
80   "%{!shared: \
81      %{mt|pthread:-lpthread} \
82      %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
83          %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
84      %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
85           %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
86      %{!symbolic:-lc}}"
87
88 #ifndef CROSS_COMPILE
89 #undef LIBGCC_SPEC
90 #define LIBGCC_SPEC \
91   "%{shared-libgcc:%{!mlp64:-lgcc_s}%{mlp64:-lgcc_s_hpux64} -lgcc} \
92    %{!shared-libgcc:-lgcc}"
93 #endif
94
95 #undef SUBTARGET_SWITCHES
96 #define SUBTARGET_SWITCHES \
97   { "ilp32",    MASK_ILP32,     "Generate ILP32 code" }, \
98   { "lp64",    -MASK_ILP32,     "Generate LP64 code" },
99
100 #define MULTILIB_DEFAULTS { "milp32" }
101
102 /* A C expression whose value is zero if pointers that need to be extended
103    from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
104    greater then zero if they are zero-extended and less then zero if the
105    ptr_extend instruction should be used.  */
106
107 #define POINTERS_EXTEND_UNSIGNED -1
108
109 #define JMP_BUF_SIZE  (8 * 76)
110
111 #undef TARGET_DEFAULT
112 #define TARGET_DEFAULT \
113   (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32 | MASK_INLINE_FLOAT_DIV_THR)
114
115 /* This needs to be set to force structure arguments with a single
116    integer field to be treated as structures and not as the type of
117    their field.  Without this a structure with a single char will be
118    returned just like a char variable, instead of being returned at the
119    top of the register as specified for big-endian IA64.  */
120
121 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \
122   (!FLOAT_MODE_P (MODE) || (MODE) == TFmode)
123
124 /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
125    but that doesn't put out the @function type information which causes
126    shared library problems.  */
127
128 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
129 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)                  \
130 do {                                                            \
131   (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0));     \
132   ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function");  \
133 } while (0)
134
135 #undef FUNCTION_ARG_PADDING
136 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
137         ia64_hpux_function_arg_padding ((MODE), (TYPE))
138
139 #undef PAD_VARARGS_DOWN
140 #define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
141
142 #define REGISTER_TARGET_PRAGMAS() \
143   c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma)
144
145 /* Tell ia64.c that we are using the HP linker and we should delay output of
146    function extern declarations so that we don't output them for functions
147    which are never used (and may not be defined).  */
148
149 #undef TARGET_HPUX_LD
150 #define TARGET_HPUX_LD  1
151
152 /* The HPUX dynamic linker objects to weak symbols with no
153    definitions, so do not use them in gthr-posix.h.  */
154 #define GTHREAD_USE_WEAK 0
155
156 /* Put out the needed function declarations at the end.  */
157
158 #define TARGET_ASM_FILE_END ia64_hpux_file_end
159
160 #undef CTORS_SECTION_ASM_OP
161 #define CTORS_SECTION_ASM_OP  "\t.section\t.init_array,\t\"aw\",\"init_array\""
162
163 #undef DTORS_SECTION_ASM_OP
164 #define DTORS_SECTION_ASM_OP  "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
165
166 /* The init_array/fini_array technique does not permit the use of
167    initialization priorities.  */
168 #define SUPPORTS_INIT_PRIORITY 0
169
170 #undef READONLY_DATA_SECTION_ASM_OP
171 #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
172
173 #undef DATA_SECTION_ASM_OP
174 #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
175
176 #undef SDATA_SECTION_ASM_OP
177 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
178
179 #undef BSS_SECTION_ASM_OP
180 #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
181
182 #undef SBSS_SECTION_ASM_OP
183 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
184
185 #undef TEXT_SECTION_ASM_OP
186 #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
187
188 /* It is illegal to have relocations in shared segments on HPUX.
189    Pretend flag_pic is always set.  */
190 #undef  TARGET_ASM_SELECT_SECTION
191 #define TARGET_ASM_SELECT_SECTION  ia64_rwreloc_select_section
192 #undef  TARGET_ASM_UNIQUE_SECTION
193 #define TARGET_ASM_UNIQUE_SECTION  ia64_rwreloc_unique_section
194 #undef  TARGET_ASM_SELECT_RTX_SECTION
195 #define TARGET_ASM_SELECT_RTX_SECTION  ia64_rwreloc_select_rtx_section
196 #undef  TARGET_SECTION_TYPE_FLAGS
197 #define TARGET_SECTION_TYPE_FLAGS  ia64_rwreloc_section_type_flags
198
199 /* ia64 HPUX has the float and long double forms of math functions.  */
200 #undef TARGET_C99_FUNCTIONS
201 #define TARGET_C99_FUNCTIONS  1
202
203 #undef TARGET_INIT_LIBFUNCS
204 #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
205
206 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)