aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Enable variable-length arrays on arm64.Edmund Grimley Evans2015-10-312-5/+12
| | | | | arm64-gen.c: Implement gen_vla_sp_save, gen_vla_sp_restore, gen_vla_alloc. tests/Makefile: Run vla_test on arm64.
* defined twice: revertseyko2015-10-291-1/+1
| | | | An error message is changed to suggest -fcommon
* comment out tcc_error_noabort("'%s' defined twice"...seyko2015-10-251-1/+1
| | | | | | | | | | | gcc-3.4.6 don't give such error by default example file1 char __version_303_xxxxxxxx; void func1() {} example file2 char __version_303_xxxxxxxx; void func2() {} int main() { return 0; }
* include/stddef.h: define NULL only if undefinedseyko2015-10-251-0/+3
|
* tcc help output for the -xc -xa - optionsseyko2015-10-241-0/+2
|
* fix for the #include_next, v4 (final)seyko2015-10-201-19/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This version looks rigth. Comparing to the original algorithm: 1) Loop breaking. We remember a start point after wich we can try next path. Do not search include stack after this. 2) But compare next file patch with the start point. Skip if it the same. Remove "./" before comparing. PS: a problems with compaling a coreutils-8.24.51-8802e remain. There are errors messages like: src/chgrp src/chown-core.c:42: multiple definition of `make_timespec' src/chgrp.c:42: first defined here A problem is in the lib/config.h #define _GL_INLINE_ extern inline // gcc #define _GL_INLINE_ inline // tcc A long description from the lib/config.h * suppress extern inline with HP-UX cc, as it appears to be broken * suppress extern inline with Sun C in standards-conformance mode * suppress extern inline on configurations that mistakenly use 'static inline' to implement functions or macros in standard C headers like <ctype.h>. GCC and Clang are excluded from this list. Why not tcc?
* fix for the #include_next, v3seyko2015-10-191-14/+4
| | | | | | | | | | don't give an error and simply ingnore directive if we detect a loop of the #include_next. With this aproach coreutils-8.24.51-8802e compiles, but with errors: lib/libcoreutils.a: error: 'xnmalloc' defined twice lib/libcoreutils.a: error: 'xnrealloc' defined twice
* fix for the #include_next, v2seyko2015-10-171-1/+15
| | | | | | | | | A more correct fix. This one don't break old logic. But if include file is not found, we try to search again with the new compare rule. A description of the problem: http://permalink.gmane.org/gmane.comp.compilers.tinycc.devel/2769
* reverse a previous patchseyko2015-10-171-1/+3
| | | | a next version of the patch will follow
* fix for the #include_nextseyko2015-10-171-3/+1
| | | | skip include file only if include_file_name=current_file_name
* parsing "..." sequenceseyko2015-10-171-3/+1
| | | | | | | | | don't panic with error: '.' expected if there is only two '.' chars. Return tok='.' in such case. An asm code to test: jz do_move0 # .. then we have a normal low # .. or else we have a high
* tccelf.c: Reset sym after call to build_got.Edmund Grimley Evans2015-10-161-1/+3
| | | | | | | | The call to build_got can cause symtab_section->data to be reallocated (build_got -> add_elf_sym -> put_elf_sym -> section_ptr_add -> section_realloc -> tcc_realloc). This is not obvious on a cursory inspection, but fortunately Valgrind spotted it immediately. Are there other, similar bugs that Valgrind did not detect?
* tccpp.c: Avoid infinite loop on: printf '/**' | ./tcc -Edmund Grimley Evans2015-10-151-0/+2
|
* tccgen.c: Remove undefined shift of negative signed value.Edmund Grimley Evans2015-10-151-3/+4
|
* Correct prototype: void __clear_cache(void *, void *).Edmund Grimley Evans2015-10-153-4/+4
|
* Define CONFIG_TCC_ELFINTERP on NetBSD as /usr/libexec/ld.elf_soKamil Rytarowski2015-10-111-0/+2
|
* 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
|