comparison gcc/defaults.h @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */ 26 <http://www.gnu.org/licenses/>. */
27 27
28 #ifndef GCC_DEFAULTS_H 28 #ifndef GCC_DEFAULTS_H
29 #define GCC_DEFAULTS_H 29 #define GCC_DEFAULTS_H
30
31 #ifndef GET_ENVIRONMENT
32 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
33 #endif
34
35 #define obstack_chunk_alloc ((void *(*) (long)) xmalloc)
36 #define obstack_chunk_free ((void (*) (void *)) free)
37 #define OBSTACK_CHUNK_SIZE 0
38 #define gcc_obstack_init(OBSTACK) \
39 _obstack_begin ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \
40 obstack_chunk_alloc, \
41 obstack_chunk_free)
42 30
43 /* Store in OUTPUT a string (made with alloca) containing an 31 /* Store in OUTPUT a string (made with alloca) containing an
44 assembler-name for a local static variable or function named NAME. 32 assembler-name for a local static variable or function named NAME.
45 LABELNO is an integer which is different for each call. */ 33 LABELNO is an integer which is different for each call. */
46 34
116 fprintf (FILE, "\n"); \ 104 fprintf (FILE, "\n"); \
117 } while (0) 105 } while (0)
118 #endif 106 #endif
119 #endif 107 #endif
120 108
109 #ifndef IFUNC_ASM_TYPE
110 #define IFUNC_ASM_TYPE "gnu_indirect_function"
111 #endif
112
121 #ifndef TLS_COMMON_ASM_OP 113 #ifndef TLS_COMMON_ASM_OP
122 #define TLS_COMMON_ASM_OP ".tls_common" 114 #define TLS_COMMON_ASM_OP ".tls_common"
123 #endif 115 #endif
124 116
125 #if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON) 117 #if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON)
139 #ifndef TARGET_DEFERRED_OUTPUT_DEFS 131 #ifndef TARGET_DEFERRED_OUTPUT_DEFS
140 #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false 132 #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false
141 #endif 133 #endif
142 134
143 /* This is how to output the definition of a user-level label named 135 /* This is how to output the definition of a user-level label named
144 NAME, such as the label on a static function or variable NAME. */ 136 NAME, such as the label on variable NAME. */
145 137
146 #ifndef ASM_OUTPUT_LABEL 138 #ifndef ASM_OUTPUT_LABEL
147 #define ASM_OUTPUT_LABEL(FILE,NAME) \ 139 #define ASM_OUTPUT_LABEL(FILE,NAME) \
148 do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0) 140 do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
141 #endif
142
143 /* This is how to output the definition of a user-level label named
144 NAME, such as the label on a function. */
145
146 #ifndef ASM_OUTPUT_FUNCTION_LABEL
147 #define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \
148 ASM_OUTPUT_LABEL ((FILE), (NAME))
149 #endif 149 #endif
150 150
151 /* Output the definition of a compiler-generated label named NAME. */ 151 /* Output the definition of a compiler-generated label named NAME. */
152 #ifndef ASM_OUTPUT_INTERNAL_LABEL 152 #ifndef ASM_OUTPUT_INTERNAL_LABEL
153 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \ 153 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
248 while (0) 248 while (0)
249 249
250 #endif 250 #endif
251 #endif 251 #endif
252 252
253 /* This determines whether or not we support weak symbols. */ 253 /* This determines whether or not we support weak symbols. SUPPORTS_WEAK
254 must be a preprocessor constant. */
254 #ifndef SUPPORTS_WEAK 255 #ifndef SUPPORTS_WEAK
255 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL) 256 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
256 #define SUPPORTS_WEAK 1 257 #define SUPPORTS_WEAK 1
257 #else 258 #else
258 #define SUPPORTS_WEAK 0 259 #define SUPPORTS_WEAK 0
259 #endif 260 #endif
261 #endif
262
263 /* This determines whether or not we support weak symbols during target
264 code generation. TARGET_SUPPORTS_WEAK can be any valid C expression. */
265 #ifndef TARGET_SUPPORTS_WEAK
266 #define TARGET_SUPPORTS_WEAK (SUPPORTS_WEAK)
260 #endif 267 #endif
261 268
262 /* This determines whether or not we support the discriminator 269 /* This determines whether or not we support the discriminator
263 attribute in the .loc directive. */ 270 attribute in the .loc directive. */
264 #ifndef SUPPORTS_DISCRIMINATOR 271 #ifndef SUPPORTS_DISCRIMINATOR
338 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0 345 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
339 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */ 346 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
340 347
341 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that 348 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
342 the rest of the DWARF 2 frame unwind support is also provided. */ 349 the rest of the DWARF 2 frame unwind support is also provided. */
343 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) \ 350 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
344 && !defined (TARGET_UNWIND_INFO)
345 #define DWARF2_UNWIND_INFO 1 351 #define DWARF2_UNWIND_INFO 1
346 #endif 352 #endif
347 353
348 /* If we have named sections, and we're using crtstuff to run ctors, 354 /* If we have named sections, and we're using crtstuff to run ctors,
349 use them for registering eh frame information. */ 355 use them for registering eh frame information. */
688 694
689 #ifndef PIC_OFFSET_TABLE_REGNUM 695 #ifndef PIC_OFFSET_TABLE_REGNUM
690 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM 696 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
691 #endif 697 #endif
692 698
699 #ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
700 #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 0
701 #endif
702
693 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES 703 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES
694 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0 704 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0
695 #endif 705 #endif
696 706
697 #ifndef TARGET_DECLSPEC 707 #ifndef TARGET_DECLSPEC
763 #define INCOMING_STACK_BOUNDARY PREFERRED_STACK_BOUNDARY 773 #define INCOMING_STACK_BOUNDARY PREFERRED_STACK_BOUNDARY
764 #endif 774 #endif
765 775
766 #ifndef TARGET_DEFAULT_PACK_STRUCT 776 #ifndef TARGET_DEFAULT_PACK_STRUCT
767 #define TARGET_DEFAULT_PACK_STRUCT 0 777 #define TARGET_DEFAULT_PACK_STRUCT 0
768 #endif
769
770 /* By default, the C++ compiler will use function addresses in the
771 vtable entries. Setting this nonzero tells the compiler to use
772 function descriptors instead. The value of this macro says how
773 many words wide the descriptor is (normally 2). It is assumed
774 that the address of a function descriptor may be treated as a
775 pointer to a function. */
776 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
777 #define TARGET_VTABLE_USES_DESCRIPTORS 0
778 #endif 778 #endif
779 779
780 /* By default, the vtable entries are void pointers, the so the alignment 780 /* By default, the vtable entries are void pointers, the so the alignment
781 is the same as pointer alignment. The value of this macro specifies 781 is the same as pointer alignment. The value of this macro specifies
782 the alignment of the vtable entry in bits. It should be defined only 782 the alignment of the vtable entry in bits. It should be defined only
891 891
892 #ifndef TARGET_DEC_EVAL_METHOD 892 #ifndef TARGET_DEC_EVAL_METHOD
893 #define TARGET_DEC_EVAL_METHOD 2 893 #define TARGET_DEC_EVAL_METHOD 2
894 #endif 894 #endif
895 895
896 #ifndef HOT_TEXT_SECTION_NAME
897 #define HOT_TEXT_SECTION_NAME ".text.hot"
898 #endif
899
900 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
901 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
902 #endif
903
904 #ifndef HAS_LONG_COND_BRANCH 896 #ifndef HAS_LONG_COND_BRANCH
905 #define HAS_LONG_COND_BRANCH 0 897 #define HAS_LONG_COND_BRANCH 0
906 #endif 898 #endif
907 899
908 #ifndef HAS_LONG_UNCOND_BRANCH 900 #ifndef HAS_LONG_UNCOND_BRANCH
909 #define HAS_LONG_UNCOND_BRANCH 0 901 #define HAS_LONG_UNCOND_BRANCH 0
910 #endif
911
912 /* By default, only attempt to parallelize bitwise operations, and
913 possibly adds/subtracts using bit-twiddling. */
914 #ifndef UNITS_PER_SIMD_WORD
915 #define UNITS_PER_SIMD_WORD(MODE) UNITS_PER_WORD
916 #endif 902 #endif
917 903
918 /* Determine whether __cxa_atexit, rather than atexit, is used to 904 /* Determine whether __cxa_atexit, rather than atexit, is used to
919 register C++ destructors for local statics and global objects. */ 905 register C++ destructors for local statics and global objects. */
920 #ifndef DEFAULT_USE_CXA_ATEXIT 906 #ifndef DEFAULT_USE_CXA_ATEXIT
987 #define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C) 973 #define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C)
988 #endif 974 #endif
989 975
990 #endif /* old constraint mechanism in use */ 976 #endif /* old constraint mechanism in use */
991 977
992 #ifndef REGISTER_MOVE_COST
993 #define REGISTER_MOVE_COST(m, x, y) 2
994 #endif
995
996 /* Determine whether the entire c99 runtime 978 /* Determine whether the entire c99 runtime
997 is present in the runtime library. */ 979 is present in the runtime library. */
998 #ifndef TARGET_C99_FUNCTIONS 980 #ifndef TARGET_C99_FUNCTIONS
999 #define TARGET_C99_FUNCTIONS 0 981 #define TARGET_C99_FUNCTIONS 0
1000 #endif 982 #endif
1025 move efficiently, as opposed to MOVE_MAX which is the maximum 1007 move efficiently, as opposed to MOVE_MAX which is the maximum
1026 number of bytes we can move with a single instruction. */ 1008 number of bytes we can move with a single instruction. */
1027 1009
1028 #ifndef MOVE_MAX_PIECES 1010 #ifndef MOVE_MAX_PIECES
1029 #define MOVE_MAX_PIECES MOVE_MAX 1011 #define MOVE_MAX_PIECES MOVE_MAX
1012 #endif
1013
1014 #ifndef MAX_MOVE_MAX
1015 #define MAX_MOVE_MAX MOVE_MAX
1016 #endif
1017
1018 #ifndef MIN_UNITS_PER_WORD
1019 #define MIN_UNITS_PER_WORD UNITS_PER_WORD
1020 #endif
1021
1022 #ifndef MAX_BITS_PER_WORD
1023 #define MAX_BITS_PER_WORD BITS_PER_WORD
1030 #endif 1024 #endif
1031 1025
1032 #ifndef STACK_POINTER_OFFSET 1026 #ifndef STACK_POINTER_OFFSET
1033 #define STACK_POINTER_OFFSET 0 1027 #define STACK_POINTER_OFFSET 0
1034 #endif 1028 #endif
1163 or integer value is acceptable as a constant address. */ 1157 or integer value is acceptable as a constant address. */
1164 #ifndef CONSTANT_ADDRESS_P 1158 #ifndef CONSTANT_ADDRESS_P
1165 #define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE) 1159 #define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE)
1166 #endif 1160 #endif
1167 1161
1162 #ifndef MAX_FIXED_MODE_SIZE
1163 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
1164 #endif
1165
1166 /* Nonzero if structures and unions should be returned in memory.
1167
1168 This should only be defined if compatibility with another compiler or
1169 with an ABI is needed, because it results in slower code. */
1170
1171 #ifndef DEFAULT_PCC_STRUCT_RETURN
1172 #define DEFAULT_PCC_STRUCT_RETURN 1
1173 #endif
1174
1175 #ifdef GCC_INSN_FLAGS_H
1176 /* Dependent default target macro definitions
1177
1178 This section of defaults.h defines target macros that depend on generated
1179 headers. This is a bit awkward: We want to put all default definitions
1180 for target macros in defaults.h, but some of the defaults depend on the
1181 HAVE_* flags defines of insn-flags.h. But insn-flags.h is not always
1182 included by files that do include defaults.h.
1183
1184 Fortunately, the default macro definitions that depend on the HAVE_*
1185 macros are also the ones that will only be used inside GCC itself, i.e.
1186 not in the gen* programs or in target objects like libgcc.
1187
1188 Obviously, it would be best to keep this section of defaults.h as small
1189 as possible, by converting the macros defined below to target hooks or
1190 functions.
1191 */
1192
1193 /* The default branch cost is 1. */
1194 #ifndef BRANCH_COST
1195 #define BRANCH_COST(speed_p, predictable_p) 1
1196 #endif
1197
1198 /* If a memory-to-memory move would take MOVE_RATIO or more simple
1199 move-instruction sequences, we will do a movmem or libcall instead. */
1200
1201 #ifndef MOVE_RATIO
1202 #if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti)
1203 #define MOVE_RATIO(speed) 2
1204 #else
1205 /* If we are optimizing for space (-Os), cut down the default move ratio. */
1206 #define MOVE_RATIO(speed) ((speed) ? 15 : 3)
1207 #endif
1208 #endif
1209
1210 /* If a clear memory operation would take CLEAR_RATIO or more simple
1211 move-instruction sequences, we will do a setmem or libcall instead. */
1212
1213 #ifndef CLEAR_RATIO
1214 #if defined (HAVE_setmemqi) || defined (HAVE_setmemhi) || defined (HAVE_setmemsi) || defined (HAVE_setmemdi) || defined (HAVE_setmemti)
1215 #define CLEAR_RATIO(speed) 2
1216 #else
1217 /* If we are optimizing for space, cut down the default clear ratio. */
1218 #define CLEAR_RATIO(speed) ((speed) ? 15 :3)
1219 #endif
1220 #endif
1221
1222 /* If a memory set (to value other than zero) operation would take
1223 SET_RATIO or more simple move-instruction sequences, we will do a movmem
1224 or libcall instead. */
1225 #ifndef SET_RATIO
1226 #define SET_RATIO(speed) MOVE_RATIO(speed)
1227 #endif
1228
1229 /* Supply a default definition for FUNCTION_ARG_PADDING:
1230 usually pad upward, but pad short args downward on
1231 big-endian machines. */
1232
1233 #define DEFAULT_FUNCTION_ARG_PADDING(MODE, TYPE) \
1234 (! BYTES_BIG_ENDIAN \
1235 ? upward \
1236 : (((MODE) == BLKmode \
1237 ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
1238 && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \
1239 : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \
1240 ? downward : upward))
1241
1242 #ifndef FUNCTION_ARG_PADDING
1243 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
1244 DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE))
1245 #endif
1246
1247 /* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save.
1248 Normally move_insn, so Pmode stack pointer. */
1249
1250 #ifndef STACK_SAVEAREA_MODE
1251 #define STACK_SAVEAREA_MODE(LEVEL) Pmode
1252 #endif
1253
1254 /* Supply a default definition of STACK_SIZE_MODE for
1255 allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */
1256
1257 #ifndef STACK_SIZE_MODE
1258 #define STACK_SIZE_MODE word_mode
1259 #endif
1260
1261 /* Provide default values for the macros controlling stack checking. */
1262
1263 /* The default is neither full builtin stack checking... */
1264 #ifndef STACK_CHECK_BUILTIN
1265 #define STACK_CHECK_BUILTIN 0
1266 #endif
1267
1268 /* ...nor static builtin stack checking. */
1269 #ifndef STACK_CHECK_STATIC_BUILTIN
1270 #define STACK_CHECK_STATIC_BUILTIN 0
1271 #endif
1272
1273 /* The default interval is one page (4096 bytes). */
1274 #ifndef STACK_CHECK_PROBE_INTERVAL_EXP
1275 #define STACK_CHECK_PROBE_INTERVAL_EXP 12
1276 #endif
1277
1278 /* The default is not to move the stack pointer. */
1279 #ifndef STACK_CHECK_MOVING_SP
1280 #define STACK_CHECK_MOVING_SP 0
1281 #endif
1282
1283 /* This is a kludge to try to capture the discrepancy between the old
1284 mechanism (generic stack checking) and the new mechanism (static
1285 builtin stack checking). STACK_CHECK_PROTECT needs to be bumped
1286 for the latter because part of the protection area is effectively
1287 included in STACK_CHECK_MAX_FRAME_SIZE for the former. */
1288 #ifdef STACK_CHECK_PROTECT
1289 #define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT
1290 #else
1291 #define STACK_OLD_CHECK_PROTECT \
1292 (targetm.except_unwind_info (&global_options) == UI_SJLJ \
1293 ? 75 * UNITS_PER_WORD \
1294 : 8 * 1024)
1295 #endif
1296
1297 /* Minimum amount of stack required to recover from an anticipated stack
1298 overflow detection. The default value conveys an estimate of the amount
1299 of stack required to propagate an exception. */
1300 #ifndef STACK_CHECK_PROTECT
1301 #define STACK_CHECK_PROTECT \
1302 (targetm.except_unwind_info (&global_options) == UI_SJLJ \
1303 ? 75 * UNITS_PER_WORD \
1304 : 12 * 1024)
1305 #endif
1306
1307 /* Make the maximum frame size be the largest we can and still only need
1308 one probe per function. */
1309 #ifndef STACK_CHECK_MAX_FRAME_SIZE
1310 #define STACK_CHECK_MAX_FRAME_SIZE \
1311 ((1 << STACK_CHECK_PROBE_INTERVAL_EXP) - UNITS_PER_WORD)
1312 #endif
1313
1314 /* This is arbitrary, but should be large enough everywhere. */
1315 #ifndef STACK_CHECK_FIXED_FRAME_SIZE
1316 #define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD)
1317 #endif
1318
1319 /* Provide a reasonable default for the maximum size of an object to
1320 allocate in the fixed frame. We may need to be able to make this
1321 controllable by the user at some point. */
1322 #ifndef STACK_CHECK_MAX_VAR_SIZE
1323 #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100)
1324 #endif
1325
1326 /* By default, the C++ compiler will use function addresses in the
1327 vtable entries. Setting this nonzero tells the compiler to use
1328 function descriptors instead. The value of this macro says how
1329 many words wide the descriptor is (normally 2). It is assumed
1330 that the address of a function descriptor may be treated as a
1331 pointer to a function. */
1332 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
1333 #define TARGET_VTABLE_USES_DESCRIPTORS 0
1334 #endif
1335
1336 #ifndef SWITCHABLE_TARGET
1337 #define SWITCHABLE_TARGET 0
1338 #endif
1339
1340 #endif /* GCC_INSN_FLAGS_H */
1341
1168 #endif /* ! GCC_DEFAULTS_H */ 1342 #endif /* ! GCC_DEFAULTS_H */