diff options
| author | grischka <grischka> | 2017-05-07 12:41:29 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2017-05-07 12:41:29 +0200 |
| commit | 44abffe33a10ee2bdc0d66f87ffa5e178182d6e6 (patch) | |
| tree | 4276ddd64a57f66a51525bec6c91255e8af40903 /tccgen.c | |
| parent | 94ac9f2b4952fbd77bfdf39e753fcbca3e472883 (diff) | |
| download | tinycc-44abffe33a10ee2bdc0d66f87ffa5e178182d6e6.tar.gz tinycc-44abffe33a10ee2bdc0d66f87ffa5e178182d6e6.tar.bz2 | |
more minor fixes
* tccgen: re-allow long double constants for x87 cross
sizeof (long double) may be 12 or 16 depending on host platform
(i386/x86_64 on unix/windows).
Except that it's 8 if the host is on windows and not gcc
was used to compile tcc.
* win64: fix builtin_va_start after VT_REF removal
See also a8b83ce43a95fa519dacfe7690a3a0098af7909c
* tcctest.c: remove outdated limitation for ll-bitfield test
It always worked, there is no reason why it should not work
in future.
* libtcc1.c: exclude long double conversion on ARM
* Makefile: remove CFLAGS from link recipes
* lib/Makefile: use target DEFINES as passed from main Makefile
* lib/armflush.c lib/va_list.c: factor out from libtcc1.c
* arm-gen.c: disable "depreciated" warnings for now
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -4578,9 +4578,12 @@ ST_FUNC void unary(void) #ifdef TCC_TARGET_PE case TOK_builtin_va_start: parse_builtin_params(0, "ee"); - if ((vtop->r & VT_VALMASK) != VT_LOCAL) - tcc_error("__builtin_va_start expects a local variable"); - vtop->r &= ~VT_LVAL; + r = vtop->r & VT_VALMASK; + if (r == VT_LLOCAL) + r = VT_LOCAL; + if (r != VT_LOCAL) + tcc_error("__builtin_va_start expects a local variable"); + vtop->r = r; vtop->type = char_pointer_type; vtop->c.i += 8; vstore(); @@ -6169,7 +6172,11 @@ static void init_putv(CType *type, Section *sec, unsigned long c) if (sizeof(long double) == LDOUBLE_SIZE) *(long double *)ptr = vtop->c.ld; else if (sizeof(double) == LDOUBLE_SIZE) - *(double *)ptr = vtop->c.ld; + *(double *)ptr = (double)vtop->c.ld; +#if (defined __i386__ || defined __x86_64__) && (defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64) + else if (sizeof (long double) >= 10) + memcpy(memset(ptr, 0, LDOUBLE_SIZE), &vtop->c.ld, 10); +#endif else tcc_error("can't cross compile long double constants"); break; |
