aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Define __WINT_TYPE__ as int in NetBSDKamil Rytarowski2015-10-111-1/+1
|
* Add support for -D__NetBSD__Kamil Rytarowski2015-10-111-0/+5
|
* win32: UUID typedef addedseyko2015-09-251-0/+5
|
* a number as a field name (part 2)seyko2015-09-251-0/+2
| | | | | | | | | | | | | | | | don't crash a test program: ================ typedef struct X { int len; } X; #define init(s,len) s.len = len; int main(void) { X myX; init(myX,10); return 0; } ================ After a patch: error: field name expected
* a number as a field nameseyko2015-09-251-2/+4
| | | | | | | | | | | | | | | | a test program: ======== typedef struct X { int len; } X; int main(void) { X myX; myX.10 = 10; return 0; } ======== Error message before a patch: error: ';' expected (got "(null)") After a patch: error: field name expected
* SSE opcodes to TCC assembler (i386, x86_64)seyko2015-09-232-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch from Anaƫl Seghezzi a test program: ============================ #include <stdio.h> struct fl4{ float x, y, z, w; }; void asm_test(void) { struct fl4 v1, v2, v3; v1.x = 0.1; v1.y = 0.2; v1.z = 0.4; v1.w = 0.3; v2.x = 0.11; v2.y = 0.0; v2.z = 0.01; v2.w = 0.04; asm volatile ( "movups %0, %%xmm0;" "movups %1, %%xmm1;" "addps %%xmm1, %%xmm0;" "movups %%xmm0, %2" :: "g" (v1), "g" (v2), "g" (v3) : "memory"); printf("sse fl4 add : %f %f %f %f\n", v3.x, v3.y, v3.z, v3.w); printf("expected : %f %f %f %f\n", v1.x+v2.x, v1.y+v2.y, v1.z+v2.z, v1.w+v2.w); } int main() { asm_test(); } /* sse fl4 add : 0.210000 0.200000 0.410000 0.340000 expected : 0.210000 0.200000 0.410000 0.340000 */ ============================
* Adding two more people to the RELICENSING file.gus knight2015-07-311-0/+2
| | | | They also responded to my mail with a YES.
* Revert "fix-mixed-struct (patch by Pip Cet)"gus knight2015-07-298-452/+228
| | | | This reverts commit 4e04f67c94c97b4f28a4d73759a0ad38fb3a10f7. Requested by grischka.
* Revert all of my changes to directories & codingstyle.gus knight2015-07-2952-4461/+4438
|
* Fix Makefile.gus knight2015-07-292-3/+3
|
* Fix formatting breakage from "rogue tabs" commit.gus knight2015-07-299-405/+403
|
* Add a root Makefile for running targets in subdirectories.gus knight2015-07-291-0/+8
|
* Relicensing TinyCC.gus knight2015-07-291-2/+7
| | | | | I've been sending a lot of mails out asking contributors if they approve the license change, so I'm adding the ones who reply here.
* typo in RELICENSINGVincent Lefevre2015-07-291-1/+1
|
* Relicensing TinyCCVincent Lefevre2015-07-291-0/+1
|
* Reorganize the source tree.gus knight2015-07-2745-91/+90
| | | | | | | | | | * Documentation is now in "docs". * Source code is now in "src". * Misc. fixes here and there so that everything still works. I think I got everything in this commit, but I only tested this on Linux (Make) and Windows (CMake), so I might've messed something up on other platforms...
* clang-format on arm-gen.c and tcccoff.c.gus knight2015-07-272-2034/+2049
| | | | They now mostly follow the same coding style as everything else.
* Update CodingStyle.gus knight2015-07-271-1/+5
|
* Clean up lots of rogue tabs.gus knight2015-07-2710-427/+426
| | | | | | Still some more tabs to be taken care of. arm-gen.c and tcccoff.c have so many style issues that I'm just going to throw clang-format at them.
* Trim trailing spaces everywhere.gus knight2015-07-2727-430/+430
|
* Relicensing TinyCC.gus knight2015-07-271-0/+1
| | | | I haven't contributed anything yet, but I might as well add this :)
* fix-mixed-struct (patch by Pip Cet)seyko2015-05-148-228/+452
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jsut for testing. It works for me (don't break anything) Small fixes for x86_64-gen.c in "tccpp: fix issues, add tests" are dropped in flavor of this patch. Pip Cet: Okay, here's a first patch that fixes the problem (but I've found another bug, yet unfixed, in the process), though it's not particularly pretty code (I tried hard to keep the changes to the minimum necessary). If we decide to actually get rid of VT_QLONG and VT_QFLOAT (please, can we?), there are some further simplifications in tccgen.c that might offset some of the cost of this patch. The idea is that an integer is no longer enough to describe how an argument is stored in registers. There are a number of possibilities (none, integer register, two integer registers, float register, two float registers, integer register plus float register, float register plus integer register), and instead of enumerating them I've introduced a RegArgs type that stores the offsets for each of our registers (for the other architectures, it's simply an int specifying the number of registers). If someone strongly prefers an enum, we could do that instead, but I believe this is a place where keeping things general is worth it, because this way it should be doable to add SSE or AVX support. There is one line in the patch that looks suspicious: } else { addr = (addr + align - 1) & -align; param_addr = addr; addr += size; - sse_param_index += reg_count; } break; However, this actually fixes one half of a bug we have when calling a function with eight double arguments "interrupted" by a two-double structure after the seventh double argument: f(double,double,double,double,double,double,double,struct { double x,y; },double); In this case, the last argument should be passed in %xmm7. This patch fixes the problem in gfunc_prolog, but not the corresponding problem in gfunc_call, which I'll try tackling next.
* win32/include/winapi changes from https://github.com/run4flat/tinycc.gitseyko2015-05-1419-34/+2895
| | | | | | | | just for testing. Is it needed? I'm not a MSYS citizen. run4flat is a tcc fork by David Mertens that knows how to work with multiple symbol tables. Excelent work. A good descriptions of the tcc internals inside a code comments.
* redo of the -dD optionseyko2015-05-134-61/+119
| | | | | | | | functionality was broken some time ago and was removed by the "tccpp: fix issues, add tests" fix: LINE_MACRO_OUTPUT_FORMAT_NONE in pp_line() means: output '\n' and not "don't output at all"
* some -bench fixesseyko2015-05-122-9/+9
| | | | print stats to stderr, not to stdout
* minor pp optimizationsseyko2015-05-123-20/+13
| | | | | | * remove free_defines() from tcc_preprocess() all cleanup will be done in tcc_delete * move a preprocessor file closing to tcc_delete too
* restore a max memory usage printing for a new MEM_DEBUG when -benchseyko2015-05-122-4/+7
|
* SYMBOL_NAME_LABEL(X) X##:seyko2015-05-121-1/+3
| | | | | | | | | | In the linux kernel sources: #ifdef __STDC__ #define SYMBOL_NAME_LABEL(X) X##: #else #define SYMBOL_NAME_LABEL(X) X/**/: #endif tcc is a STDC compiler and must handle 'X##:' case.
* a new version of the MEM_DEBUGseyko2015-05-122-30/+195
|
* a mem leak fix for "ability to compile multiple *.c files with -c switch"seyko2015-05-121-5/+4
| | | | | | A new version of the MEM_DEBUG will be submitted next. This version is not depend on the malloc_usable_size() presense in the libc and print a places where a leaked chunks of memory was allocated.
* allow to use MEM_DEBUG with libtccseyko2015-05-112-2/+1
|
* tcc_add_dll is not used if TCC_TARGET_PEseyko2015-05-102-0/+6
| | | | after "tccpp: fix issues, add tests"
* define __OPTIMIZE__ if -ON (N != 0)seyko2015-05-101-0/+9
| | | | this is gcc behaviour
* warn if multile -o option is givenseyko2015-05-101-0/+4
|
* restore "./configure --enable-tcc32-mingw" on linuxseyko2015-05-101-0/+6
| | | | | | commit "tccpp: fix issues, add tests" also include - configure/Makefile : build on windows (MSYS) was broken which breaks a cross compilation on linux
* tccpp: fix issues, add testsgrischka2015-05-0949-985/+1057
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix some macro expansion issues * add some pp tests in tests/pp * improved tcc -E output for better diff'ability * remove -dD feature (quirky code, exotic feature, didn't work well) Based partially on ideas / researches from PipCet Some issues remain with VA_ARGS macros (if used in a rather tricky way). Also, to keep it simple, the pp doesn't automtically add any extra spaces to separate tokens which otherwise would form wrong tokens if re-read from tcc -E output (such as '+' '=') GCC does that, other compilers don't. * cleanups - #line 01 "file" / # 01 "file" processing - #pragma comment(lib,"foo") - tcc -E: forward some pragmas to output (pack, comment(lib)) - fix macro parameter list parsing mess from a3fc54345949535524d01319e1ca6378b7c2c201 a715d7143d9d17da17e67fec6af1c01409a71a31 (some coffee might help, next time ;) - introduce TOK_PPSTR - to have character constants as written in the file (similar to TOK_PPNUM) - allow '\' appear in macros - new functions begin/end_macro to: - fix switching macro levels during expansion - allow unget_tok to unget more than one tok - slight speedup by using bitflags in isidnum_table Also: - x86_64.c : fix decl after statements - i386-gen,c : fix a vstack leak with VLA on windows - configure/Makefile : build on windows (MSYS) was broken - tcc_warning: fflush stderr to keep output order (win32)
* VLA code: minor fixPhilip2015-05-041-1/+0
| | | | Don't try to call get_flags() on the mob branch, where it's not defined.
* VLA code minor fixseyko2015-05-041-1/+2
|
* a lot simpler VLA codeseyko2015-05-044-94/+33
| | | | | | | | Author: Philip <pipcet@gmail.com> Our VLA code can be made a lot simpler (simple enough for even me to understand it) by giving up on the optimization idea, which is very tempting. There's a patch to do that attached, feel free to test and commit it if you like. (It passes all the tests, at least
* -traditional and -iwithprefix optionsseyko2015-05-031-0/+27
|
* fix "tcc test.c -Wl,,--oformat,binary"seyko2015-05-032-4/+5
| | | | | set linker options only when "s->output_type == TCC_OUTPUT_EXE" otherwise tcc will produce a wrong object file
* fix "tcc test.c -UAAA -UBBB"seyko2015-05-031-1/+0
| | | | | no need to call tcc_free() inside tcc_undefine_symbol() Otherwise we get segmentation fault inside tcc_delete()
* Mostly revert "tccpp.c: minor fix I'd accidentally not committed"Philip2015-05-021-40/+17
| | | | | | | This reverts commit 27ec4f67a33a354c8f377dd4a5b42491c2b43beb. Sorry about that, I included changes which are still being tested, by accident.
* tccpp.c: minor fix I'd accidentally not committedPhilip2015-05-021-19/+43
| | | | Sorry about that. This should definitely fix Sergey's issue.
* minor fixPhilip2015-05-021-1/+2
| | | | | | | Fixes the issue reported by Sergey at http://lists.nongnu.org/archive/html/tinycc-devel/2015-05/msg00007.html I hope.
* tccpp.c: unterminated macro argument error messagePhilip2015-05-021-0/+2
| | | | | | | | #define a(x) x a(( would produce "error: , expected" when what's actually expected is a ')'.
* tccpp.c: fix GNU comma handlingPhilip2015-05-022-19/+35
| | | | | | | | | This requires moving TOK_PLCHLDR handling, but the new logic should make things easier even if (when?) GNU comma handling is removed. (Somewhat confusingly, GCC no longer supports GNU commas. See http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html for a description of past and current GCC behaviour.)
* tccpp.c: restore whitespace after failed macroPhilip2015-05-021-12/+35
| | | | | | | | | This fixes test7 described in: http://lists.nongnu.org/archive/html/tinycc-devel/2015-05/msg00002.html Note that the current code still adds excessive forced blank characters to its output, so this patch might not change visible behaviour.
* tccpp.c: correct # stringificationPhilip2015-05-021-4/+23
| | | | | | | | | | | | | | | | | | Fix handling of escape characters, spaces, and line feeds in macros or macro arguments that might yet be subject to # stringification. Should this be an -f option? I think memory usage increases only very slightly (in particular, while line feeds, stray \s, and spaces are preserved, comments are not), so it's probably not worth it to make it one. Note that macro_subst now checks for stray \s which are still left in the input stream after macro substitution, if desired. This patch depends on the previous patch, so if you revert that, please revert this patch, too. See http://lists.nongnu.org/archive/html/tinycc-devel/2015-05/msg00002.html
* tccpp.c: parse flag to accept stray \Philip2015-05-022-2/+9
| | | | | | | | | | | | | | | | | | | This adds a PARSE_FLAG_ACCEPT_STRAYS parse flag to accept stray backslashes in the source code, and uses it for pure preprocessing. For absolutely correct behaviour of # stringification, we need to use this flag when parsing macro definitions and in macro arguments, as well; this patch does not yet do so. The test case for that is something like #define STRINGIFY2(x) #x #define STRINGIFY(x) STRINGIFY2(x) STRINGIFY(\n) which should produce "\n", not a parse error or "\\n". See http://lists.nongnu.org/archive/html/tinycc-devel/2015-05/msg00002.html