| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactoring (no logical changes):
- use memcpy in tccgen.c:ieee_finite(double d)
- use union to store attribute flags in Sym
Makefile: "CFLAGS+=-fno-strict-aliasing" basically not necessary
anymore but I left it for now because gcc sometimes behaves
unexpectedly without.
Also:
- configure: back to mode 100755
- tcc.h: remove unused variables tdata/tbss_section
- x86_64-gen.c: adjust gfunc_sret for prototype
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- tccgen: error out for cast to void, as in
void foo(void) { return 1; }
This avoids an assertion failure in x86_64-gen.c, also.
also fix tests2/03_struct.c accordingly
- Error: "memory full" - be more specific
- Makefiles: remove circular dependencies, lookup tcctest.c from VPATH
- tcc.h: cleanup lib, include, crt and libgcc search paths"
avoid duplication or trailing slashes with no CONFIG_MULTIARCHDIR
(as from 9382d6f1a0e2d0104a82ed805207d9e742c6b068)
- tcc.h: remove ";{B}" from PE search path
in ce5e12c2f950052d8109b6b7a56d900547705c08 James Lyon wrote:
"... I'm not sure this is the right way to fix this problem."
And the answer is: No, please. (copying libtcc1.a for tests instead)
- win32/build_tcc.bat: do not move away a versioned file
|
| |
|
|
|
|
|
| |
- tccpe.c: avoid conflict with imp_sym->st_value, cleanup
- _parseLibs.bat, _tcc.bat: no instructions for usage, removed.
from commit 642b6d0f50c6b6a842c9239a102fe34d5619e931
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Variants __fixsfdi/__fixxfdi are not needed for now because
the value is converted to double always.
Also:
- remove __tcc_fpinit for unix as it seems redundant by the
__setfpucw call in the startup code
- avoid reference to s->runtime_main in cross compilers
- configure: fix --with-libgcc help
- tcctok.h: cleanup
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The procedure calling standard for ARM architecture mandate the use of
the base standard for variadic function. Therefore, hgen float aggregate
must be returned via stack when greater than 4 bytes and via core
registers else in case of variadic function.
This patch improve gfunc_sret() to take into account whether the
function is variadic or not and make use of gfunc_sret() return value to
determine whether to pass a structure via stack in gfunc_prolog(). It
also take advantage of knowing if a function is variadic or not move
float result value from VFP register to core register in gfunc_epilog().
|
| | |
|
| |
|
|
|
| |
Bound check rely on some functions provided by libtcc. It should
therefore not be enabled when libgcc is used.
|
| |
|
|
|
| |
I'm fine with relicensing all my contributions to files other than
arm-gen.c.
|
| |
|
|
|
|
|
| |
Move the logic to do a test of an integer value (ex if (0)) out of
arch-specific code to tccgen.c to avoid code duplication. This also
fixes test of long long value which was only testing the bottom half of
such values on 32 bits architectures.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
When statically linking, runtime library should be static as well. tcc
could link with libgcc.a but it's in a gcc version specific directory.
Another solution, followed by this patch, is to use libtcc.a when
statically linking, even if USE_LIBGCC was configured.
|
| |
|
|
|
|
|
|
| |
Use comisd / fcompp for float comparison (except TOK_EQ and TOK_NE)
instead of ucomisd / fucompp to detect NaN comparison.
Thanks Vincent Lefèvre for the bug report and for also giving the
solution.
|
| |
|
|
|
|
|
| |
Set *palign for VT_BITFIELD and VT_ARRAY types in classify_x86_64_arg as
else you happen to have in *palign what was already there. This can
cause gfunc_call on !PE systems to consider an array as 16 bytes align
and trigger the assert if the previous argument was 16 bytes aligned.
|
| |
|
|
|
|
|
|
|
|
|
| |
- avoid assumption "ret_align == register_size" which is
false for non-arm targets
- rename symbol "sret" to more descriptive "ret_nregs"
This fixes commit dcec8673f21da86ae3dcf1ca3e9498127715b795
Also:
- remove multiple definitions in win32/include/math.h
|
| | |
|
| |
|
|
|
|
|
|
| |
- fix computation of absolute value (clearing the sign bit does not
since integers are encoded in 2's complement)
- test sign of integer in a more conventional way (binary and with the
high bit does not work for long long due to a bug in gtst)
- spacing in include
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add implementation for float / integer conversion functions:
__aeabi_d2lz, __aeabi_d2ulz, __aeabi_f2lz, __aeabi_f2ulz, __aeabi_l2d,
__aeabi_l2f, __aeabi_ul2d, __aeabi_ul2f
Add implementation for long long helper functions:
__aeabi_ldivmod, __aeabi_uldivmod, __aeabi_llsl, __aeabi_llsr, __aeabi_lasr
Add implementation for integer division functions:
__aeabi_uidiv, __aeabi_uidivmod, __aeabi_idiv, __aeabi_idivmod,
|
| |
|
|
|
|
|
|
| |
Add infrastructure to support special calling convention for runtime ABI
function no matter what is the current calling convention. This involve
2 changes:
- behave as per base standard in gfunc_call
- move result back in VFP register in gen_cvt_itof1
|
| | |
|
| |
|
|
|
|
|
|
| |
stdarg_test in abitest.c relies on a sum of some parameters made by both
the caller and the callee to reach the same result. However, the
variables used to store the temporary result of the additions are not
initialized to 0, leading to uncertainty as to the results. This commit
add this needed initialization.
|
| | |
|
| |
|
|
|
|
| |
Add a comment in arm-gen.c to explain how commit
41ce391c86df135609af33658414d4d452c5beb3 solves the register corruption
when passing a structure in a function call.
|
| |
|
|
|
|
| |
Fix the address on stack where a structure is copied when it is a
parameter of a function call. This address must be computed from the
stack pointer and a possible padding offset.
|
| |
|
|
|
|
|
|
| |
On ARM with hardfloat calling convention, structure containing 4 fields
or less of the same float type are returned via float registers. This
means that a structure can be returned in up to 4 double registers in a
structure is composed of 4 doubles. This commit adds support for return
of structures in several registers.
|
| |
|
|
|
| |
Struct packing in register is now handled since commit 2bbfaf43 by
tccgen.c proper.
|
| |
|
|
|
| |
First related symbol of a structure justs indicate its size. This first
member is the second related symbol.
|
| |
|
|
|
|
|
|
|
| |
Fix in gfunc_prolog for ARM the counting of the highest numbered VFP
float register used for parameter passing, rounded to 2. It can be
computed from the range of VFP float register with the highest range
start and adding the number of VFP float register occupied. This ensure
that parameter of type struct that spans over more than 2 float
registers are correctly taken into account.
|
| |
|
|
|
|
|
|
| |
Prior to this commit, params could use some registers that do not appear
in the value stack. Therefore when generating function call, one of such
register could be reused, leading to wrong parameter content. This
happens when a structure is passed via core register, as only the first
register would appear in the value stack.
|
| |
|
|
|
| |
Allow bl -> blx conversion in the case of R_ARM_PC24 relocation with
instruction being an unconditional bl. Also make spacing more uniform.
|
| |
|
|
|
|
|
| |
* Correctly align stack in case of structure split between core
registers and stack
* Correctly reclaim stack space after function call in the case where
the stack needed padding to be aligned at function call.
|
| | |
|
| |
|
|
|
|
|
| |
Wrap runtime_main as per its declaration in tcc.h.
Fix preprocessor check for TCC_ARM_EABI macro definition.
Signed-off-by: Joseph Poirier <jdpoirier@gmail.com>
|
| |
|
|
| |
Add __clear_cache function for flushing caches to libtcc1.
|
| |
|
|
|
|
|
|
|
|
|
| |
Allocation of struct in core and/or VFP registers on ARM is made by
manipulating the value stack to create 3 distinct zones: parameters
allocated on stack, parameters of type struct allocated in core
registers and parameters of type struct allocated in VFP registers.
Parameters of primitive type can be in any zone. This commit change the
order of the zones from stack, VFP, core to stack, core, VFP (from
highest addresses to lowest ones) in order to correctly deal the
situation when structures are allocated both in core and VFP registers.
|
| |
|
|
|
|
|
|
|
|
| |
TLS support in tinyCC is absolutely not ready:
- segment register not select in load and store
- no relocation added for computing offset of per-thread symbol
- no support for TLS-specific relocations
- no program header added as per Drepper document about TLS
This reverts commit 1c4afd13501f07a673aed5f130166f2ee0f30927.
|
| | |
|
| |
|
|
|
| |
Make sure the only exception is for a flexible array member
as the last element of a structure
|
| |
|
|
|
|
|
|
|
|
|
| |
Commit 9382d6f1 ("Fix lib, include, crt and libgcc search paths",
07-09-2013) inadvertently included an initial empty entry to the
CONFIG_TCC_SYSINCLUDEPATHS variable (for non win32 targets). In
addition to an empty line in the 'tcc -vv' display, this leads
to the preprocessor attempting to read an include file from the
root of the filesystem (i.e. '/header.h').
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Display a different warning when an instruction is recognized by tcc but
the operands found do not correspond to the constraints of the
instruction.
|
| | |
|
| |
|
|
|
|
|
| |
Prevent the following code from compiling:
enum color {RED, GREEN, BLUE};
enum rgb {RED, G, B};
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Prevent the following code from compiling:
int main(void)
{
enum rgb c = 42;
return c;
}
Reported-by: John Haque <j.eh@mchsi.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prevent the following code from compiling:
enum color {RED, GREEN, BLUE};
enum color {R, G, B};
int main()
{
return R;
}
Reported-by: John Haque <j.eh@mchsi.com>
|
| |
|
|
|
|
|
|
| |
Prevent the following code from compiling:
int (*fct)[42](int x);
Reported-by: Abdul Wadud Mohammad Mohibur Rashid <mohibur_rashid@yahoo.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tcc.c:
process.h:177:20: note: expected 'char * const*' but argument is of type 'char const*const*'
tccpe.c:
Add the possibility to use noname functions by ordinal.
use def file: "AliasName @n"
build-tcc.bat:
1. Enable 32 bits mode on 64 bits OS.
2. build doc.
_parseLibs.bat:
Convenient to use "*.def + *.c" instead of *.a, just use -l*
_tcc.bat:
a practice of _parseLibs.bat
Signed-off-by: YX Hao <lifenjoiner@163.com>
|