re PR libfortran/68744 (FAIL: gfortran.dg/backtrace_1.f90 -O0 execution test)
[official-gcc.git] / gcc / sanitizer.def
blob3a71801cad83eb99188f03dd1cb6b4a635458cd8
1 /* This file contains the definitions and documentation for the
2 Address Sanitizer and Thread Sanitizer builtins used in the GNU compiler.
3 Copyright (C) 2012-2016 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 3, 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 COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* Before including this file, you should define a macro:
23 DEF_SANITIZER_BUILTIN (ENUM, NAME, TYPE, ATTRS)
25 See builtins.def for details.
26 The builtins are created by the C-family of FEs in c-family/c-common.c,
27 for other FEs by asan.c. */
29 /* Address Sanitizer */
30 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_INIT, "__asan_init",
31 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
32 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_VERSION_MISMATCH_CHECK,
33 "__asan_version_mismatch_check_v6",
34 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
35 /* Do not reorder the BUILT_IN_ASAN_{REPORT,CHECK}* builtins, e.g. cfgcleanup.c
36 relies on this order. */
37 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD1, "__asan_report_load1",
38 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
39 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD2, "__asan_report_load2",
40 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
41 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD4, "__asan_report_load4",
42 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
43 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD8, "__asan_report_load8",
44 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
45 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD16, "__asan_report_load16",
46 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
47 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD_N, "__asan_report_load_n",
48 BT_FN_VOID_PTR_PTRMODE,
49 ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
50 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE1, "__asan_report_store1",
51 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
52 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE2, "__asan_report_store2",
53 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
54 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE4, "__asan_report_store4",
55 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
56 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE8, "__asan_report_store8",
57 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
58 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE16, "__asan_report_store16",
59 BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
60 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE_N, "__asan_report_store_n",
61 BT_FN_VOID_PTR_PTRMODE,
62 ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
63 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD1_NOABORT,
64 "__asan_report_load1_noabort",
65 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
66 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD2_NOABORT,
67 "__asan_report_load2_noabort",
68 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
69 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD4_NOABORT,
70 "__asan_report_load4_noabort",
71 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
72 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD8_NOABORT,
73 "__asan_report_load8_noabort",
74 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
75 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD16_NOABORT,
76 "__asan_report_load16_noabort",
77 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
78 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD_N_NOABORT,
79 "__asan_report_load_n_noabort",
80 BT_FN_VOID_PTR_PTRMODE,
81 ATTR_TMPURE_NOTHROW_LEAF_LIST)
82 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE1_NOABORT,
83 "__asan_report_store1_noabort",
84 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
85 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE2_NOABORT,
86 "__asan_report_store2_noabort",
87 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
88 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE4_NOABORT,
89 "__asan_report_store4_noabort",
90 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
91 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE8_NOABORT,
92 "__asan_report_store8_noabort",
93 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
94 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE16_NOABORT,
95 "__asan_report_store16_noabort",
96 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
97 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE_N_NOABORT,
98 "__asan_report_store_n_noabort",
99 BT_FN_VOID_PTR_PTRMODE,
100 ATTR_TMPURE_NOTHROW_LEAF_LIST)
101 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD1, "__asan_load1",
102 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
103 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD2, "__asan_load2",
104 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
105 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD4, "__asan_load4",
106 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
107 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD8, "__asan_load8",
108 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
109 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD16, "__asan_load16",
110 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
111 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOADN, "__asan_loadN",
112 BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
113 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE1, "__asan_store1",
114 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
115 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE2, "__asan_store2",
116 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
117 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE4, "__asan_store4",
118 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
119 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE8, "__asan_store8",
120 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
121 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE16, "__asan_store16",
122 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
123 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STOREN, "__asan_storeN",
124 BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
125 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD1_NOABORT, "__asan_load1_noabort",
126 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
127 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD2_NOABORT, "__asan_load2_noabort",
128 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
129 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD4_NOABORT, "__asan_load4_noabort",
130 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
131 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD8_NOABORT, "__asan_load8_noabort",
132 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
133 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD16_NOABORT, "__asan_load16_noabort",
134 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
135 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOADN_NOABORT, "__asan_loadN_noabort",
136 BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
137 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE1_NOABORT, "__asan_store1_noabort",
138 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
139 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE2_NOABORT, "__asan_store2_noabort",
140 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
141 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE4_NOABORT, "__asan_store4_noabort",
142 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
143 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE8_NOABORT, "__asan_store8_noabort",
144 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
145 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE16_NOABORT, "__asan_store16_noabort",
146 BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
147 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STOREN_NOABORT, "__asan_storeN_noabort",
148 BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
149 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REGISTER_GLOBALS,
150 "__asan_register_globals",
151 BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
152 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNREGISTER_GLOBALS,
153 "__asan_unregister_globals",
154 BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
155 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_HANDLE_NO_RETURN,
156 "__asan_handle_no_return",
157 BT_FN_VOID, ATTR_TMPURE_NOTHROW_LEAF_LIST)
158 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT,
159 "__asan_before_dynamic_init",
160 BT_FN_VOID_CONST_PTR, ATTR_NOTHROW_LEAF_LIST)
161 DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_AFTER_DYNAMIC_INIT,
162 "__asan_after_dynamic_init",
163 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
165 /* Thread Sanitizer */
166 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_INIT, "__tsan_init",
167 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
168 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_FUNC_ENTRY, "__tsan_func_entry",
169 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
170 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_FUNC_EXIT, "__tsan_func_exit",
171 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
172 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_VPTR_UPDATE, "__tsan_vptr_update",
173 BT_FN_VOID_PTR_PTR, ATTR_NOTHROW_LEAF_LIST)
174 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ1, "__tsan_read1",
175 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
176 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ2, "__tsan_read2",
177 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
178 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ4, "__tsan_read4",
179 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
180 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ8, "__tsan_read8",
181 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
182 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ16, "__tsan_read16",
183 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
184 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE1, "__tsan_write1",
185 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
186 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE2, "__tsan_write2",
187 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
188 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE4, "__tsan_write4",
189 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
190 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE8, "__tsan_write8",
191 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
192 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE16, "__tsan_write16",
193 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
194 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ_RANGE, "__tsan_read_range",
195 BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
196 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE_RANGE, "__tsan_write_range",
197 BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
199 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_LOAD,
200 "__tsan_atomic8_load",
201 BT_FN_I1_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
202 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_LOAD,
203 "__tsan_atomic16_load",
204 BT_FN_I2_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
205 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_LOAD,
206 "__tsan_atomic32_load",
207 BT_FN_I4_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
208 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_LOAD,
209 "__tsan_atomic64_load",
210 BT_FN_I8_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
211 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_LOAD,
212 "__tsan_atomic128_load",
213 BT_FN_I16_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
215 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_STORE,
216 "__tsan_atomic8_store",
217 BT_FN_VOID_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
218 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_STORE,
219 "__tsan_atomic16_store",
220 BT_FN_VOID_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
221 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_STORE,
222 "__tsan_atomic32_store",
223 BT_FN_VOID_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
224 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_STORE,
225 "__tsan_atomic64_store",
226 BT_FN_VOID_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
227 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_STORE,
228 "__tsan_atomic128_store",
229 BT_FN_VOID_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
231 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_EXCHANGE,
232 "__tsan_atomic8_exchange",
233 BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
234 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_EXCHANGE,
235 "__tsan_atomic16_exchange",
236 BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
237 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_EXCHANGE,
238 "__tsan_atomic32_exchange",
239 BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
240 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_EXCHANGE,
241 "__tsan_atomic64_exchange",
242 BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
243 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_EXCHANGE,
244 "__tsan_atomic128_exchange",
245 BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
247 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_ADD,
248 "__tsan_atomic8_fetch_add",
249 BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
250 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_ADD,
251 "__tsan_atomic16_fetch_add",
252 BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
253 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_ADD,
254 "__tsan_atomic32_fetch_add",
255 BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
256 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_ADD,
257 "__tsan_atomic64_fetch_add",
258 BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
259 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_ADD,
260 "__tsan_atomic128_fetch_add",
261 BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
263 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_SUB,
264 "__tsan_atomic8_fetch_sub",
265 BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
266 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_SUB,
267 "__tsan_atomic16_fetch_sub",
268 BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
269 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_SUB,
270 "__tsan_atomic32_fetch_sub",
271 BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
272 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_SUB,
273 "__tsan_atomic64_fetch_sub",
274 BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
275 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_SUB,
276 "__tsan_atomic128_fetch_sub",
277 BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
279 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_AND,
280 "__tsan_atomic8_fetch_and",
281 BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
282 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_AND,
283 "__tsan_atomic16_fetch_and",
284 BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
285 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_AND,
286 "__tsan_atomic32_fetch_and",
287 BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
288 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_AND,
289 "__tsan_atomic64_fetch_and",
290 BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
291 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_AND,
292 "__tsan_atomic128_fetch_and",
293 BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
295 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_OR,
296 "__tsan_atomic8_fetch_or",
297 BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
298 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_OR,
299 "__tsan_atomic16_fetch_or",
300 BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
301 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_OR,
302 "__tsan_atomic32_fetch_or",
303 BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
304 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_OR,
305 "__tsan_atomic64_fetch_or",
306 BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
307 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_OR,
308 "__tsan_atomic128_fetch_or",
309 BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
311 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_XOR,
312 "__tsan_atomic8_fetch_xor",
313 BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
314 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_XOR,
315 "__tsan_atomic16_fetch_xor",
316 BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
317 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_XOR,
318 "__tsan_atomic32_fetch_xor",
319 BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
320 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_XOR,
321 "__tsan_atomic64_fetch_xor",
322 BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
323 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_XOR,
324 "__tsan_atomic128_fetch_xor",
325 BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
327 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_NAND,
328 "__tsan_atomic8_fetch_nand",
329 BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
330 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_NAND,
331 "__tsan_atomic16_fetch_nand",
332 BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
333 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_NAND,
334 "__tsan_atomic32_fetch_nand",
335 BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
336 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_NAND,
337 "__tsan_atomic64_fetch_nand",
338 BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
339 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_NAND,
340 "__tsan_atomic128_fetch_nand",
341 BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
343 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_COMPARE_EXCHANGE_STRONG,
344 "__tsan_atomic8_compare_exchange_strong",
345 BT_FN_BOOL_VPTR_PTR_I1_INT_INT,
346 ATTR_NOTHROW_LEAF_LIST)
347 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_COMPARE_EXCHANGE_STRONG,
348 "__tsan_atomic16_compare_exchange_strong",
349 BT_FN_BOOL_VPTR_PTR_I2_INT_INT,
350 ATTR_NOTHROW_LEAF_LIST)
351 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_COMPARE_EXCHANGE_STRONG,
352 "__tsan_atomic32_compare_exchange_strong",
353 BT_FN_BOOL_VPTR_PTR_I4_INT_INT,
354 ATTR_NOTHROW_LEAF_LIST)
355 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_COMPARE_EXCHANGE_STRONG,
356 "__tsan_atomic64_compare_exchange_strong",
357 BT_FN_BOOL_VPTR_PTR_I8_INT_INT,
358 ATTR_NOTHROW_LEAF_LIST)
359 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_COMPARE_EXCHANGE_STRONG,
360 "__tsan_atomic128_compare_exchange_strong",
361 BT_FN_BOOL_VPTR_PTR_I16_INT_INT,
362 ATTR_NOTHROW_LEAF_LIST)
364 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_COMPARE_EXCHANGE_WEAK,
365 "__tsan_atomic8_compare_exchange_weak",
366 BT_FN_BOOL_VPTR_PTR_I1_INT_INT,
367 ATTR_NOTHROW_LEAF_LIST)
368 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_COMPARE_EXCHANGE_WEAK,
369 "__tsan_atomic16_compare_exchange_weak",
370 BT_FN_BOOL_VPTR_PTR_I2_INT_INT,
371 ATTR_NOTHROW_LEAF_LIST)
372 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_COMPARE_EXCHANGE_WEAK,
373 "__tsan_atomic32_compare_exchange_weak",
374 BT_FN_BOOL_VPTR_PTR_I4_INT_INT,
375 ATTR_NOTHROW_LEAF_LIST)
376 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_COMPARE_EXCHANGE_WEAK,
377 "__tsan_atomic64_compare_exchange_weak",
378 BT_FN_BOOL_VPTR_PTR_I8_INT_INT,
379 ATTR_NOTHROW_LEAF_LIST)
380 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_COMPARE_EXCHANGE_WEAK,
381 "__tsan_atomic128_compare_exchange_weak",
382 BT_FN_BOOL_VPTR_PTR_I16_INT_INT,
383 ATTR_NOTHROW_LEAF_LIST)
385 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC_THREAD_FENCE,
386 "__tsan_atomic_thread_fence",
387 BT_FN_VOID_INT, ATTR_NOTHROW_LEAF_LIST)
388 DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC_SIGNAL_FENCE,
389 "__tsan_atomic_signal_fence",
390 BT_FN_VOID_INT, ATTR_NOTHROW_LEAF_LIST)
392 /* Undefined Behavior Sanitizer */
393 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DIVREM_OVERFLOW,
394 "__ubsan_handle_divrem_overflow",
395 BT_FN_VOID_PTR_PTR_PTR,
396 ATTR_COLD_NOTHROW_LEAF_LIST)
397 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SHIFT_OUT_OF_BOUNDS,
398 "__ubsan_handle_shift_out_of_bounds",
399 BT_FN_VOID_PTR_PTR_PTR,
400 ATTR_COLD_NOTHROW_LEAF_LIST)
401 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_BUILTIN_UNREACHABLE,
402 "__ubsan_handle_builtin_unreachable",
403 BT_FN_VOID_PTR,
404 ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST)
405 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_MISSING_RETURN,
406 "__ubsan_handle_missing_return",
407 BT_FN_VOID_PTR,
408 ATTR_NORETURN_NOTHROW_LEAF_LIST)
409 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_VLA_BOUND_NOT_POSITIVE,
410 "__ubsan_handle_vla_bound_not_positive",
411 BT_FN_VOID_PTR_PTR,
412 ATTR_COLD_NOTHROW_LEAF_LIST)
413 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
414 "__ubsan_handle_type_mismatch",
415 BT_FN_VOID_PTR_PTR,
416 ATTR_COLD_NOTHROW_LEAF_LIST)
417 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_ADD_OVERFLOW,
418 "__ubsan_handle_add_overflow",
419 BT_FN_VOID_PTR_PTR_PTR,
420 ATTR_COLD_NOTHROW_LEAF_LIST)
421 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SUB_OVERFLOW,
422 "__ubsan_handle_sub_overflow",
423 BT_FN_VOID_PTR_PTR_PTR,
424 ATTR_COLD_NOTHROW_LEAF_LIST)
425 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_MUL_OVERFLOW,
426 "__ubsan_handle_mul_overflow",
427 BT_FN_VOID_PTR_PTR_PTR,
428 ATTR_COLD_NOTHROW_LEAF_LIST)
429 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NEGATE_OVERFLOW,
430 "__ubsan_handle_negate_overflow",
431 BT_FN_VOID_PTR_PTR,
432 ATTR_COLD_NOTHROW_LEAF_LIST)
433 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_LOAD_INVALID_VALUE,
434 "__ubsan_handle_load_invalid_value",
435 BT_FN_VOID_PTR_PTR,
436 ATTR_COLD_NOTHROW_LEAF_LIST)
437 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DIVREM_OVERFLOW_ABORT,
438 "__ubsan_handle_divrem_overflow_abort",
439 BT_FN_VOID_PTR_PTR_PTR,
440 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
441 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SHIFT_OUT_OF_BOUNDS_ABORT,
442 "__ubsan_handle_shift_out_of_bounds_abort",
443 BT_FN_VOID_PTR_PTR_PTR,
444 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
445 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_VLA_BOUND_NOT_POSITIVE_ABORT,
446 "__ubsan_handle_vla_bound_not_positive_abort",
447 BT_FN_VOID_PTR_PTR,
448 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
449 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
450 "__ubsan_handle_type_mismatch_abort",
451 BT_FN_VOID_PTR_PTR,
452 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
453 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_ADD_OVERFLOW_ABORT,
454 "__ubsan_handle_add_overflow_abort",
455 BT_FN_VOID_PTR_PTR_PTR,
456 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
457 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SUB_OVERFLOW_ABORT,
458 "__ubsan_handle_sub_overflow_abort",
459 BT_FN_VOID_PTR_PTR_PTR,
460 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
461 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_MUL_OVERFLOW_ABORT,
462 "__ubsan_handle_mul_overflow_abort",
463 BT_FN_VOID_PTR_PTR_PTR,
464 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
465 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NEGATE_OVERFLOW_ABORT,
466 "__ubsan_handle_negate_overflow_abort",
467 BT_FN_VOID_PTR_PTR,
468 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
469 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_LOAD_INVALID_VALUE_ABORT,
470 "__ubsan_handle_load_invalid_value_abort",
471 BT_FN_VOID_PTR_PTR,
472 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
473 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW,
474 "__ubsan_handle_float_cast_overflow",
475 BT_FN_VOID_PTR_PTR,
476 ATTR_COLD_NOTHROW_LEAF_LIST)
477 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW_ABORT,
478 "__ubsan_handle_float_cast_overflow_abort",
479 BT_FN_VOID_PTR_PTR,
480 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
481 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS,
482 "__ubsan_handle_out_of_bounds",
483 BT_FN_VOID_PTR_PTR,
484 ATTR_COLD_NOTHROW_LEAF_LIST)
485 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS_ABORT,
486 "__ubsan_handle_out_of_bounds_abort",
487 BT_FN_VOID_PTR_PTR,
488 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
489 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_ARG,
490 "__ubsan_handle_nonnull_arg",
491 BT_FN_VOID_PTR,
492 ATTR_COLD_NOTHROW_LEAF_LIST)
493 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_ARG_ABORT,
494 "__ubsan_handle_nonnull_arg_abort",
495 BT_FN_VOID_PTR,
496 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
497 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
498 "__ubsan_handle_nonnull_return",
499 BT_FN_VOID_PTR,
500 ATTR_COLD_NOTHROW_LEAF_LIST)
501 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT,
502 "__ubsan_handle_nonnull_return_abort",
503 BT_FN_VOID_PTR,
504 ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
505 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DYNAMIC_TYPE_CACHE_MISS,
506 "__ubsan_handle_dynamic_type_cache_miss",
507 BT_FN_VOID_PTR_PTR_PTR,
508 ATTR_COLD_NOTHROW_LEAF_LIST)
509 DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DYNAMIC_TYPE_CACHE_MISS_ABORT,
510 "__ubsan_handle_dynamic_type_cache_miss_abort",
511 BT_FN_VOID_PTR_PTR_PTR,
512 ATTR_COLD_NOTHROW_LEAF_LIST)
514 /* Sanitizer coverage */
515 DEF_SANITIZER_BUILTIN(BUILT_IN_SANITIZER_COV_TRACE_PC,
516 "__sanitizer_cov_trace_pc",
517 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)