* reload1.c (fixup_abnormal_edges): Remove unused variable.
[official-gcc.git] / gcc / builtins.def
blob40f5ccd86dfb172a09387a0f7c3c13678ab23ed2
1 /* This file contains the definitions and documentation for the
2 builtins used in the GNU compiler.
3 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
22 /* Before including this file, you should define a macro:
24 DEF_BUILTIN (ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P,
25 FALLBACK_P, NONANSI_P, ATTRS)
27 This macro will be called once for each builtin function. The
28 ENUM will be of type `enum built_in_function', and will indicate
29 which builtin function is being processed. The NAME of the builtin
30 function (which will always start with `__builtin_') is a string
31 literal. The CLASS is of type `enum built_in_class' and indicates
32 what kind of builtin is being processed.
34 Some builtins are actually two separate functions. For example,
35 for `strcmp' there are two builtin functions; `__builtin_strcmp'
36 and `strcmp' itself. Both behave identically. Other builtins
37 define only the `__builtin' variant. If BOTH_P is TRUE, then this
38 builtin has both variants; otherwise, it is has only the first
39 variant.
41 TYPE indicates the type of the function. The symbols correspond to
42 enumerals from builtin-types.def. If BOTH_P is true, then LIBTYPE
43 is the type of the non-`__builtin_' variant. Otherwise, LIBTYPE
44 should be ignored.
46 If FALLBACK_P is true then, if for some reason, the compiler cannot
47 expand the builtin function directly, it will call the
48 corresponding library function (which does not have the
49 `__builtin_' prefix.
51 If NONANSI_P is true, then the non-`__builtin_' variant is not an
52 ANSI/ISO library function, and so we should pretend it does not
53 exist when compiling in ANSI conformant mode.
55 ATTRs is an attribute list as defined in builtin-attrs.def that
56 describes the attributes of this builtin function. */
58 /* A GCC builtin (like __builtin_saveregs) is provided by the
59 compiler, but does not correspond to a function in the standard
60 library. */
61 #undef DEF_GCC_BUILTIN
62 #define DEF_GCC_BUILTIN(ENUM, NAME, TYPE) \
63 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
64 false, false, false, ATTR_NULL)
67 /* A fallback builtin is a builtin (like __builtin_puts) that falls
68 back to the corresopnding library function if necessary -- but
69 for which we should not introduce the non-`__builtin' variant of
70 the name. */
71 #undef DEF_FALLBACK_BUILTIN
72 #define DEF_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
73 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
74 false, true, false, ATTRS)
76 /* Like DEF_FALLBACK_BUILTIN, except that the function is not one that
77 is specified by ANSI/ISO C. So, when we're being fully conformant
78 we ignore the version of these builtins that does not begin with
79 __builtin. */
80 #undef DEF_EXT_FALLBACK_BUILTIN
81 #define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE) \
82 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
83 false, true, true, ATTR_NOTHROW_LIST)
85 /* A library builtin (like __builtin_strchr) is a builtin equivalent
86 of an ANSI/ISO standard library function. In addition to the
87 `__builtin' version, we will create an ordinary version (e.g,
88 `strchr') as well. If we cannot compute the answer using the
89 builtin function, we will fall back to the standard library
90 version. */
91 #undef DEF_LIB_BUILTIN
92 #define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
93 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
94 true, true, false, ATTRS)
96 /* Like DEF_LIB_BUILTIN, except that a call to the builtin should
97 never fall back to the library version. */
98 #undef DEF_LIB_ALWAYS_BUILTIN
99 #define DEF_LIB_ALWAYS_BUILTIN(ENUM, NAME, TYPE) \
100 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
101 true, false, true, ATTR_CONST_NOTHROW_LIST)
103 /* Like DEF_LIB_BUILTIN, except that the function is not one that is
104 specified by ANSI/ISO C. So, when we're being fully conformant we
105 ignore the version of these builtins that does not begin with
106 __builtin. */
107 #undef DEF_EXT_LIB_BUILTIN
108 #define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
109 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
110 true, true, true, ATTRS)
112 /* Like DEF_LIB_BUILTIN, except that the function is only a part of
113 the standard in C99 or above. */
114 #undef DEF_C99_BUILTIN
115 #define DEF_C99_BUILTIN(ENUM, NAME, TYPE) \
116 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
117 true, !flag_isoc99, true, ATTR_NOTHROW_LIST)
119 /* Like DEF_LIB_BUILTIN, except that the function is expanded in the
120 front-end. */
121 #undef DEF_FRONT_END_LIB_BUILTIN
122 #define DEF_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
123 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
124 true, true, false, ATTRS)
126 /* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
127 that is specified by ANSI/ISO C. So, when we're being fully
128 conformant we ignore the version of these builtins that does not
129 begin with __builtin. */
130 #undef DEF_EXT_FRONT_END_LIB_BUILTIN
131 #define DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
132 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
133 true, true, true, ATTRS)
135 /* A built-in that is not currently used. */
136 #undef DEF_UNUSED_BUILTIN
137 #define DEF_UNUSED_BUILTIN(X) \
138 DEF_BUILTIN (X, (const char *) NULL, NOT_BUILT_IN, BT_LAST, \
139 BT_LAST, false, false, false, ATTR_NOTHROW_LIST)
141 /* If SMALL_STACK is defined, then `alloca' is only defined in its
142 `__builtin' form. */
143 #if SMALL_STACK
144 DEF_FALLBACK_BUILTIN(BUILT_IN_ALLOCA,
145 "__builtin_alloca",
146 BT_FN_PTR_SIZE,
147 ATTR_MALLOC_NOTHROW_LIST)
148 #else
149 DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA,
150 "__builtin_alloca",
151 BT_FN_PTR_SIZE,
152 ATTR_MALLOC_NOTHROW_LIST)
153 #endif
155 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_ABS,
156 "__builtin_abs",
157 BT_FN_INT_INT)
158 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_LABS,
159 "__builtin_labs",
160 BT_FN_LONG_LONG)
162 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABS,
163 "__builtin_fabs",
164 BT_FN_DOUBLE_DOUBLE)
165 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSF,
166 "__builtin_fabsf",
167 BT_FN_FLOAT_FLOAT)
168 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSL,
169 "__builtin_fabsl",
170 BT_FN_LONG_DOUBLE_LONG_DOUBLE)
172 DEF_C99_BUILTIN(BUILT_IN_LLABS,
173 "__builtin_llabs",
174 BT_FN_LONGLONG_LONGLONG)
175 DEF_C99_BUILTIN(BUILT_IN_IMAXABS,
176 "__builtin_imaxabs",
177 BT_FN_INTMAX_INTMAX)
178 DEF_C99_BUILTIN(BUILT_IN_CONJ,
179 "__builtin_conj",
180 BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE)
181 DEF_C99_BUILTIN(BUILT_IN_CONJF,
182 "__builtin_conjf",
183 BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT)
184 DEF_C99_BUILTIN(BUILT_IN_CONJL,
185 "__builtin_conjl",
186 BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
187 DEF_C99_BUILTIN(BUILT_IN_CREAL,
188 "__builtin_creal",
189 BT_FN_DOUBLE_COMPLEX_DOUBLE)
190 DEF_C99_BUILTIN(BUILT_IN_CREALF,
191 "__builtin_crealf",
192 BT_FN_FLOAT_COMPLEX_FLOAT)
193 DEF_C99_BUILTIN(BUILT_IN_CREALL,
194 "__builtin_creall",
195 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
196 DEF_C99_BUILTIN(BUILT_IN_CIMAG,
197 "__builtin_cimag",
198 BT_FN_DOUBLE_COMPLEX_DOUBLE)
199 DEF_C99_BUILTIN(BUILT_IN_CIMAGF,
200 "__builtin_cimagf",
201 BT_FN_FLOAT_COMPLEX_FLOAT)
202 DEF_C99_BUILTIN(BUILT_IN_CIMAGL,
203 "__builtin_cimagl",
204 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE)
206 DEF_UNUSED_BUILTIN(BUILT_IN_DIV)
207 DEF_UNUSED_BUILTIN(BUILT_IN_LDIV)
208 DEF_UNUSED_BUILTIN(BUILT_IN_FFLOOR)
209 DEF_UNUSED_BUILTIN(BUILT_IN_FCEIL)
210 DEF_UNUSED_BUILTIN(BUILT_IN_FMOD)
211 DEF_UNUSED_BUILTIN(BUILT_IN_FREM)
213 /* The system prototypes for `bzero' and `bcmp' functions have many
214 variations, so don't specify parameters to avoid conflicts. The
215 expand_* functions check the argument types anyway. */
216 DEF_BUILTIN (BUILT_IN_BZERO,
217 "__builtin_bzero",
218 BUILT_IN_NORMAL,
219 BT_FN_VOID_PTR_SIZE,
220 BT_FN_VOID_VAR,
221 true, true, true,
222 ATTR_NOTHROW_LIST)
223 DEF_BUILTIN (BUILT_IN_BCMP,
224 "__builtin_bcmp",
225 BUILT_IN_NORMAL,
226 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
227 BT_FN_INT_VAR,
228 true, true, true,
229 ATTR_PURE_NOTHROW_LIST)
231 DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
232 "__builtin_ffs",
233 BT_FN_INT_INT,
234 ATTR_CONST_NOTHROW_LIST)
235 DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX,
236 "__builtin_index",
237 BT_FN_STRING_CONST_STRING_INT,
238 ATTR_PURE_NOTHROW_LIST)
239 DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
240 "__builtin_rindex",
241 BT_FN_STRING_CONST_STRING_INT,
242 ATTR_PURE_NOTHROW_LIST)
244 DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
245 "__builtin_memcpy",
246 BT_FN_PTR_PTR_CONST_PTR_SIZE,
247 ATTR_NOTHROW_LIST)
248 DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
249 "__builtin_memcmp",
250 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
251 ATTR_PURE_NOTHROW_LIST)
252 DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
253 "__builtin_memset",
254 BT_FN_PTR_PTR_INT_SIZE,
255 ATTR_NOTHROW_LIST)
257 DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
258 "__builtin_strcat",
259 BT_FN_STRING_STRING_CONST_STRING,
260 ATTR_NOTHROW_LIST)
261 DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
262 "__builtin_strncat",
263 BT_FN_STRING_STRING_CONST_STRING_SIZE,
264 ATTR_NOTHROW_LIST)
265 DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
266 "__builtin_strcpy",
267 BT_FN_STRING_STRING_CONST_STRING,
268 ATTR_NOTHROW_LIST)
269 DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
270 "__builtin_strncpy",
271 BT_FN_STRING_STRING_CONST_STRING_SIZE,
272 ATTR_NOTHROW_LIST)
273 DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
274 "__builtin_strcmp",
275 BT_FN_INT_CONST_STRING_CONST_STRING,
276 ATTR_PURE_NOTHROW_LIST)
277 DEF_LIB_BUILTIN(BUILT_IN_STRNCMP,
278 "__builtin_strncmp",
279 BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
280 ATTR_PURE_NOTHROW_LIST)
281 DEF_LIB_BUILTIN(BUILT_IN_STRLEN,
282 "__builtin_strlen",
283 BT_FN_SIZE_CONST_STRING,
284 ATTR_PURE_NOTHROW_LIST)
285 DEF_LIB_BUILTIN(BUILT_IN_STRSTR,
286 "__builtin_strstr",
287 BT_FN_STRING_CONST_STRING_CONST_STRING,
288 ATTR_PURE_NOTHROW_LIST)
289 DEF_LIB_BUILTIN(BUILT_IN_STRPBRK,
290 "__builtin_strpbrk",
291 BT_FN_STRING_CONST_STRING_CONST_STRING,
292 ATTR_PURE_NOTHROW_LIST)
293 DEF_LIB_BUILTIN(BUILT_IN_STRSPN,
294 "__builtin_strspn",
295 BT_FN_SIZE_CONST_STRING_CONST_STRING,
296 ATTR_PURE_NOTHROW_LIST)
297 DEF_LIB_BUILTIN(BUILT_IN_STRCSPN,
298 "__builtin_strcspn",
299 BT_FN_SIZE_CONST_STRING_CONST_STRING,
300 ATTR_PURE_NOTHROW_LIST)
301 DEF_LIB_BUILTIN(BUILT_IN_STRCHR,
302 "__builtin_strchr",
303 BT_FN_STRING_CONST_STRING_INT,
304 ATTR_PURE_NOTHROW_LIST)
305 DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
306 "__builtin_strrchr",
307 BT_FN_STRING_CONST_STRING_INT,
308 ATTR_PURE_NOTHROW_LIST)
310 DEF_LIB_BUILTIN(BUILT_IN_SQRT,
311 "__builtin_sqrt",
312 BT_FN_DOUBLE_DOUBLE,
313 flag_errno_math ? ATTR_NOTHROW_LIST
314 : (flag_unsafe_math_optimizations
315 ? ATTR_CONST_NOTHROW_LIST
316 : ATTR_PURE_NOTHROW_LIST))
317 DEF_LIB_BUILTIN(BUILT_IN_SIN,
318 "__builtin_sin",
319 BT_FN_DOUBLE_DOUBLE,
320 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
321 : ATTR_PURE_NOTHROW_LIST)
322 DEF_LIB_BUILTIN(BUILT_IN_COS,
323 "__builtin_cos",
324 BT_FN_DOUBLE_DOUBLE,
325 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
326 : ATTR_PURE_NOTHROW_LIST)
327 DEF_LIB_BUILTIN(BUILT_IN_SQRTF,
328 "__builtin_sqrtf",
329 BT_FN_FLOAT_FLOAT,
330 flag_errno_math ? ATTR_NOTHROW_LIST
331 : (flag_unsafe_math_optimizations
332 ? ATTR_CONST_NOTHROW_LIST
333 : ATTR_PURE_NOTHROW_LIST))
334 DEF_LIB_BUILTIN(BUILT_IN_SINF,
335 "__builtin_sinf",
336 BT_FN_FLOAT_FLOAT,
337 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
338 : ATTR_PURE_NOTHROW_LIST)
339 DEF_LIB_BUILTIN(BUILT_IN_COSF,
340 "__builtin_cosf",
341 BT_FN_FLOAT_FLOAT,
342 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
343 : ATTR_PURE_NOTHROW_LIST)
344 DEF_LIB_BUILTIN(BUILT_IN_SQRTL,
345 "__builtin_sqrtl",
346 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
347 flag_errno_math ? ATTR_NOTHROW_LIST
348 : (flag_unsafe_math_optimizations
349 ? ATTR_CONST_NOTHROW_LIST
350 : ATTR_PURE_NOTHROW_LIST))
351 DEF_LIB_BUILTIN(BUILT_IN_SINL,
352 "__builtin_sinl",
353 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
354 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
355 : ATTR_PURE_NOTHROW_LIST)
356 DEF_LIB_BUILTIN(BUILT_IN_COSL,
357 "__builtin_cosl",
358 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
359 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
360 : ATTR_PURE_NOTHROW_LIST)
362 DEF_UNUSED_BUILTIN(BUILT_IN_GETEXP)
363 DEF_UNUSED_BUILTIN(BUILT_IN_GETMAN)
365 DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
366 "__builtin_saveregs",
367 BT_FN_PTR_VAR)
368 DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
369 "__builtin_classify_type",
370 BT_FN_INT_VAR)
371 DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
372 "__builtin_next_arg",
373 BT_FN_PTR_VAR)
374 DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
375 "__builtin_args_info",
376 BT_FN_INT_INT)
377 DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
378 "__builtin_constant_p",
379 BT_FN_INT_VAR)
380 DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
381 "__builtin_frame_address",
382 BT_FN_PTR_UNSIGNED)
383 DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
384 "__builtin_return_address",
385 BT_FN_PTR_UNSIGNED)
386 DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
387 "__builtin_aggregate_incoming_address",
388 BT_FN_PTR_VAR)
389 DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
390 "__builtin_apply_args",
391 BT_FN_PTR_VAR)
392 DEF_GCC_BUILTIN(BUILT_IN_APPLY,
393 "__builtin_apply",
394 BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE)
395 DEF_GCC_BUILTIN(BUILT_IN_RETURN,
396 "__builtin_return",
397 BT_FN_VOID_PTR)
398 DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
399 "__builtin_setjmp",
400 BT_FN_INT_PTR)
401 DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
402 "__builtin_longjmp",
403 BT_FN_VOID_PTR_INT)
404 DEF_GCC_BUILTIN(BUILT_IN_TRAP,
405 "__builtin_trap",
406 BT_FN_VOID)
407 DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
408 "__builtin_prefetch",
409 BT_FN_VOID_CONST_PTR_VAR)
411 /* Stdio builtins. */
412 DEF_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR,
413 "__builtin_putchar",
414 BT_FN_INT_INT,
415 ATTR_NOTHROW_LIST)
416 DEF_FALLBACK_BUILTIN(BUILT_IN_PUTS,
417 "__builtin_puts",
418 BT_FN_INT_CONST_STRING,
419 ATTR_NOTHROW_LIST)
420 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF,
421 "__builtin_printf",
422 BT_FN_INT_CONST_STRING_VAR,
423 ATTR_FORMAT_PRINTF_1_2)
424 DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
425 "__builtin_fputc",
426 BT_FN_INT_INT_PTR,
427 ATTR_NOTHROW_LIST)
428 /* Declare the __builtin_ style with arguments and the regular style
429 without them. We rely on stdio.h to supply the arguments for the
430 regular style declaration since we had to use void* instead of
431 FILE* in the __builtin_ prototype supplied here. */
432 DEF_BUILTIN (BUILT_IN_FPUTS,
433 "__builtin_fputs",
434 BUILT_IN_NORMAL,
435 BT_FN_INT_CONST_STRING_PTR,
436 BT_FN_INT_VAR,
437 true, true, false, ATTR_NOTHROW_LIST)
438 DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
439 "__builtin_fwrite",
440 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
441 ATTR_NOTHROW_LIST)
442 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
443 "__builtin_fprintf",
444 BT_FN_INT_PTR_CONST_STRING_VAR,
445 ATTR_FORMAT_PRINTF_2_3)
447 /* Stdio unlocked builtins. */
449 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
450 "__builtin_putchar_unlocked",
451 BT_FN_INT_INT)
452 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
453 "__builtin_puts_unlocked",
454 BT_FN_INT_CONST_STRING)
455 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
456 "__builtin_printf_unlocked",
457 BT_FN_INT_CONST_STRING_VAR,
458 ATTR_FORMAT_PRINTF_1_2)
459 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
460 "__builtin_fputc_unlocked",
461 BT_FN_INT_INT_PTR)
462 /* Declare the __builtin_ style with arguments and the regular style
463 without them. We rely on stdio.h to supply the arguments for the
464 regular style declaration since we had to use void* instead of
465 FILE* in the __builtin_ prototype supplied here. */
466 DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
467 "__builtin_fputs_unlocked",
468 BUILT_IN_NORMAL,
469 BT_FN_INT_CONST_STRING_PTR,
470 BT_FN_INT_VAR,
471 true, true, true, ATTR_NOTHROW_LIST)
472 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
473 "__builtin_fwrite_unlocked",
474 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR)
475 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
476 "__builtin_fprintf_unlocked",
477 BT_FN_INT_PTR_CONST_STRING_VAR,
478 ATTR_FORMAT_PRINTF_2_3)
480 /* ISO C99 floating point unordered comparisons. */
481 DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
482 "__builtin_isgreater",
483 BT_FN_INT_VAR)
484 DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
485 "__builtin_isgreaterequal",
486 BT_FN_INT_VAR)
487 DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
488 "__builtin_isless",
489 BT_FN_INT_VAR)
490 DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
491 "__builtin_islessequal",
492 BT_FN_INT_VAR)
493 DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
494 "__builtin_islessgreater",
495 BT_FN_INT_VAR)
496 DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
497 "__builtin_isunordered",
498 BT_FN_INT_VAR)
500 /* Various hooks for the DWARF 2 __throw routine. */
501 DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
502 "__builtin_unwind_init",
503 BT_FN_VOID)
504 DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
505 "__builtin_dwarf_cfa",
506 BT_FN_PTR)
507 DEF_GCC_BUILTIN(BUILT_IN_DWARF_FP_REGNUM,
508 "__builtin_dwarf_fp_regnum",
509 BT_FN_UNSIGNED)
510 DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
511 "__builtin_init_dwarf_reg_size_table",
512 BT_FN_VOID_PTR)
513 DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
514 "__builtin_frob_return_addr",
515 BT_FN_PTR_PTR)
516 DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
517 "__builtin_extract_return_addr",
518 BT_FN_PTR_PTR)
519 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
520 "__builtin_eh_return",
521 BT_FN_VOID_PTRMODE_PTR)
522 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
523 "__builtin_eh_return_data_regno",
524 BT_FN_INT_INT)
526 /* Variable argument list (stdarg.h) support */
527 DEF_GCC_BUILTIN(BUILT_IN_VA_START,
528 "__builtin_va_start",
529 BT_FN_VOID_VALIST_REF_VAR)
530 DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
531 "__builtin_stdarg_start",
532 BT_FN_VOID_VALIST_REF_VAR)
533 DEF_GCC_BUILTIN(BUILT_IN_VA_END,
534 "__builtin_va_end",
535 BT_FN_VOID_VALIST_REF)
536 DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
537 "__builtin_va_copy",
538 BT_FN_VOID_VALIST_REF_VALIST_ARG)
540 DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
541 "__builtin_expect",
542 BT_FN_LONG_LONG_LONG)
544 /* C++ extensions */
545 DEF_UNUSED_BUILTIN(BUILT_IN_NEW)
546 DEF_UNUSED_BUILTIN(BUILT_IN_VEC_NEW)
547 DEF_UNUSED_BUILTIN(BUILT_IN_DELETE)
548 DEF_UNUSED_BUILTIN(BUILT_IN_VEC_DELETE)
550 /* Declare abort, exit, _exit and _Exit */
551 DEF_BUILTIN (BUILT_IN_ABORT,
552 "__builtin_abort",
553 NOT_BUILT_IN,
554 BT_FN_VOID,
555 BT_FN_VOID,
556 1, 0, 0,
557 ATTR_NORETURN_NOTHROW_LIST)
559 DEF_BUILTIN (BUILT_IN_EXIT,
560 "__builtin_exit",
561 NOT_BUILT_IN,
562 BT_FN_VOID_INT,
563 BT_FN_VOID_INT,
564 1, 0, 0,
565 ATTR_NORETURN_NOTHROW_LIST)
567 DEF_BUILTIN (BUILT_IN__EXIT,
568 "__builtin__exit",
569 NOT_BUILT_IN,
570 BT_FN_VOID_INT,
571 BT_FN_VOID_INT,
572 1, 0, 1,
573 ATTR_NORETURN_NOTHROW_LIST)
575 DEF_BUILTIN (BUILT_IN__EXIT2,
576 "__builtin__Exit",
577 NOT_BUILT_IN,
578 BT_FN_VOID_INT,
579 BT_FN_VOID_INT,
580 1, 0, !flag_isoc99,
581 ATTR_NORETURN_NOTHROW_LIST)