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
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
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
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
, IMPLICIT
)
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
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
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
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 IMPLICIT specifies condition when the builtin can be produced by
59 compiler. For instance C90 reserves floorf function
, but does not
60 define it
's meaning. When user uses floorf we may assume that the
61 floorf has the meaning we expect, but we can't produce floorf by
62 simplifing
floor((double
)float
) since runtime don
't need to implement it. */
64 /* A GCC builtin (like __builtin_saveregs) is provided by the
65 compiler, but does not correspond to a function in the standard
67 #undef DEF_GCC_BUILTIN
68 #define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
69 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
70 false, false, false, ATTRS, true)
73 /* A fallback builtin is a builtin (like __builtin_puts) that falls
74 back to the corresopnding library function if necessary -- but
75 for which we should not introduce the non-`__builtin' variant of
77 #undef DEF_FALLBACK_BUILTIN
78 #define
DEF_FALLBACK_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
79 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_NORMAL
, TYPE, TYPE, \
80 false
, true
, false
, ATTRS
, true
)
82 /* Like DEF_FALLBACK_BUILTIN
, except that the function is not one that
83 is specified by ANSI
/ISO C. So
, when we
're being fully conformant
84 we ignore the version of these builtins that does not begin with
86 #undef DEF_EXT_FALLBACK_BUILTIN
87 #define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE) \
88 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
89 false, true, true, ATTR_NOTHROW_LIST, true)
91 /* A library builtin (like __builtin_strchr) is a builtin equivalent
92 of an ANSI/ISO standard library function. In addition to the
93 `__builtin' version
, we will create an ordinary
version (e.g
,
94 `strchr
') as well. If we cannot compute the answer using the
95 builtin function, we will fall back to the standard library
97 #undef DEF_LIB_BUILTIN
98 #define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
99 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
100 true, true, false, ATTRS, true)
102 /* Like DEF_LIB_BUILTIN, except that a call to the builtin should
103 never fall back to the library version. */
104 #undef DEF_LIB_ALWAYS_BUILTIN
105 #define DEF_LIB_ALWAYS_BUILTIN(ENUM, NAME, TYPE) \
106 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
107 true, false, true, ATTR_CONST_NOTHROW_LIST, true)
109 /* Like DEF_LIB_BUILTIN, except that the function is not one that is
110 specified by ANSI/ISO C. So, when we're being fully conformant we
111 ignore the version of these builtins that does not begin with
113 #undef DEF_EXT_LIB_BUILTIN
114 #define
DEF_EXT_LIB_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
115 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_NORMAL
, TYPE, TYPE, \
116 true
, true
, true
, ATTRS
, false
)
118 /* Like DEF_LIB_BUILTIN
, except that the function is only a part of
119 the standard in C99 or above.
*/
120 #undef DEF_C99_BUILTIN
121 #define
DEF_C99_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
122 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_NORMAL
, TYPE, TYPE, \
123 true
, true
, !flag_isoc99
, ATTRS
, TARGET_C99_FUNCTIONS
)
125 /* Builtin that is specified by C99 and C90 reserve the name for future use.
126 We can still recognize the builtin in C90 mode but we can
't produce it
128 #undef DEF_C99_C90RES_BUILTIN
129 #define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
130 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
131 true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
133 /* Like DEF_LIB_BUILTIN, except that the function is expanded in the
135 #undef DEF_FRONT_END_LIB_BUILTIN
136 #define DEF_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
137 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
138 true, true, false, ATTRS, true)
140 /* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
141 that is specified by ANSI/ISO C. So, when we're being fully
142 conformant we ignore the version of these builtins that does not
143 begin with __builtin.
*/
144 #undef DEF_EXT_FRONT_END_LIB_BUILTIN
145 #define
DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM
, NAME
, TYPE, ATTRS
) \
146 DEF_BUILTIN (ENUM
, NAME
, BUILT_IN_FRONTEND
, TYPE, TYPE, \
147 true
, true
, true
, ATTRS
, true
)
149 /* A built
-in that is not currently used.
*/
150 #undef DEF_UNUSED_BUILTIN
151 #define
DEF_UNUSED_BUILTIN(X
) \
152 DEF_BUILTIN (X
, (const char *) NULL
, NOT_BUILT_IN
, BT_LAST
, \
153 BT_LAST
, false
, false
, false
, ATTR_NOTHROW_LIST
, false
)
155 /* If SMALL_STACK is defined
, then `alloca
' is only defined in its
158 DEF_FALLBACK_BUILTIN(BUILT_IN_ALLOCA
,
161 ATTR_MALLOC_NOTHROW_LIST
)
163 DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA
,
166 ATTR_MALLOC_NOTHROW_LIST
)
169 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_ABS
,
172 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_LABS
,
176 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABS
,
179 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSF
,
182 DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSL
,
184 BT_FN_LONG_DOUBLE_LONG_DOUBLE
)
186 DEF_LIB_BUILTIN(BUILT_IN_FLOOR
,
189 ATTR_CONST_NOTHROW_LIST
)
190 DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORF
,
193 ATTR_CONST_NOTHROW_LIST
)
194 DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORL
,
196 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
197 ATTR_CONST_NOTHROW_LIST
)
199 DEF_LIB_BUILTIN(BUILT_IN_CEIL
,
202 ATTR_CONST_NOTHROW_LIST
)
203 DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILF
,
206 ATTR_CONST_NOTHROW_LIST
)
207 DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILL
,
209 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
210 ATTR_CONST_NOTHROW_LIST
)
212 DEF_C99_BUILTIN(BUILT_IN_ROUND
,
215 ATTR_CONST_NOTHROW_LIST
)
216 DEF_C99_BUILTIN(BUILT_IN_ROUNDF
,
219 ATTR_CONST_NOTHROW_LIST
)
220 DEF_C99_BUILTIN(BUILT_IN_ROUNDL
,
222 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
223 ATTR_CONST_NOTHROW_LIST
)
225 DEF_C99_BUILTIN(BUILT_IN_TRUNC
,
228 ATTR_CONST_NOTHROW_LIST
)
229 DEF_C99_BUILTIN(BUILT_IN_TRUNCF
,
232 ATTR_CONST_NOTHROW_LIST
)
233 DEF_C99_BUILTIN(BUILT_IN_TRUNCL
,
235 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
236 ATTR_CONST_NOTHROW_LIST
)
238 DEF_C99_BUILTIN(BUILT_IN_NEARBYINT
,
239 "__builtin_nearbyint",
241 ATTR_CONST_NOTHROW_LIST
)
242 DEF_C99_BUILTIN(BUILT_IN_NEARBYINTF
,
243 "__builtin_nearbyintf",
245 ATTR_CONST_NOTHROW_LIST
)
246 DEF_C99_BUILTIN(BUILT_IN_NEARBYINTL
,
247 "__builtin_nearbyintl",
248 BT_FN_LONG_DOUBLE_LONG_DOUBLE
,
249 ATTR_CONST_NOTHROW_LIST
)
251 DEF_C99_BUILTIN(BUILT_IN_LLABS
,
253 BT_FN_LONGLONG_LONGLONG
,
254 ATTR_CONST_NOTHROW_LIST
)
255 DEF_C99_BUILTIN(BUILT_IN_IMAXABS
,
258 ATTR_CONST_NOTHROW_LIST
)
259 DEF_C99_BUILTIN(BUILT_IN_CONJ
,
261 BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE
,
262 ATTR_CONST_NOTHROW_LIST
)
263 DEF_C99_BUILTIN(BUILT_IN_CONJF
,
265 BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT
,
266 ATTR_CONST_NOTHROW_LIST
)
267 DEF_C99_BUILTIN(BUILT_IN_CONJL
,
269 BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE
,
270 ATTR_CONST_NOTHROW_LIST
)
271 DEF_C99_BUILTIN(BUILT_IN_CREAL
,
273 BT_FN_DOUBLE_COMPLEX_DOUBLE
,
274 ATTR_CONST_NOTHROW_LIST
)
275 DEF_C99_BUILTIN(BUILT_IN_CREALF
,
277 BT_FN_FLOAT_COMPLEX_FLOAT
,
278 ATTR_CONST_NOTHROW_LIST
)
279 DEF_C99_BUILTIN(BUILT_IN_CREALL
,
281 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE
,
282 ATTR_CONST_NOTHROW_LIST
)
283 DEF_C99_BUILTIN(BUILT_IN_CIMAG
,
285 BT_FN_DOUBLE_COMPLEX_DOUBLE
,
286 ATTR_CONST_NOTHROW_LIST
)
287 DEF_C99_BUILTIN(BUILT_IN_CIMAGF
,
289 BT_FN_FLOAT_COMPLEX_FLOAT
,
290 ATTR_CONST_NOTHROW_LIST
)
291 DEF_C99_BUILTIN(BUILT_IN_CIMAGL
,
293 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE
,
294 ATTR_CONST_NOTHROW_LIST
)
296 DEF_UNUSED_BUILTIN(BUILT_IN_DIV
)
297 DEF_UNUSED_BUILTIN(BUILT_IN_LDIV
)
298 DEF_UNUSED_BUILTIN(BUILT_IN_FFLOOR
)
299 DEF_UNUSED_BUILTIN(BUILT_IN_FCEIL
)
300 DEF_UNUSED_BUILTIN(BUILT_IN_FMOD
)
301 DEF_UNUSED_BUILTIN(BUILT_IN_FREM
)
303 /* The system prototypes for `bzero
' and `bcmp' functions have many
304 variations
, so don
't specify parameters to avoid conflicts. The
305 expand_* functions check the argument types anyway. */
306 DEF_BUILTIN (BUILT_IN_BZERO,
312 ATTR_NOTHROW_LIST, false)
313 DEF_BUILTIN (BUILT_IN_BCMP,
316 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
319 ATTR_PURE_NOTHROW_LIST, false)
321 DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
324 ATTR_CONST_NOTHROW_LIST)
325 DEF_GCC_BUILTIN(BUILT_IN_CLZ,
328 ATTR_CONST_NOTHROW_LIST)
329 DEF_GCC_BUILTIN(BUILT_IN_CTZ,
332 ATTR_CONST_NOTHROW_LIST)
333 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNT,
334 "__builtin_popcount",
336 ATTR_CONST_NOTHROW_LIST)
337 DEF_GCC_BUILTIN(BUILT_IN_PARITY,
340 ATTR_CONST_NOTHROW_LIST)
342 DEF_GCC_BUILTIN(BUILT_IN_FFSL,
345 ATTR_CONST_NOTHROW_LIST)
346 DEF_GCC_BUILTIN(BUILT_IN_CLZL,
349 ATTR_CONST_NOTHROW_LIST)
350 DEF_GCC_BUILTIN(BUILT_IN_CTZL,
353 ATTR_CONST_NOTHROW_LIST)
354 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTL,
355 "__builtin_popcountl",
357 ATTR_CONST_NOTHROW_LIST)
358 DEF_GCC_BUILTIN(BUILT_IN_PARITYL,
361 ATTR_CONST_NOTHROW_LIST)
363 DEF_EXT_LIB_BUILTIN(BUILT_IN_FFSLL,
366 ATTR_CONST_NOTHROW_LIST)
367 DEF_GCC_BUILTIN(BUILT_IN_CLZLL,
370 ATTR_CONST_NOTHROW_LIST)
371 DEF_GCC_BUILTIN(BUILT_IN_CTZLL,
374 ATTR_CONST_NOTHROW_LIST)
375 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTLL,
376 "__builtin_popcountll",
378 ATTR_CONST_NOTHROW_LIST)
379 DEF_GCC_BUILTIN(BUILT_IN_PARITYLL,
380 "__builtin_parityll",
382 ATTR_CONST_NOTHROW_LIST)
384 DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX,
386 BT_FN_STRING_CONST_STRING_INT,
387 ATTR_PURE_NOTHROW_LIST)
388 DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
390 BT_FN_STRING_CONST_STRING_INT,
391 ATTR_PURE_NOTHROW_LIST)
393 DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
395 BT_FN_PTR_PTR_CONST_PTR_SIZE,
397 DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
399 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
400 ATTR_PURE_NOTHROW_LIST)
401 DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
403 BT_FN_PTR_PTR_INT_SIZE,
406 DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
408 BT_FN_STRING_STRING_CONST_STRING,
410 DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
412 BT_FN_STRING_STRING_CONST_STRING_SIZE,
414 DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
416 BT_FN_STRING_STRING_CONST_STRING,
418 DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
420 BT_FN_STRING_STRING_CONST_STRING_SIZE,
422 DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
424 BT_FN_INT_CONST_STRING_CONST_STRING,
425 ATTR_PURE_NOTHROW_LIST)
426 DEF_LIB_BUILTIN(BUILT_IN_STRNCMP,
428 BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
429 ATTR_PURE_NOTHROW_LIST)
430 DEF_LIB_BUILTIN(BUILT_IN_STRLEN,
432 BT_FN_SIZE_CONST_STRING,
433 ATTR_PURE_NOTHROW_LIST)
434 DEF_LIB_BUILTIN(BUILT_IN_STRSTR,
436 BT_FN_STRING_CONST_STRING_CONST_STRING,
437 ATTR_PURE_NOTHROW_LIST)
438 DEF_LIB_BUILTIN(BUILT_IN_STRPBRK,
440 BT_FN_STRING_CONST_STRING_CONST_STRING,
441 ATTR_PURE_NOTHROW_LIST)
442 DEF_LIB_BUILTIN(BUILT_IN_STRSPN,
444 BT_FN_SIZE_CONST_STRING_CONST_STRING,
445 ATTR_PURE_NOTHROW_LIST)
446 DEF_LIB_BUILTIN(BUILT_IN_STRCSPN,
448 BT_FN_SIZE_CONST_STRING_CONST_STRING,
449 ATTR_PURE_NOTHROW_LIST)
450 DEF_LIB_BUILTIN(BUILT_IN_STRCHR,
452 BT_FN_STRING_CONST_STRING_INT,
453 ATTR_PURE_NOTHROW_LIST)
454 DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
456 BT_FN_STRING_CONST_STRING_INT,
457 ATTR_PURE_NOTHROW_LIST)
459 DEF_LIB_BUILTIN(BUILT_IN_SQRT,
462 flag_errno_math ? ATTR_NOTHROW_LIST
463 : (flag_unsafe_math_optimizations
464 ? ATTR_CONST_NOTHROW_LIST
465 : ATTR_PURE_NOTHROW_LIST))
466 DEF_LIB_BUILTIN(BUILT_IN_SIN,
469 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
470 : ATTR_PURE_NOTHROW_LIST)
471 DEF_LIB_BUILTIN(BUILT_IN_COS,
474 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
475 : ATTR_PURE_NOTHROW_LIST)
476 DEF_LIB_BUILTIN(BUILT_IN_EXP,
479 flag_errno_math ? ATTR_NOTHROW_LIST
480 : (flag_unsafe_math_optimizations
481 ? ATTR_CONST_NOTHROW_LIST
482 : ATTR_PURE_NOTHROW_LIST))
483 DEF_LIB_BUILTIN(BUILT_IN_LOG,
486 flag_errno_math ? ATTR_NOTHROW_LIST
487 : (flag_unsafe_math_optimizations
488 ? ATTR_CONST_NOTHROW_LIST
489 : ATTR_PURE_NOTHROW_LIST))
490 DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTF,
493 flag_errno_math ? ATTR_NOTHROW_LIST
494 : (flag_unsafe_math_optimizations
495 ? ATTR_CONST_NOTHROW_LIST
496 : ATTR_PURE_NOTHROW_LIST))
497 DEF_C99_C90RES_BUILTIN(BUILT_IN_SINF,
500 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
501 : ATTR_PURE_NOTHROW_LIST)
502 DEF_C99_C90RES_BUILTIN(BUILT_IN_COSF,
505 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
506 : ATTR_PURE_NOTHROW_LIST)
507 DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPF,
510 flag_errno_math ? ATTR_NOTHROW_LIST
511 : (flag_unsafe_math_optimizations
512 ? ATTR_CONST_NOTHROW_LIST
513 : ATTR_PURE_NOTHROW_LIST))
514 DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGF,
517 flag_errno_math ? ATTR_NOTHROW_LIST
518 : (flag_unsafe_math_optimizations
519 ? ATTR_CONST_NOTHROW_LIST
520 : ATTR_PURE_NOTHROW_LIST))
521 DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTL,
523 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
524 flag_errno_math ? ATTR_NOTHROW_LIST
525 : (flag_unsafe_math_optimizations
526 ? ATTR_CONST_NOTHROW_LIST
527 : ATTR_PURE_NOTHROW_LIST))
528 DEF_C99_C90RES_BUILTIN(BUILT_IN_SINL,
530 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
531 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
532 : ATTR_PURE_NOTHROW_LIST)
533 DEF_C99_C90RES_BUILTIN(BUILT_IN_COSL,
535 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
536 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
537 : ATTR_PURE_NOTHROW_LIST)
538 DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPL,
540 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
541 flag_errno_math ? ATTR_NOTHROW_LIST
542 : (flag_unsafe_math_optimizations
543 ? ATTR_CONST_NOTHROW_LIST
544 : ATTR_PURE_NOTHROW_LIST))
545 DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGL,
547 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
548 flag_errno_math ? ATTR_NOTHROW_LIST
549 : (flag_unsafe_math_optimizations
550 ? ATTR_CONST_NOTHROW_LIST
551 : ATTR_PURE_NOTHROW_LIST))
553 DEF_GCC_BUILTIN(BUILT_IN_INF,
556 ATTR_CONST_NOTHROW_LIST)
557 DEF_GCC_BUILTIN(BUILT_IN_INFF,
560 ATTR_CONST_NOTHROW_LIST)
561 DEF_GCC_BUILTIN(BUILT_IN_INFL,
564 ATTR_CONST_NOTHROW_LIST)
566 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VAL,
567 "__builtin_huge_val",
569 ATTR_CONST_NOTHROW_LIST)
570 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALF,
571 "__builtin_huge_valf",
573 ATTR_CONST_NOTHROW_LIST)
574 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALL,
575 "__builtin_huge_vall",
577 ATTR_CONST_NOTHROW_LIST)
579 DEF_LIB_BUILTIN(BUILT_IN_NAN,
581 BT_FN_DOUBLE_CONST_STRING,
582 ATTR_CONST_NOTHROW_LIST)
583 DEF_LIB_BUILTIN(BUILT_IN_NANF,
585 BT_FN_FLOAT_CONST_STRING,
586 ATTR_CONST_NOTHROW_LIST)
587 DEF_LIB_BUILTIN(BUILT_IN_NANL,
589 BT_FN_LONG_DOUBLE_CONST_STRING,
590 ATTR_CONST_NOTHROW_LIST)
592 DEF_LIB_BUILTIN(BUILT_IN_NANS,
594 BT_FN_DOUBLE_CONST_STRING,
595 ATTR_CONST_NOTHROW_LIST)
596 DEF_LIB_BUILTIN(BUILT_IN_NANSF,
598 BT_FN_FLOAT_CONST_STRING,
599 ATTR_CONST_NOTHROW_LIST)
600 DEF_LIB_BUILTIN(BUILT_IN_NANSL,
602 BT_FN_LONG_DOUBLE_CONST_STRING,
603 ATTR_CONST_NOTHROW_LIST)
605 DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
606 "__builtin_saveregs",
609 DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
610 "__builtin_classify_type",
613 DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
614 "__builtin_next_arg",
617 DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
618 "__builtin_args_info",
621 DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
622 "__builtin_constant_p",
625 DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
626 "__builtin_frame_address",
629 DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
630 "__builtin_return_address",
633 DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
634 "__builtin_aggregate_incoming_address",
637 DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
638 "__builtin_apply_args",
641 DEF_GCC_BUILTIN(BUILT_IN_APPLY,
643 BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
645 DEF_GCC_BUILTIN(BUILT_IN_RETURN,
648 ATTR_NORETURN_NOTHROW_LIST)
649 DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
653 DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
656 ATTR_NORETURN_NOTHROW_LIST)
657 DEF_GCC_BUILTIN(BUILT_IN_TRAP,
660 ATTR_NORETURN_NOTHROW_LIST)
661 DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
662 "__builtin_prefetch",
663 BT_FN_VOID_CONST_PTR_VAR,
666 /* Stdio builtins. */
667 DEF_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR,
671 DEF_FALLBACK_BUILTIN(BUILT_IN_PUTS,
673 BT_FN_INT_CONST_STRING,
675 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF,
677 BT_FN_INT_CONST_STRING_VAR,
678 ATTR_FORMAT_PRINTF_1_2)
679 DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
683 /* Declare the __builtin_ style with arguments and the regular style
684 without them. We rely on stdio.h to supply the arguments for the
685 regular style declaration since we had to use void* instead of
686 FILE* in the __builtin_ prototype supplied here. */
687 DEF_BUILTIN (BUILT_IN_FPUTS,
690 BT_FN_INT_CONST_STRING_PTR,
692 true, true, false, ATTR_NOTHROW_LIST, true)
693 DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
695 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
697 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
699 BT_FN_INT_PTR_CONST_STRING_VAR,
700 ATTR_FORMAT_PRINTF_2_3)
702 /* Stdio unlocked builtins. */
704 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
705 "__builtin_putchar_unlocked",
707 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
708 "__builtin_puts_unlocked",
709 BT_FN_INT_CONST_STRING)
710 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
711 "__builtin_printf_unlocked",
712 BT_FN_INT_CONST_STRING_VAR,
713 ATTR_FORMAT_PRINTF_1_2)
714 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
715 "__builtin_fputc_unlocked",
717 /* Declare the __builtin_ style with arguments and the regular style
718 without them. We rely on stdio.h to supply the arguments for the
719 regular style declaration since we had to use void* instead of
720 FILE* in the __builtin_ prototype supplied here. */
721 DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
722 "__builtin_fputs_unlocked",
724 BT_FN_INT_CONST_STRING_PTR,
726 true, true, true, ATTR_NOTHROW_LIST, true)
727 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
728 "__builtin_fwrite_unlocked",
729 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR)
730 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
731 "__builtin_fprintf_unlocked",
732 BT_FN_INT_PTR_CONST_STRING_VAR,
733 ATTR_FORMAT_PRINTF_2_3)
735 /* ISO C99 floating point unordered comparisons. */
736 DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
737 "__builtin_isgreater",
739 ATTR_CONST_NOTHROW_LIST)
740 DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
741 "__builtin_isgreaterequal",
743 ATTR_CONST_NOTHROW_LIST)
744 DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
747 ATTR_CONST_NOTHROW_LIST)
748 DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
749 "__builtin_islessequal",
751 ATTR_CONST_NOTHROW_LIST)
752 DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
753 "__builtin_islessgreater",
755 ATTR_CONST_NOTHROW_LIST)
756 DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
757 "__builtin_isunordered",
759 ATTR_CONST_NOTHROW_LIST)
761 /* Various hooks for the DWARF 2 __throw routine. */
762 DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
763 "__builtin_unwind_init",
766 DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
767 "__builtin_dwarf_cfa",
770 DEF_GCC_BUILTIN(BUILT_IN_DWARF_FP_REGNUM,
771 "__builtin_dwarf_fp_regnum",
774 DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
775 "__builtin_init_dwarf_reg_size_table",
778 DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
779 "__builtin_frob_return_addr",
782 DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
783 "__builtin_extract_return_addr",
786 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
787 "__builtin_eh_return",
788 BT_FN_VOID_PTRMODE_PTR,
789 ATTR_NORETURN_NOTHROW_LIST)
790 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
791 "__builtin_eh_return_data_regno",
795 /* Variable argument list (stdarg.h) support */
796 DEF_GCC_BUILTIN(BUILT_IN_VA_START,
797 "__builtin_va_start",
798 BT_FN_VOID_VALIST_REF_VAR,
800 DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
801 "__builtin_stdarg_start",
802 BT_FN_VOID_VALIST_REF_VAR,
804 DEF_GCC_BUILTIN(BUILT_IN_VA_END,
806 BT_FN_VOID_VALIST_REF,
808 DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
810 BT_FN_VOID_VALIST_REF_VALIST_ARG,
813 DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
815 BT_FN_LONG_LONG_LONG,
819 DEF_UNUSED_BUILTIN(BUILT_IN_NEW)
820 DEF_UNUSED_BUILTIN(BUILT_IN_VEC_NEW)
821 DEF_UNUSED_BUILTIN(BUILT_IN_DELETE)
822 DEF_UNUSED_BUILTIN(BUILT_IN_VEC_DELETE)
824 /* Declare abort, exit, _exit and _Exit */
825 DEF_BUILTIN (BUILT_IN_ABORT,
831 ATTR_NORETURN_NOTHROW_LIST, true)
833 DEF_BUILTIN (BUILT_IN_EXIT,
839 ATTR_NORETURN_NOTHROW_LIST, true)
841 DEF_BUILTIN (BUILT_IN__EXIT,
847 ATTR_NORETURN_NOTHROW_LIST, false)
849 DEF_BUILTIN (BUILT_IN__EXIT2,
855 ATTR_NORETURN_NOTHROW_LIST, false)