aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* be stricter with aliasinggrischka2014-01-076-89/+92
| | | | | | | | | | | | | | 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
* misc. fixesgrischka2014-01-0610-54/+46
| | | | | | | | | | | | | | | | | | | | | | - 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: cleanup "imports per ordinal"grischka2014-01-063-143/+33
| | | | | | | - tccpe.c: avoid conflict with imp_sym->st_value, cleanup - _parseLibs.bat, _tcc.bat: no instructions for usage, removed. from commit 642b6d0f50c6b6a842c9239a102fe34d5619e931
* i386: use __fixdfdi instead of __tcc_cvt_ftolgrischka2014-01-066-80/+84
| | | | | | | | | | | | 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
* Fix struct ret in variadic fct with ARM hardfloatThomas Preud'homme2014-01-067-23/+35
| | | | | | | | | | | | | 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().
* Don't call __tcc_fpinit if using libgccThomas Preud'homme2014-01-061-0/+2
|
* Don't enable bound check if libgcc is usedThomas Preud'homme2014-01-062-2/+3
| | | | | Bound check rely on some functions provided by libtcc. It should therefore not be enabled when libgcc is used.
* Relicensing TinyCCDaniel Glöckner2014-01-041-0/+1
| | | | | I'm fine with relicensing all my contributions to files other than arm-gen.c.
* Move logic for if (int value) to tccgen.cThomas Preud'homme2014-01-046-118/+37
| | | | | | | 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.
* Update Changelog from git changelog entriesThomas Preud'homme2014-01-041-1/+63
|
* Relicensing TinyCCDaniel Glöckner2014-01-041-1/+1
|
* Fix negation of 0.0 and -0.0Thomas Preud'homme2014-01-041-2/+15
|
* Provide install-strip target in MakefileThomas Preud'homme2014-01-041-0/+3
|
* Use libtcc.a for static link even with USE_LIBGCCThomas Preud'homme2014-01-032-2/+7
| | | | | | | 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.
* Report error on NaN comparisonThomas Preud'homme2014-01-032-4/+13
| | | | | | | | 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.
* Always set *palign in classify_x86_64_argThomas Preud'homme2014-01-031-0/+1
| | | | | | | 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.
* Fix "Add support for struct > 4B returned via registers"grischka2013-12-163-16/+31
| | | | | | | | | | | - 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
* make git ignore lib/arm directoryThomas Preud'homme2013-12-151-0/+1
|
* Fix signed integer division in ARM runtime ABIThomas Preud'homme2013-12-151-9/+21
| | | | | | | | - 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 ARM aeabi functions needed to run tcctestThomas Preud'homme2013-12-113-1/+509
| | | | | | | | | | | | 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,
* Support special calling convention for runtime ABIThomas Preud'homme2013-12-111-15/+34
| | | | | | | | 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
* Define __ARM_EABI__ and __ARMEL__ when applicableThomas Preud'homme2013-11-261-0/+4
|
* Make abitest.c have predictable resultThomas Preud'homme2013-11-251-2/+2
| | | | | | | | 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 va_* macro implementation for ARMThomas Preud'homme2013-11-251-0/+11
|
* Add comment to explain the code added by 41ce391cThomas Preud'homme2013-11-251-1/+4
| | | | | | 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 structure passing in ARM calling conventionThomas Preud'homme2013-11-251-3/+6
| | | | | | 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.
* Add support for struct > 4B returned via registersThomas Preud'homme2013-11-225-49/+77
| | | | | | | | 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.
* Remove code in arm-gen.c for struct packing in regThomas Preud'homme2013-11-221-21/+3
| | | | | Struct packing in register is now handled since commit 2bbfaf43 by tccgen.c proper.
* Correctly identify homogeneous float aggregateThomas Preud'homme2013-11-221-1/+1
| | | | | First related symbol of a structure justs indicate its size. This first member is the second related symbol.
* Fix counting of VFP regs in ARM's gfunc_prologThomas Preud'homme2013-11-211-1/+2
| | | | | | | | | 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.
* Fix register corruption at function call on ARMThomas Preud'homme2013-11-211-6/+16
| | | | | | | | 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 thumb transition for R_ARM_PC24Thomas Preud'homme2013-11-181-12/+13
| | | | | 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 and reclaim stack at function callThomas Preud'homme2013-11-171-6/+8
| | | | | | | * 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.
* Refactor and simplify gfunc_call() on armThomas Preud'homme2013-11-151-296/+328
|
* struct variable behind guard, proper macro check, and remove some whitespace.Joseph Poirier2013-11-082-54/+56
| | | | | | | 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 implementation in libtcc1Thomas Preud'homme2013-11-053-2/+36
| | | | Add __clear_cache function for flushing caches to libtcc1.
* Fix allocation of struct in registers on ARMThomas Preud'homme2013-11-051-46/+44
| | | | | | | | | | | 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.
* Revert "Add support for thread-local storage variables"Thomas Preud'homme2013-11-035-54/+14
| | | | | | | | | | 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.
* Add support for thread-local storage variablesThomas Preud'homme2013-10-295-14/+54
|
* Detect usage of incomplete types inside struct/unionAmine Najahi2013-10-061-1/+12
| | | | | Make sure the only exception is for a flexible array member as the last element of a structure
* Fix CONFIG_TCC_SYSINCLUDEPATHS on !win32 systemsRamsay Jones2013-10-021-2/+4
| | | | | | | | | | | 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>
* Fix commit 0f5942c6b382105075dabb6f975a313efc63a5f9Thomas Preud'homme2013-10-011-7/+3
|
* Avoid warnings with gcc 4.8 + default CFLAGSThomas Preud'homme2013-09-242-12/+17
|
* Detect correct instruction with incorrect operandsThomas Preud'homme2013-09-243-2/+6
| | | | | | Display a different warning when an instruction is recognized by tcc but the operands found do not correspond to the constraints of the instruction.
* set the user-defined library search paths firstVittorio Giovara2013-09-231-3/+1
|
* Report error when redefining enumeratorThomas Preud'homme2013-09-201-0/+4
| | | | | | | Prevent the following code from compiling: enum color {RED, GREEN, BLUE}; enum rgb {RED, G, B};
* Report error when using undefined enumThomas Preud'homme2013-09-201-4/+5
| | | | | | | | | | | | Prevent the following code from compiling: int main(void) { enum rgb c = 42; return c; } Reported-by: John Haque <j.eh@mchsi.com>
* Forbid enum redefinition.Thomas Preud'homme2013-09-201-0/+1
| | | | | | | | | | | | | | 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>
* Forbid the use of array of functionsThomas Preud'homme2013-09-191-0/+2
| | | | | | | | Prevent the following code from compiling: int (*fct)[42](int x); Reported-by: Abdul Wadud Mohammad Mohibur Rashid <mohibur_rashid@yahoo.com>
* Add the possibility to use noname functions by ordinalYX Hao2013-09-195-8/+150
| | | | | | | | | | | | | | | | | | | | | 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>