aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Generate an error when a function is redefinedThomas Preud'homme2013-09-162-1/+9
| | | | | | | | | Use one more bit in AttributeDef to differenciate between declared function (only its prototype is known) and defined function (its body is also known). This allows to generate an error in cases like: int f(){return 0;} int f(){return 1;}
* win32: fix libtcc supportgrischka2013-09-102-9/+4
| | | | | | | | | | | | | | For "tcc -run file.c", I was trying to initialize the FP control in a function in libtcc1.a (_runmain) before calling main. Unfortunately that turned out to cause problems with for example libtcc_test since such usage doesn't necessarily define a 'main' function. So for tcc -run we're back to relying on the FP control word that is set in the startup code of tcc.exe rsp. libtcc.dll. This fixes part of commit 73faaea227a53e365dd75f1dba7a5071c7b5e541
* libtcc1.c: Fix __asm__() in __tcc_fpinit and __tcc_cvt_ftolRamsay Jones2013-09-091-3/+3
| | | | Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
* Fix lib, include, crt and libgcc search pathsThomas Preud'homme2013-09-072-11/+12
|
* i386-gen: preserve fp control word in gen_cvt_ftoigrischka2013-08-2811-107/+77
| | | | | | | | | | | | | | | | | | | | | | | - Use runtime function for conversion - Also initialize fp with tcc -run on windows This fixes a bug where double x = 1.0; double y = 1.0000000000000001; double z = x < y ? 0 : sqrt (x*x - y*y); caused a bad sqrt because rounding precision for the x < y comparison was different to the one used within the sqrt function. This also fixes a bug where printf("%d, %d", (int)pow(10, 2), (int)pow(10, 2)); would print 100, 99 Unrelated: win32: document relative include & lib lookup win32: normalize_slashes: do not mirror silly gcc behavior This reverts part of commit 8a81f9e1036637e21a47e14fb56bf64133546890 winapi: add missing WINAPI decl. for some functions
* tccgen: fix crash with undeclared structgrischka2013-07-241-6/+8
| | | | | | | | | | | ... as in: #include<stdio.h> int main() { struct asdasd x; printf("%d\n", sizeof(x)); } This fixes commit 17571298f30bf204fafe9cf1aca5258d2d087d63
* Relicensing TinyCCFrédéric Féret2013-06-221-1/+1
|
* Define __ARM_PCS_VFP in hardfloat compilation modeThomas Preud'homme2013-06-151-0/+3
|
* Add support for load/store of _Bool valueThomas Preud'homme2013-06-143-4/+4
| | | | | Add support for loading _Bool value in i386, x86_64 and arm as well as support for storing _Bool value on arm.
* tccpe: pstrcpy() will truncate .stabstr section name, use strncpy() instead.Roy2013-06-061-1/+1
|
* Improve texi2html -> makeinfo conversionThomas Preud'homme2013-05-291-1/+1
|
* Relicensing TinyCCFabrice Bellard2013-05-231-1/+1
|
* Relicensing TinyCCShinichiro Hamaji2013-05-061-1/+1
|
* Relicensing TinyCCThomas Preud'homme2013-05-051-1/+1
|
* Relicensing TinyCCgrischka2013-05-051-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | It has been discussed on the list whether it would be good to relicense TinyCC under a more permissive BSD-like license. The discussion started here: http://lists.gnu.org/archive/html/tinycc-devel/2013-04/msg00052.html Opinions varied but mostly were positive so it appears to be worth to start the process and see how far we can get. For that purpose I've committed a new file RELICENSING with the suggested new license clause and a list for people to confirm their agreement (or disagreement). If you have contributed to TinyCC in the past, in particular if you are one of the copyright owners for an entire file, please add yourself to that file (rsp. replace the question mark) and commit the change to the "mob" brancn with log message: Relicensing TinyCC Thanks.
* ARM hardfloat: fix struct return with float/double argsDaniel Glöckner2013-05-011-0/+1
| | | | Fixes the case where the structure is not returned in registers.
* avoid "decl after statement" pleasegrischka2013-04-303-13/+20
| | | | for compiling tcc with msc
* Improved variable length array support.James Lyon2013-04-2712-23/+311
| | | | | | | | | | | | | | | VLA storage is now freed when it goes out of scope. This makes it possible to use a VLA inside a loop without consuming an unlimited amount of memory. Combining VLAs with alloca() should work as in GCC - when a VLA is freed, memory allocated by alloca() after the VLA was created is also freed. There are some exceptions to this rule when using goto: if a VLA is in scope at the goto, jumping to a label will reset the stack pointer to where it was immediately after the last VLA was created prior to the label, or to what it was before the first VLA was created if the label is outside the scope of any VLA. This means that in some cases combining alloca() and VLAs will free alloca() memory where GCC would not.
* Fixed x86-64 long double passing.James Lyon2013-04-264-123/+206
| | | | | | long double arguments require 16-byte alignment on the stack, which requires adjustment when the the stack offset is not an evven number of 8-byte words.
* Fixed silly error in Windows build of tests (abitest-cc not linking to libtcc)James Lyon2013-04-262-33/+34
| | | | | | | | I really should do this when less tired; I keep breaking one platform while fixing another. I've also fixed some Windows issues with tcctest since Windows printf() uses different format flags to those on Linux, and removed some conditional compilation tests in tcctest since they now should work.
* Fixed i386 calling convention issue and CMake build on i386.James Lyon2013-04-263-6/+19
| | | | | The i386 calling convention expects the callee to pop 1 word of the stack when performing a struct ret.
* Sorted out CMake on x86-64 and fixed silly XMM# bug introduced when working ↵James Lyon2013-04-2510-38/+110
| | | | | | | | | on Win64 stdargs. I removed the XMM6/7 registers from the register list because they are not used on Win64 however they are necessary for parameter passing on x86-64. I have now restored them but not marked them with RC_FLOAT so they will not be used except for parameter passing.
* Added cross compilation to CMake build system.James Lyon2013-04-256-112/+263
| | | | | Brings it more into line with make based system. I've tested on 32- and 64-bit Windows, but not yet Linux.
* 64-bit tests now pass (well, nearly).James Lyon2013-04-248-142/+295
| | | | | tcctest1-3 fail, but this appears to be due to bugs in GCC rather than TCC (from manual inspection of the output).
* Added CMake build system (to facilitate Win64 builds)James Lyon2013-04-215-4/+254
| | | | | | Win32 build and tests work under CMake, however I haven't added install code yet. Win64 build fails due to chkstk.S failing to assemble.
* Workaround for MinGWs use of 80-bit long double on Win32.James Lyon2013-04-192-8/+27
| | | | | | This is incompatible with MSVC and TCC on Win32. Bounds checking appears to be broken (test4).
* Fixed 64-bit integer bug introduced by x86-64 ABI work.James Lyon2013-04-192-13/+12
| | | | Now I need to check that the x86-64 stuff still works.
* Improved x86-64 XMM register argument passing.James Lyon2013-04-192-76/+119
| | | | | | | Also made XMM0-7 available for use as temporary registers, since they are not used by the ABI. I'd like to do the same with RSI and RDI but that's trickier since they can be used by gv() as temporary registers and there isn't a way to disable that.
* Fixed problems with XMM1 use on Linux/x86-64.James Lyon2013-04-193-112/+120
| | | | | | All tests pass. I think I've caught all the cases assuming only XMM0 is used. I expect that Win64 is horribly broken by this point though, because I haven't altered it to cope with XMM1.
* Most x86-64 tests now work; only on error in test1-3.James Lyon2013-04-193-67/+129
| | | | | | I've had to introduce the XMM1 register to get the calling convention to work properly, unfortunately this has broken a fair bit of code which assumes that only XMM0 is used.
* Got test1-3 working on x86-64.James Lyon2013-04-194-85/+197
| | | | | | There are probably still issues on x86-64 I've missed. I've added a few new tests to abitest, which fail (2x long long and 2x double in a struct should be passed in registers).
* x86-64 ABI fixes.James Lyon2013-04-199-75/+334
| | | | | | | | | abitest now passes; however test1-3 fail in init_test. All other tests pass. I need to re-test Win32 and Linux-x86. I've added a dummy implementation of gfunc_sret to c67-gen.c so it should now compile, and I think it should behave as before I created gfunc_sret.
* Added some additional tests to abitest.cJames Lyon2013-04-181-13/+51
| | | | This is just to ensure that I haven't (and don't) really mess anything up.
* Tests in abitest.c now work on Win32.James Lyon2013-04-187-66/+173
| | | | | | | I expect that Linux-x86 is probably fine. All other architectures except ARM are definitely broken since I haven't yet implemented gfunc_sret for these, although replicating the current behaviour should be straightforward.
* Added ABI compatibility tests with native compiler using libtcc.James Lyon2013-04-173-1/+91
| | | | | | | | | | Only one test so far, which fails on Windows (with MinGW as the native compiler - I've tested the MinGW output against MSVC and it appears the two are compatible). I've also had to modify tcc.h so that tcc_set_lib_path can point to the directory containing libtcc1.a on Windows to make the libtcc dependent tests work. I'm not sure this is the right way to fix this problem.
* Fixed tests on Windows (including out-of-tree problems)James Lyon2013-04-177-29/+63
| | | | | | | | | | | Modified tcctest.c so that it uses 'double' in place of 'long double' with MinGW since this is what TCC does, and what Visual C++ does. Added an option -norunsrc to tcc to allow argv[0] to be set independently of the compiled source when using tcc -run, which allows tests that rely on the value of argv[0] to work in out-of-tree builds. Also added Makefile rules to automatically update out-of-tree build Makefiles when in-tree Makefiles have changed.
* Fixed out of tree build problem on Windows.James Lyon2013-04-171-7/+7
| | | | | | | | Some files installed are not generated so need to be copied from the source tree rather than the build tree. I also switched texi2html for makeinfo --html since texi2html is apparently unmaintained.
* Fix building instruction wrt make/gmakeThomas Preud'homme2013-04-081-6/+8
| | | | | | Revert building instruction to mention the use of make instead of gmake but add a note to tell FreeBSD and OSX users to use gmake instead of make.
* Update README,add x86_64/arm,FreeBSD/OSX etc.Jov2013-03-251-7/+8
| | | | | Change make to gmake because make will not be gnu make in some OS like FreeBSD
* Fix synchronization between data and instr cachesThomas Preud'homme2013-03-191-1/+1
|
* Flush caches before -running programThomas Preud'homme2013-03-182-0/+12
| | | | | | | | | | | | On some architectures, ARM for instance, the data and instruction caches are not coherent with each other. This is a problem for the -run feature since instructions are written in memory, and are thus written in the data cache first and then later flushed to the main memory. If the instructions are executed before they are pushed out of the cache, then the processor will fetch the old content from the memory and not the newly generated code. The solution is to flush from the data cache all the data in the memory region containing the instructions and to invalidate the same region in the instruction cache.
* Fix configure script on FreeBSDThomas Preud'homme2013-03-141-1/+2
| | | | | * x86-64 architectures are reported as amd64 by uname -r * FreeBSD platform don't need -ldl for linking
* Update .gitignore with regards to test changesThomas Preud'homme2013-03-111-1/+2
|
* document $CPATH, $C_INCLUDE_PATH, $LIBRARY_PATHUrs Janssen2013-02-201-3/+22
|
* don't confuse LD_LIBRARY_PATH (run time) with LIBRARY_PATH (link time)Urs Janssen2013-02-191-2/+2
|
* added CPATH, C_INCLUDE_PATH and LD_LIBRARY_PATHAndrew Aladjev2013-02-193-0/+21
|
* remove doubled prototypeUrs Janssen2013-02-184-6/+4
| | | | | fix documentation about __TINYC__ define __STDC_HOSTED__ like __STDC__