Revert "Add support to debug libtcc code" - not fully developed experimental feature This reverts commit 1fe3e3bff560b3e6148933687e4a892b695f3a88. This reverts commit 4768b11737bcae47ec8b3a747e05aade5b302495. Revert "tests: add test for x86_64 xor REX prefix bug in load()" - AI generated nonsense test This reverts commit d5ecb52a71e20f0db6dcc99e30510080a87d9af3. Revert "tccpp.c: Improve integer constant overflow warning" - Too long and confusing messages and comments for feature with questionable benefit. This reverts commit 085bdf8997213df03f49258e1184cb7c32ae65bb. riscv64-link: - cleanup "pair pcrel lo relocations by hi address" From fada98b1ce9ee0c36771183177218828ccb9b9de tccgen.c: - Simplify "Cast signed pointer offset to ptrdiff_t before performing arithmetic" From 5ad52cc1ed0f1fbc9781cfac8f59d202ff58738c libtcc.c: - Revert "tcc options: document behavior and clashes (no-op)" a bit more information than one would like to have I think. (why try to understand that comments plus the extra script if one can as well just read the code itself ;) From 234e2dd2bf920e1fdb2deaa4ab549ba85e11e9d7 tccdefs.h: - Revert "Move lib/va_list.c into include/tccdefs.h" Lets not fill tccdefs.h with too much inline code Also, -nostdlib -run is no longer supported From fa6a6bfbbdbe634ec0052b1ee87f2cf3d2b143a4 arm64-gen.c: - cleanup "Implement TOK_NEG for floats natively" Also, make it "no lvalue" in tccgen.c/x86-64-gen.c From c39eaf10cfbe302342902cc7e808469ae7f7ae7c lib/lib-arm64.c: - cleanup "Remove libc dependency from lib-arm64" using unions is much faster than some made up memcpy() From 8c61b91de80ec03e623b71205a11f152fffb5125
Showing the changes to include (1 of 20 files). Show all
Unified · Split
| @@ -191,10 +191,7 @@ · 190 unmodified lines | ||
| 191 | 191 | #if defined __x86_64__ |
| 192 | 192 | #if !defined _WIN32 |
| 193 | 193 | /* GCC compatible definition of va_list. */ |
| 194 | − | |
| 195 | − enum __va_arg_type { | |
| 196 | − __va_gen_reg, __va_float_reg, __va_stack | |
| 197 | − }; | |
| 194 | + /* This should be in sync with the declaration in our lib/va_list.c */ | |
| 198 | 195 | typedef struct { |
| 199 | 196 | unsigned gp_offset, fp_offset; |
| 200 | 197 | union { |
| @@ -204,43 +201,7 @@ · 3 unmodified lines | ||
| 204 | 201 | char *reg_save_area; |
| 205 | 202 | } __builtin_va_list[1]; |
| 206 | 203 | |
| 207 | − static inline void *__va_arg(__builtin_va_list ap, int arg_type, | |
| 208 | − int size, int align) | |
| 209 | − { | |
| 210 | − size = (size + 7) & ~7; | |
| 211 | − align = (align + 7) & ~7; | |
| 212 | − switch ((enum __va_arg_type)arg_type) { | |
| 213 | − case __va_gen_reg: | |
| 214 | − if (ap->gp_offset + size <= 48) { | |
| 215 | − ap->gp_offset += size; | |
| 216 | − return ap->reg_save_area + ap->gp_offset - size; | |
| 217 | − } | |
| 218 | − goto use_overflow_area; | |
| 219 | − case __va_float_reg: | |
| 220 | − if (ap->fp_offset < 128 + 48) { | |
| 221 | − ap->fp_offset += 16; | |
| 222 | − if (size == 8) | |
| 223 | − return ap->reg_save_area + ap->fp_offset - 16; | |
| 224 | − if (ap->fp_offset < 128 + 48) { | |
| 225 | − double *p = (double *)(ap->reg_save_area + ap->fp_offset); | |
| 226 | − p[-1] = p[0]; | |
| 227 | − ap->fp_offset += 16; | |
| 228 | − return ap->reg_save_area + ap->fp_offset - 32; | |
| 229 | − } | |
| 230 | − } | |
| 231 | − goto use_overflow_area; | |
| 232 | − case __va_stack: | |
| 233 | − use_overflow_area: | |
| 234 | − ap->overflow_arg_area += size; | |
| 235 | − ap->overflow_arg_area = | |
| 236 | − (char*)((long long)(ap->overflow_arg_area + align - 1) & -align); | |
| 237 | − return ap->overflow_arg_area - size; | |
| 238 | − default: /* should never happen */ | |
| 239 | − char *a = (char *)0; *a = 0; // abort | |
| 240 | − return 0; | |
| 241 | − } | |
| 242 | − } | |
| 243 | − | |
| 204 | + void *__va_arg(__builtin_va_list ap, int arg_type, int size, int align); | |
| 244 | 205 | #define __builtin_va_start(ap, last) \ |
| 245 | 206 | (*(ap) = *(__builtin_va_list)((char*)__builtin_frame_address(0) - 24)) |
| 246 | 207 | #define __builtin_va_arg(ap, t) \ |