gcc:
[official-gcc.git] / gcc / builtins.def
blob5f814bbf9f5a11597d42aa1b59271da871a016db
1 /* This file contains the definitions and documentation for the
2 builtins used in the GNU compiler.
3 Copyright (C) 2000, 2001, 2002, 2003 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, 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
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 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 simplifying floor((double)float) since the runtime need not implement
63 it. */
65 /* A GCC builtin (like __builtin_saveregs) is provided by the
66 compiler, but does not correspond to a function in the standard
67 library. */
68 #undef DEF_GCC_BUILTIN
69 #define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
70 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
71 false, false, false, ATTRS, true)
74 /* A fallback builtin is a builtin (like __builtin_puts) that falls
75 back to the corresopnding library function if necessary -- but
76 for which we should not introduce the non-`__builtin' variant of
77 the name. */
78 #undef DEF_FALLBACK_BUILTIN
79 #define DEF_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
80 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
81 false, true, false, ATTRS, true)
83 /* Like DEF_FALLBACK_BUILTIN, except that the function is not one that
84 is specified by ANSI/ISO C. So, when we're being fully conformant
85 we ignore the version of these builtins that does not begin with
86 __builtin. */
87 #undef DEF_EXT_FALLBACK_BUILTIN
88 #define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
89 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
90 false, true, true, ATTRS, true)
92 /* A library builtin (like __builtin_strchr) is a builtin equivalent
93 of an ANSI/ISO standard library function. In addition to the
94 `__builtin' version, we will create an ordinary version (e.g,
95 `strchr') as well. If we cannot compute the answer using the
96 builtin function, we will fall back to the standard library
97 version. */
98 #undef DEF_LIB_BUILTIN
99 #define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
100 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
101 true, true, false, ATTRS, true)
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, false)
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, ATTRS) \
116 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
117 true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
119 /* Builtin that is specified by C99 and C90 reserve the name for future use.
120 We can still recognize the builtin in C90 mode but we can't produce it
121 implicitly. */
122 #undef DEF_C99_C90RES_BUILTIN
123 #define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
124 DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
125 true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
127 /* Like DEF_LIB_BUILTIN, except that the function is expanded in the
128 front-end. */
129 #undef DEF_FRONT_END_LIB_BUILTIN
130 #define DEF_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
131 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
132 true, true, false, ATTRS, true)
134 /* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
135 that is specified by ANSI/ISO C. So, when we're being fully
136 conformant we ignore the version of these builtins that does not
137 begin with __builtin. */
138 #undef DEF_EXT_FRONT_END_LIB_BUILTIN
139 #define DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
140 DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
141 true, true, true, ATTRS, true)
143 /* If SMALL_STACK is defined, then `alloca' is only defined in its
144 `__builtin' form. */
145 #if SMALL_STACK
146 DEF_FALLBACK_BUILTIN(BUILT_IN_ALLOCA,
147 "__builtin_alloca",
148 BT_FN_PTR_SIZE,
149 ATTR_MALLOC_NOTHROW_LIST)
150 #else
151 DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA,
152 "__builtin_alloca",
153 BT_FN_PTR_SIZE,
154 ATTR_MALLOC_NOTHROW_LIST)
155 #endif
157 DEF_LIB_BUILTIN(BUILT_IN_ABS,
158 "__builtin_abs",
159 BT_FN_INT_INT,
160 ATTR_CONST_NOTHROW_LIST)
161 DEF_LIB_BUILTIN(BUILT_IN_LABS,
162 "__builtin_labs",
163 BT_FN_LONG_LONG,
164 ATTR_CONST_NOTHROW_LIST)
166 DEF_LIB_BUILTIN(BUILT_IN_FABS,
167 "__builtin_fabs",
168 BT_FN_DOUBLE_DOUBLE,
169 ATTR_CONST_NOTHROW_LIST)
170 DEF_C99_C90RES_BUILTIN(BUILT_IN_FABSF,
171 "__builtin_fabsf",
172 BT_FN_FLOAT_FLOAT,
173 ATTR_CONST_NOTHROW_LIST)
174 DEF_C99_C90RES_BUILTIN(BUILT_IN_FABSL,
175 "__builtin_fabsl",
176 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
177 ATTR_CONST_NOTHROW_LIST)
179 DEF_LIB_BUILTIN(BUILT_IN_FLOOR,
180 "__builtin_floor",
181 BT_FN_DOUBLE_DOUBLE,
182 ATTR_CONST_NOTHROW_LIST)
183 DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORF,
184 "__builtin_floorf",
185 BT_FN_FLOAT_FLOAT,
186 ATTR_CONST_NOTHROW_LIST)
187 DEF_C99_C90RES_BUILTIN(BUILT_IN_FLOORL,
188 "__builtin_floorl",
189 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
190 ATTR_CONST_NOTHROW_LIST)
192 DEF_LIB_BUILTIN(BUILT_IN_CEIL,
193 "__builtin_ceil",
194 BT_FN_DOUBLE_DOUBLE,
195 ATTR_CONST_NOTHROW_LIST)
196 DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILF,
197 "__builtin_ceilf",
198 BT_FN_FLOAT_FLOAT,
199 ATTR_CONST_NOTHROW_LIST)
200 DEF_C99_C90RES_BUILTIN(BUILT_IN_CEILL,
201 "__builtin_ceill",
202 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
203 ATTR_CONST_NOTHROW_LIST)
205 DEF_C99_BUILTIN(BUILT_IN_ROUND,
206 "__builtin_round",
207 BT_FN_DOUBLE_DOUBLE,
208 ATTR_CONST_NOTHROW_LIST)
209 DEF_C99_BUILTIN(BUILT_IN_ROUNDF,
210 "__builtin_roundf",
211 BT_FN_FLOAT_FLOAT,
212 ATTR_CONST_NOTHROW_LIST)
213 DEF_C99_BUILTIN(BUILT_IN_ROUNDL,
214 "__builtin_roundl",
215 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
216 ATTR_CONST_NOTHROW_LIST)
218 DEF_C99_BUILTIN(BUILT_IN_TRUNC,
219 "__builtin_trunc",
220 BT_FN_DOUBLE_DOUBLE,
221 ATTR_CONST_NOTHROW_LIST)
222 DEF_C99_BUILTIN(BUILT_IN_TRUNCF,
223 "__builtin_truncf",
224 BT_FN_FLOAT_FLOAT,
225 ATTR_CONST_NOTHROW_LIST)
226 DEF_C99_BUILTIN(BUILT_IN_TRUNCL,
227 "__builtin_truncl",
228 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
229 ATTR_CONST_NOTHROW_LIST)
231 DEF_C99_BUILTIN(BUILT_IN_NEARBYINT,
232 "__builtin_nearbyint",
233 BT_FN_DOUBLE_DOUBLE,
234 ATTR_CONST_NOTHROW_LIST)
235 DEF_C99_BUILTIN(BUILT_IN_NEARBYINTF,
236 "__builtin_nearbyintf",
237 BT_FN_FLOAT_FLOAT,
238 ATTR_CONST_NOTHROW_LIST)
239 DEF_C99_BUILTIN(BUILT_IN_NEARBYINTL,
240 "__builtin_nearbyintl",
241 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
242 ATTR_CONST_NOTHROW_LIST)
244 DEF_C99_BUILTIN(BUILT_IN_LLABS,
245 "__builtin_llabs",
246 BT_FN_LONGLONG_LONGLONG,
247 ATTR_CONST_NOTHROW_LIST)
248 DEF_C99_BUILTIN(BUILT_IN_IMAXABS,
249 "__builtin_imaxabs",
250 BT_FN_INTMAX_INTMAX,
251 ATTR_CONST_NOTHROW_LIST)
252 DEF_C99_BUILTIN(BUILT_IN_CONJ,
253 "__builtin_conj",
254 BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
255 ATTR_CONST_NOTHROW_LIST)
256 DEF_C99_BUILTIN(BUILT_IN_CONJF,
257 "__builtin_conjf",
258 BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT,
259 ATTR_CONST_NOTHROW_LIST)
260 DEF_C99_BUILTIN(BUILT_IN_CONJL,
261 "__builtin_conjl",
262 BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
263 ATTR_CONST_NOTHROW_LIST)
264 DEF_C99_BUILTIN(BUILT_IN_CREAL,
265 "__builtin_creal",
266 BT_FN_DOUBLE_COMPLEX_DOUBLE,
267 ATTR_CONST_NOTHROW_LIST)
268 DEF_C99_BUILTIN(BUILT_IN_CREALF,
269 "__builtin_crealf",
270 BT_FN_FLOAT_COMPLEX_FLOAT,
271 ATTR_CONST_NOTHROW_LIST)
272 DEF_C99_BUILTIN(BUILT_IN_CREALL,
273 "__builtin_creall",
274 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
275 ATTR_CONST_NOTHROW_LIST)
276 DEF_C99_BUILTIN(BUILT_IN_CIMAG,
277 "__builtin_cimag",
278 BT_FN_DOUBLE_COMPLEX_DOUBLE,
279 ATTR_CONST_NOTHROW_LIST)
280 DEF_C99_BUILTIN(BUILT_IN_CIMAGF,
281 "__builtin_cimagf",
282 BT_FN_FLOAT_COMPLEX_FLOAT,
283 ATTR_CONST_NOTHROW_LIST)
284 DEF_C99_BUILTIN(BUILT_IN_CIMAGL,
285 "__builtin_cimagl",
286 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
287 ATTR_CONST_NOTHROW_LIST)
288 DEF_C99_BUILTIN(BUILT_IN_CABS,
289 "__builtin_cabs",
290 BT_FN_DOUBLE_COMPLEX_DOUBLE,
291 ATTR_CONST_NOTHROW_LIST)
292 DEF_C99_BUILTIN(BUILT_IN_CABSF,
293 "__builtin_cabsf",
294 BT_FN_FLOAT_COMPLEX_FLOAT,
295 ATTR_CONST_NOTHROW_LIST)
296 DEF_C99_BUILTIN(BUILT_IN_CABSL,
297 "__builtin_cabsl",
298 BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
299 ATTR_CONST_NOTHROW_LIST)
301 /* The system prototypes for `bzero', 'bcopy' and `bcmp' functions
302 have many variations, so don't specify parameters to avoid
303 conflicts. The expand_* functions check the argument types anyway.
304 In addition, these functions have traditionally accepted NULL
305 pointers when the length parameter is zero, so don't apply
306 attribute "nonnull". */
307 DEF_BUILTIN (BUILT_IN_BZERO,
308 "__builtin_bzero",
309 BUILT_IN_NORMAL,
310 BT_FN_VOID_PTR_SIZE,
311 BT_FN_VOID_VAR,
312 true, true, true,
313 ATTR_NOTHROW_LIST, false)
314 DEF_BUILTIN (BUILT_IN_BCOPY,
315 "__builtin_bcopy",
316 BUILT_IN_NORMAL,
317 BT_FN_VOID_CONST_PTR_PTR_SIZE,
318 BT_FN_VOID_VAR,
319 true, true, true,
320 ATTR_NOTHROW_LIST, false)
321 DEF_BUILTIN (BUILT_IN_BCMP,
322 "__builtin_bcmp",
323 BUILT_IN_NORMAL,
324 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
325 BT_FN_INT_VAR,
326 true, true, true,
327 ATTR_PURE_NOTHROW_LIST, false)
329 DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
330 "__builtin_ffs",
331 BT_FN_INT_INT,
332 ATTR_CONST_NOTHROW_LIST)
333 DEF_GCC_BUILTIN(BUILT_IN_CLZ,
334 "__builtin_clz",
335 BT_FN_INT_INT,
336 ATTR_CONST_NOTHROW_LIST)
337 DEF_GCC_BUILTIN(BUILT_IN_CTZ,
338 "__builtin_ctz",
339 BT_FN_INT_INT,
340 ATTR_CONST_NOTHROW_LIST)
341 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNT,
342 "__builtin_popcount",
343 BT_FN_INT_INT,
344 ATTR_CONST_NOTHROW_LIST)
345 DEF_GCC_BUILTIN(BUILT_IN_PARITY,
346 "__builtin_parity",
347 BT_FN_INT_INT,
348 ATTR_CONST_NOTHROW_LIST)
350 DEF_GCC_BUILTIN(BUILT_IN_FFSL,
351 "__builtin_ffsl",
352 BT_FN_INT_LONG,
353 ATTR_CONST_NOTHROW_LIST)
354 DEF_GCC_BUILTIN(BUILT_IN_CLZL,
355 "__builtin_clzl",
356 BT_FN_INT_LONG,
357 ATTR_CONST_NOTHROW_LIST)
358 DEF_GCC_BUILTIN(BUILT_IN_CTZL,
359 "__builtin_ctzl",
360 BT_FN_INT_LONG,
361 ATTR_CONST_NOTHROW_LIST)
362 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTL,
363 "__builtin_popcountl",
364 BT_FN_INT_LONG,
365 ATTR_CONST_NOTHROW_LIST)
366 DEF_GCC_BUILTIN(BUILT_IN_PARITYL,
367 "__builtin_parityl",
368 BT_FN_INT_LONG,
369 ATTR_CONST_NOTHROW_LIST)
371 DEF_EXT_LIB_BUILTIN(BUILT_IN_FFSLL,
372 "__builtin_ffsll",
373 BT_FN_INT_LONGLONG,
374 ATTR_CONST_NOTHROW_LIST)
375 DEF_GCC_BUILTIN(BUILT_IN_CLZLL,
376 "__builtin_clzll",
377 BT_FN_INT_LONGLONG,
378 ATTR_CONST_NOTHROW_LIST)
379 DEF_GCC_BUILTIN(BUILT_IN_CTZLL,
380 "__builtin_ctzll",
381 BT_FN_INT_LONGLONG,
382 ATTR_CONST_NOTHROW_LIST)
383 DEF_GCC_BUILTIN(BUILT_IN_POPCOUNTLL,
384 "__builtin_popcountll",
385 BT_FN_INT_LONGLONG,
386 ATTR_CONST_NOTHROW_LIST)
387 DEF_GCC_BUILTIN(BUILT_IN_PARITYLL,
388 "__builtin_parityll",
389 BT_FN_INT_LONGLONG,
390 ATTR_CONST_NOTHROW_LIST)
392 DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX,
393 "__builtin_index",
394 BT_FN_STRING_CONST_STRING_INT,
395 ATTR_PURE_NOTHROW_NONNULL_1)
396 DEF_EXT_LIB_BUILTIN(BUILT_IN_RINDEX,
397 "__builtin_rindex",
398 BT_FN_STRING_CONST_STRING_INT,
399 ATTR_PURE_NOTHROW_NONNULL_1)
401 DEF_LIB_BUILTIN(BUILT_IN_MEMCPY,
402 "__builtin_memcpy",
403 BT_FN_PTR_PTR_CONST_PTR_SIZE,
404 ATTR_NOTHROW_NONNULL_1_2)
405 DEF_LIB_BUILTIN(BUILT_IN_MEMMOVE,
406 "__builtin_memmove",
407 BT_FN_PTR_PTR_CONST_PTR_SIZE,
408 ATTR_NOTHROW_NONNULL_1_2)
409 DEF_LIB_BUILTIN(BUILT_IN_MEMCMP,
410 "__builtin_memcmp",
411 BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
412 ATTR_PURE_NOTHROW_NONNULL_1_2)
413 DEF_LIB_BUILTIN(BUILT_IN_MEMSET,
414 "__builtin_memset",
415 BT_FN_PTR_PTR_INT_SIZE,
416 ATTR_NOTHROW_NONNULL_1)
417 DEF_EXT_LIB_BUILTIN(BUILT_IN_MEMPCPY,
418 "__builtin_mempcpy",
419 BT_FN_PTR_PTR_CONST_PTR_SIZE,
420 ATTR_NOTHROW_NONNULL_1_2)
422 DEF_LIB_BUILTIN(BUILT_IN_STRCAT,
423 "__builtin_strcat",
424 BT_FN_STRING_STRING_CONST_STRING,
425 ATTR_NOTHROW_NONNULL_1_2)
426 DEF_LIB_BUILTIN(BUILT_IN_STRNCAT,
427 "__builtin_strncat",
428 BT_FN_STRING_STRING_CONST_STRING_SIZE,
429 ATTR_NOTHROW_NONNULL_1_2)
430 DEF_EXT_LIB_BUILTIN(BUILT_IN_STPCPY,
431 "__builtin_stpcpy",
432 BT_FN_STRING_STRING_CONST_STRING,
433 ATTR_NOTHROW_NONNULL_1_2)
434 DEF_LIB_BUILTIN(BUILT_IN_STRCPY,
435 "__builtin_strcpy",
436 BT_FN_STRING_STRING_CONST_STRING,
437 ATTR_NOTHROW_NONNULL_1_2)
438 DEF_LIB_BUILTIN(BUILT_IN_STRNCPY,
439 "__builtin_strncpy",
440 BT_FN_STRING_STRING_CONST_STRING_SIZE,
441 ATTR_NOTHROW_NONNULL_1_2)
442 DEF_LIB_BUILTIN(BUILT_IN_STRCMP,
443 "__builtin_strcmp",
444 BT_FN_INT_CONST_STRING_CONST_STRING,
445 ATTR_PURE_NOTHROW_NONNULL_1_2)
446 DEF_LIB_BUILTIN(BUILT_IN_STRNCMP,
447 "__builtin_strncmp",
448 BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
449 ATTR_PURE_NOTHROW_NONNULL_1_2)
450 DEF_LIB_BUILTIN(BUILT_IN_STRLEN,
451 "__builtin_strlen",
452 BT_FN_SIZE_CONST_STRING,
453 ATTR_PURE_NOTHROW_NONNULL_1)
454 DEF_LIB_BUILTIN(BUILT_IN_STRSTR,
455 "__builtin_strstr",
456 BT_FN_STRING_CONST_STRING_CONST_STRING,
457 ATTR_PURE_NOTHROW_NONNULL_1_2)
458 DEF_LIB_BUILTIN(BUILT_IN_STRPBRK,
459 "__builtin_strpbrk",
460 BT_FN_STRING_CONST_STRING_CONST_STRING,
461 ATTR_PURE_NOTHROW_NONNULL_1_2)
462 DEF_LIB_BUILTIN(BUILT_IN_STRSPN,
463 "__builtin_strspn",
464 BT_FN_SIZE_CONST_STRING_CONST_STRING,
465 ATTR_PURE_NOTHROW_NONNULL_1_2)
466 DEF_LIB_BUILTIN(BUILT_IN_STRCSPN,
467 "__builtin_strcspn",
468 BT_FN_SIZE_CONST_STRING_CONST_STRING,
469 ATTR_PURE_NOTHROW_NONNULL_1_2)
470 DEF_LIB_BUILTIN(BUILT_IN_STRCHR,
471 "__builtin_strchr",
472 BT_FN_STRING_CONST_STRING_INT,
473 ATTR_PURE_NOTHROW_NONNULL_1)
474 DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
475 "__builtin_strrchr",
476 BT_FN_STRING_CONST_STRING_INT,
477 ATTR_PURE_NOTHROW_NONNULL_1)
479 DEF_LIB_BUILTIN(BUILT_IN_SQRT,
480 "__builtin_sqrt",
481 BT_FN_DOUBLE_DOUBLE,
482 flag_errno_math ? ATTR_NOTHROW_LIST
483 : (flag_unsafe_math_optimizations
484 ? ATTR_CONST_NOTHROW_LIST
485 : ATTR_PURE_NOTHROW_LIST))
486 DEF_LIB_BUILTIN(BUILT_IN_SIN,
487 "__builtin_sin",
488 BT_FN_DOUBLE_DOUBLE,
489 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
490 : ATTR_PURE_NOTHROW_LIST)
491 DEF_LIB_BUILTIN(BUILT_IN_COS,
492 "__builtin_cos",
493 BT_FN_DOUBLE_DOUBLE,
494 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
495 : ATTR_PURE_NOTHROW_LIST)
496 DEF_LIB_BUILTIN(BUILT_IN_EXP,
497 "__builtin_exp",
498 BT_FN_DOUBLE_DOUBLE,
499 flag_errno_math ? ATTR_NOTHROW_LIST
500 : (flag_unsafe_math_optimizations
501 ? ATTR_CONST_NOTHROW_LIST
502 : ATTR_PURE_NOTHROW_LIST))
503 DEF_LIB_BUILTIN(BUILT_IN_LOG,
504 "__builtin_log",
505 BT_FN_DOUBLE_DOUBLE,
506 flag_errno_math ? ATTR_NOTHROW_LIST
507 : (flag_unsafe_math_optimizations
508 ? ATTR_CONST_NOTHROW_LIST
509 : ATTR_PURE_NOTHROW_LIST))
510 DEF_LIB_BUILTIN(BUILT_IN_TAN,
511 "__builtin_tan",
512 BT_FN_DOUBLE_DOUBLE,
513 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
514 : ATTR_PURE_NOTHROW_LIST)
515 DEF_LIB_BUILTIN(BUILT_IN_ATAN,
516 "__builtin_atan",
517 BT_FN_DOUBLE_DOUBLE,
518 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
519 : ATTR_PURE_NOTHROW_LIST)
520 DEF_LIB_BUILTIN(BUILT_IN_POW,
521 "__builtin_pow",
522 BT_FN_DOUBLE_DOUBLE_DOUBLE,
523 flag_errno_math ? ATTR_NOTHROW_LIST
524 : (flag_unsafe_math_optimizations
525 ? ATTR_CONST_NOTHROW_LIST
526 : ATTR_PURE_NOTHROW_LIST))
527 DEF_LIB_BUILTIN(BUILT_IN_ATAN2,
528 "__builtin_atan2",
529 BT_FN_DOUBLE_DOUBLE_DOUBLE,
530 flag_errno_math ? ATTR_NOTHROW_LIST
531 : (flag_unsafe_math_optimizations
532 ? ATTR_CONST_NOTHROW_LIST
533 : ATTR_PURE_NOTHROW_LIST))
534 DEF_LIB_BUILTIN(BUILT_IN_FMOD,
535 "__builtin_fmod",
536 BT_FN_DOUBLE_DOUBLE_DOUBLE,
537 flag_errno_math ? ATTR_NOTHROW_LIST
538 : (flag_unsafe_math_optimizations
539 ? ATTR_CONST_NOTHROW_LIST
540 : ATTR_PURE_NOTHROW_LIST))
541 DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTF,
542 "__builtin_sqrtf",
543 BT_FN_FLOAT_FLOAT,
544 flag_errno_math ? ATTR_NOTHROW_LIST
545 : (flag_unsafe_math_optimizations
546 ? ATTR_CONST_NOTHROW_LIST
547 : ATTR_PURE_NOTHROW_LIST))
548 DEF_C99_C90RES_BUILTIN(BUILT_IN_SINF,
549 "__builtin_sinf",
550 BT_FN_FLOAT_FLOAT,
551 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
552 : ATTR_PURE_NOTHROW_LIST)
553 DEF_C99_C90RES_BUILTIN(BUILT_IN_COSF,
554 "__builtin_cosf",
555 BT_FN_FLOAT_FLOAT,
556 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
557 : ATTR_PURE_NOTHROW_LIST)
558 DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPF,
559 "__builtin_expf",
560 BT_FN_FLOAT_FLOAT,
561 flag_errno_math ? ATTR_NOTHROW_LIST
562 : (flag_unsafe_math_optimizations
563 ? ATTR_CONST_NOTHROW_LIST
564 : ATTR_PURE_NOTHROW_LIST))
565 DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGF,
566 "__builtin_logf",
567 BT_FN_FLOAT_FLOAT,
568 flag_errno_math ? ATTR_NOTHROW_LIST
569 : (flag_unsafe_math_optimizations
570 ? ATTR_CONST_NOTHROW_LIST
571 : ATTR_PURE_NOTHROW_LIST))
572 DEF_C99_C90RES_BUILTIN(BUILT_IN_TANF,
573 "__builtin_tanf",
574 BT_FN_FLOAT_FLOAT,
575 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
576 : ATTR_PURE_NOTHROW_LIST)
577 DEF_C99_C90RES_BUILTIN(BUILT_IN_ATANF,
578 "__builtin_atanf",
579 BT_FN_FLOAT_FLOAT,
580 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
581 : ATTR_PURE_NOTHROW_LIST)
582 DEF_C99_C90RES_BUILTIN(BUILT_IN_POWF,
583 "__builtin_powf",
584 BT_FN_FLOAT_FLOAT_FLOAT,
585 flag_errno_math ? ATTR_NOTHROW_LIST
586 : (flag_unsafe_math_optimizations
587 ? ATTR_CONST_NOTHROW_LIST
588 : ATTR_PURE_NOTHROW_LIST))
589 DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2F,
590 "__builtin_atan2f",
591 BT_FN_FLOAT_FLOAT_FLOAT,
592 flag_errno_math ? ATTR_NOTHROW_LIST
593 : (flag_unsafe_math_optimizations
594 ? ATTR_CONST_NOTHROW_LIST
595 : ATTR_PURE_NOTHROW_LIST))
596 DEF_C99_C90RES_BUILTIN(BUILT_IN_FMODF,
597 "__builtin_fmodf",
598 BT_FN_FLOAT_FLOAT_FLOAT,
599 flag_errno_math ? ATTR_NOTHROW_LIST
600 : (flag_unsafe_math_optimizations
601 ? ATTR_CONST_NOTHROW_LIST
602 : ATTR_PURE_NOTHROW_LIST))
603 DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTL,
604 "__builtin_sqrtl",
605 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
606 flag_errno_math ? ATTR_NOTHROW_LIST
607 : (flag_unsafe_math_optimizations
608 ? ATTR_CONST_NOTHROW_LIST
609 : ATTR_PURE_NOTHROW_LIST))
610 DEF_C99_C90RES_BUILTIN(BUILT_IN_SINL,
611 "__builtin_sinl",
612 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
613 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
614 : ATTR_PURE_NOTHROW_LIST)
615 DEF_C99_C90RES_BUILTIN(BUILT_IN_COSL,
616 "__builtin_cosl",
617 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
618 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
619 : ATTR_PURE_NOTHROW_LIST)
620 DEF_C99_C90RES_BUILTIN(BUILT_IN_EXPL,
621 "__builtin_expl",
622 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
623 flag_errno_math ? ATTR_NOTHROW_LIST
624 : (flag_unsafe_math_optimizations
625 ? ATTR_CONST_NOTHROW_LIST
626 : ATTR_PURE_NOTHROW_LIST))
627 DEF_C99_C90RES_BUILTIN(BUILT_IN_LOGL,
628 "__builtin_logl",
629 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
630 flag_errno_math ? ATTR_NOTHROW_LIST
631 : (flag_unsafe_math_optimizations
632 ? ATTR_CONST_NOTHROW_LIST
633 : ATTR_PURE_NOTHROW_LIST))
634 DEF_C99_C90RES_BUILTIN(BUILT_IN_TANL,
635 "__builtin_tanl",
636 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
637 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
638 : ATTR_PURE_NOTHROW_LIST)
639 DEF_C99_C90RES_BUILTIN(BUILT_IN_ATANL,
640 "__builtin_atanl",
641 BT_FN_LONG_DOUBLE_LONG_DOUBLE,
642 flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
643 : ATTR_PURE_NOTHROW_LIST)
644 DEF_C99_C90RES_BUILTIN(BUILT_IN_POWL,
645 "__builtin_powl",
646 BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
647 flag_errno_math ? ATTR_NOTHROW_LIST
648 : (flag_unsafe_math_optimizations
649 ? ATTR_CONST_NOTHROW_LIST
650 : ATTR_PURE_NOTHROW_LIST))
651 DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2L,
652 "__builtin_atan2l",
653 BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
654 flag_errno_math ? ATTR_NOTHROW_LIST
655 : (flag_unsafe_math_optimizations
656 ? ATTR_CONST_NOTHROW_LIST
657 : ATTR_PURE_NOTHROW_LIST))
658 DEF_C99_C90RES_BUILTIN(BUILT_IN_FMODL,
659 "__builtin_fmodl",
660 BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
661 flag_errno_math ? ATTR_NOTHROW_LIST
662 : (flag_unsafe_math_optimizations
663 ? ATTR_CONST_NOTHROW_LIST
664 : ATTR_PURE_NOTHROW_LIST))
666 DEF_GCC_BUILTIN(BUILT_IN_INF,
667 "__builtin_inf",
668 BT_FN_DOUBLE,
669 ATTR_CONST_NOTHROW_LIST)
670 DEF_GCC_BUILTIN(BUILT_IN_INFF,
671 "__builtin_inff",
672 BT_FN_FLOAT,
673 ATTR_CONST_NOTHROW_LIST)
674 DEF_GCC_BUILTIN(BUILT_IN_INFL,
675 "__builtin_infl",
676 BT_FN_LONG_DOUBLE,
677 ATTR_CONST_NOTHROW_LIST)
679 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VAL,
680 "__builtin_huge_val",
681 BT_FN_DOUBLE,
682 ATTR_CONST_NOTHROW_LIST)
683 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALF,
684 "__builtin_huge_valf",
685 BT_FN_FLOAT,
686 ATTR_CONST_NOTHROW_LIST)
687 DEF_GCC_BUILTIN(BUILT_IN_HUGE_VALL,
688 "__builtin_huge_vall",
689 BT_FN_LONG_DOUBLE,
690 ATTR_CONST_NOTHROW_LIST)
692 DEF_LIB_BUILTIN(BUILT_IN_NAN,
693 "__builtin_nan",
694 BT_FN_DOUBLE_CONST_STRING,
695 ATTR_CONST_NOTHROW_NONNULL_1)
696 DEF_LIB_BUILTIN(BUILT_IN_NANF,
697 "__builtin_nanf",
698 BT_FN_FLOAT_CONST_STRING,
699 ATTR_CONST_NOTHROW_NONNULL_1)
700 DEF_LIB_BUILTIN(BUILT_IN_NANL,
701 "__builtin_nanl",
702 BT_FN_LONG_DOUBLE_CONST_STRING,
703 ATTR_CONST_NOTHROW_NONNULL_1)
705 DEF_LIB_BUILTIN(BUILT_IN_NANS,
706 "__builtin_nans",
707 BT_FN_DOUBLE_CONST_STRING,
708 ATTR_CONST_NOTHROW_NONNULL_1)
709 DEF_LIB_BUILTIN(BUILT_IN_NANSF,
710 "__builtin_nansf",
711 BT_FN_FLOAT_CONST_STRING,
712 ATTR_CONST_NOTHROW_NONNULL_1)
713 DEF_LIB_BUILTIN(BUILT_IN_NANSL,
714 "__builtin_nansl",
715 BT_FN_LONG_DOUBLE_CONST_STRING,
716 ATTR_CONST_NOTHROW_NONNULL_1)
718 DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
719 "__builtin_saveregs",
720 BT_FN_PTR_VAR,
721 ATTR_NULL)
722 DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
723 "__builtin_classify_type",
724 BT_FN_INT_VAR,
725 ATTR_NULL)
726 DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
727 "__builtin_next_arg",
728 BT_FN_PTR_VAR,
729 ATTR_NULL)
730 DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
731 "__builtin_args_info",
732 BT_FN_INT_INT,
733 ATTR_NULL)
734 DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
735 "__builtin_constant_p",
736 BT_FN_INT_VAR,
737 ATTR_CONST_NOTHROW_LIST)
738 DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
739 "__builtin_frame_address",
740 BT_FN_PTR_UNSIGNED,
741 ATTR_NULL)
742 DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
743 "__builtin_return_address",
744 BT_FN_PTR_UNSIGNED,
745 ATTR_NULL)
746 DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
747 "__builtin_aggregate_incoming_address",
748 BT_FN_PTR_VAR,
749 ATTR_NULL)
750 DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
751 "__builtin_apply_args",
752 BT_FN_PTR_VAR,
753 ATTR_NULL)
754 DEF_GCC_BUILTIN(BUILT_IN_APPLY,
755 "__builtin_apply",
756 BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
757 ATTR_NULL)
758 DEF_GCC_BUILTIN(BUILT_IN_RETURN,
759 "__builtin_return",
760 BT_FN_VOID_PTR,
761 ATTR_NORETURN_NOTHROW_LIST)
762 DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
763 "__builtin_setjmp",
764 BT_FN_INT_PTR,
765 ATTR_NULL)
766 DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
767 "__builtin_longjmp",
768 BT_FN_VOID_PTR_INT,
769 ATTR_NORETURN_NOTHROW_LIST)
770 DEF_GCC_BUILTIN(BUILT_IN_TRAP,
771 "__builtin_trap",
772 BT_FN_VOID,
773 ATTR_NORETURN_NOTHROW_LIST)
774 DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
775 "__builtin_prefetch",
776 BT_FN_VOID_CONST_PTR_VAR,
777 ATTR_NULL)
779 /* stdio.h builtins (without FILE *). */
781 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF,
782 "__builtin_printf",
783 BT_FN_INT_CONST_STRING_VAR,
784 ATTR_FORMAT_PRINTF_1_2)
785 DEF_LIB_BUILTIN(BUILT_IN_PUTCHAR,
786 "__builtin_putchar",
787 BT_FN_INT_INT,
788 ATTR_NOTHROW_LIST)
789 DEF_LIB_BUILTIN(BUILT_IN_PUTS,
790 "__builtin_puts",
791 BT_FN_INT_CONST_STRING,
792 ATTR_NOTHROW_NONNULL_1)
793 DEF_C99_BUILTIN(BUILT_IN_SNPRINTF,
794 "__builtin_snprintf",
795 BT_FN_INT_STRING_SIZE_CONST_STRING_VAR,
796 ATTR_FORMAT_PRINTF_3_4)
797 DEF_LIB_BUILTIN(BUILT_IN_SPRINTF,
798 "__builtin_sprintf",
799 BT_FN_INT_STRING_CONST_STRING_VAR,
800 ATTR_FORMAT_PRINTF_2_3)
801 DEF_LIB_BUILTIN(BUILT_IN_SCANF,
802 "__builtin_scanf",
803 BT_FN_INT_CONST_STRING_VAR,
804 ATTR_FORMAT_SCANF_1_2)
805 DEF_LIB_BUILTIN(BUILT_IN_SSCANF,
806 "__builtin_sscanf",
807 BT_FN_INT_CONST_STRING_CONST_STRING_VAR,
808 ATTR_FORMAT_SCANF_2_3)
809 DEF_LIB_BUILTIN(BUILT_IN_VPRINTF,
810 "__builtin_vprintf",
811 BT_FN_INT_CONST_STRING_VALIST_ARG,
812 ATTR_FORMAT_PRINTF_1_0)
813 DEF_C99_BUILTIN(BUILT_IN_VSCANF,
814 "__builtin_vscanf",
815 BT_FN_INT_CONST_STRING_VALIST_ARG,
816 ATTR_FORMAT_SCANF_1_0)
817 DEF_C99_BUILTIN(BUILT_IN_VSSCANF,
818 "__builtin_vsscanf",
819 BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
820 ATTR_FORMAT_SCANF_2_0)
821 DEF_C99_BUILTIN(BUILT_IN_VSNPRINTF,
822 "__builtin_vsnprintf",
823 BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
824 ATTR_FORMAT_PRINTF_3_0)
825 DEF_LIB_BUILTIN(BUILT_IN_VSPRINTF,
826 "__builtin_vsprintf",
827 BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
828 ATTR_FORMAT_PRINTF_2_0)
831 /* stdio.h builtins (with FILE *). */
833 /* Declare the __builtin_ style with arguments and the regular style
834 without them. We rely on stdio.h to supply the arguments for the
835 regular style declaration since we had to use void* instead of
836 FILE* in the __builtin_ prototype supplied here. */
838 DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
839 "__builtin_fputc",
840 BT_FN_INT_INT_PTR,
841 ATTR_NOTHROW_NONNULL_2)
842 DEF_BUILTIN (BUILT_IN_FPUTS,
843 "__builtin_fputs",
844 BUILT_IN_NORMAL,
845 BT_FN_INT_CONST_STRING_PTR,
846 BT_FN_INT_VAR,
847 true, true, false, ATTR_NOTHROW_NONNULL_1_2, true)
848 DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
849 "__builtin_fwrite",
850 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
851 ATTR_NOTHROW_NONNULL_1_4)
852 DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
853 "__builtin_fprintf",
854 BT_FN_INT_PTR_CONST_STRING_VAR,
855 ATTR_FORMAT_PRINTF_2_3)
857 /* stdio unlocked builtins (without FILE *). */
859 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
860 "__builtin_putchar_unlocked",
861 BT_FN_INT_INT, ATTR_NOTHROW_LIST)
862 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
863 "__builtin_puts_unlocked",
864 BT_FN_INT_CONST_STRING, ATTR_NOTHROW_NONNULL_1)
865 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
866 "__builtin_printf_unlocked",
867 BT_FN_INT_CONST_STRING_VAR,
868 ATTR_FORMAT_PRINTF_1_2)
870 /* stdio unlocked builtins (with FILE *). */
872 /* Declare the __builtin_ style with arguments and the regular style
873 without them. We rely on stdio.h to supply the arguments for the
874 regular style declaration since we had to use void* instead of
875 FILE* in the __builtin_ prototype supplied here. */
877 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
878 "__builtin_fputc_unlocked",
879 BT_FN_INT_INT_PTR, ATTR_NOTHROW_NONNULL_2)
880 DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
881 "__builtin_fputs_unlocked",
882 BUILT_IN_NORMAL,
883 BT_FN_INT_CONST_STRING_PTR,
884 BT_FN_INT_VAR,
885 true, true, true, ATTR_NOTHROW_NONNULL_1_2, true)
886 DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
887 "__builtin_fwrite_unlocked",
888 BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, ATTR_NOTHROW_NONNULL_1_4)
889 DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
890 "__builtin_fprintf_unlocked",
891 BT_FN_INT_PTR_CONST_STRING_VAR,
892 ATTR_FORMAT_PRINTF_2_3)
894 /* ISO C99 floating point unordered comparisons. */
895 DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
896 "__builtin_isgreater",
897 BT_FN_INT_VAR,
898 ATTR_CONST_NOTHROW_LIST)
899 DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
900 "__builtin_isgreaterequal",
901 BT_FN_INT_VAR,
902 ATTR_CONST_NOTHROW_LIST)
903 DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
904 "__builtin_isless",
905 BT_FN_INT_VAR,
906 ATTR_CONST_NOTHROW_LIST)
907 DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
908 "__builtin_islessequal",
909 BT_FN_INT_VAR,
910 ATTR_CONST_NOTHROW_LIST)
911 DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
912 "__builtin_islessgreater",
913 BT_FN_INT_VAR,
914 ATTR_CONST_NOTHROW_LIST)
915 DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
916 "__builtin_isunordered",
917 BT_FN_INT_VAR,
918 ATTR_CONST_NOTHROW_LIST)
920 /* Various hooks for the DWARF 2 __throw routine. */
921 DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
922 "__builtin_unwind_init",
923 BT_FN_VOID,
924 ATTR_NULL)
925 DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
926 "__builtin_dwarf_cfa",
927 BT_FN_PTR,
928 ATTR_NULL)
929 DEF_GCC_BUILTIN(BUILT_IN_DWARF_SP_COLUMN,
930 "__builtin_dwarf_sp_column",
931 BT_FN_UNSIGNED,
932 ATTR_NULL)
933 DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
934 "__builtin_init_dwarf_reg_size_table",
935 BT_FN_VOID_PTR,
936 ATTR_NULL)
937 DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
938 "__builtin_frob_return_addr",
939 BT_FN_PTR_PTR,
940 ATTR_NULL)
941 DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
942 "__builtin_extract_return_addr",
943 BT_FN_PTR_PTR,
944 ATTR_NULL)
945 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
946 "__builtin_eh_return",
947 BT_FN_VOID_PTRMODE_PTR,
948 ATTR_NORETURN_NOTHROW_LIST)
949 DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
950 "__builtin_eh_return_data_regno",
951 BT_FN_INT_INT,
952 ATTR_NULL)
954 /* Variable argument list (stdarg.h) support */
955 DEF_GCC_BUILTIN(BUILT_IN_VA_START,
956 "__builtin_va_start",
957 BT_FN_VOID_VALIST_REF_VAR,
958 ATTR_NULL)
959 DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
960 "__builtin_stdarg_start",
961 BT_FN_VOID_VALIST_REF_VAR,
962 ATTR_NULL)
963 DEF_GCC_BUILTIN(BUILT_IN_VA_END,
964 "__builtin_va_end",
965 BT_FN_VOID_VALIST_REF,
966 ATTR_NULL)
967 DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
968 "__builtin_va_copy",
969 BT_FN_VOID_VALIST_REF_VALIST_ARG,
970 ATTR_NULL)
972 DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
973 "__builtin_expect",
974 BT_FN_LONG_LONG_LONG,
975 ATTR_NULL)
977 /* Declare abort, exit, _exit and _Exit */
978 DEF_LIB_BUILTIN(BUILT_IN_ABORT,
979 "__builtin_abort",
980 BT_FN_VOID,
981 ATTR_NORETURN_NOTHROW_LIST)
982 DEF_LIB_BUILTIN(BUILT_IN_EXIT,
983 "__builtin_exit",
984 BT_FN_VOID_INT,
985 ATTR_NORETURN_NOTHROW_LIST)
986 DEF_EXT_LIB_BUILTIN(BUILT_IN__EXIT,
987 "__builtin__exit",
988 BT_FN_VOID_INT,
989 ATTR_NORETURN_NOTHROW_LIST)
990 DEF_C99_BUILTIN(BUILT_IN__EXIT2,
991 "__builtin__Exit",
992 BT_FN_VOID_INT,
993 ATTR_NORETURN_NOTHROW_LIST)
995 /* Declare malloc, calloc and strdup. */
996 DEF_LIB_BUILTIN(BUILT_IN_MALLOC,
997 "__builtin_malloc",
998 BT_FN_PTR_SIZE,
999 ATTR_MALLOC_NOTHROW_LIST)
1001 DEF_LIB_BUILTIN(BUILT_IN_CALLOC,
1002 "__builtin_calloc",
1003 BT_FN_PTR_SIZE_SIZE,
1004 ATTR_MALLOC_NOTHROW_LIST)
1006 DEF_EXT_LIB_BUILTIN(BUILT_IN_STRDUP,
1007 "__builtin_strdup",
1008 BT_FN_STRING_CONST_STRING,
1009 ATTR_MALLOC_NOTHROW_NONNULL_1)