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