aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* arm-gen.c: replace register constants with enum valuesDaniel Glöckner2016-10-091-10/+17
| | | | and support sp in intr
* tccgen.c: fix multi-register structure return when not on stackDaniel Glöckner2016-10-081-9/+14
| | | | | | | | | | We need to preserve the type of the pointer to the structure, f.ex. when a global structure is returned. This is not a perfect solution. Registers loaded in the first iteration might be overwritten in a following iteration as the register is no longer on vtop. This is not a problem for ARM32 as gfunc_sret returns a maximum of 1 in the integer case.
* tccgen.c: use correct type for storing long double constantsDaniel Glöckner2016-10-081-1/+6
|
* arm-gen.c: detect long double structures as HFADaniel Glöckner2016-10-081-2/+11
| | | | when long double is equal to double
* Misc. fixesgrischka2016-10-056-32/+44
| | | | | | | | | | | | | | | | | | | | Makefile : - do not 'uninstall' peoples /usr/local/doc entirely libtcc.c : - MEM_DEBUG : IDE-friendly output "file:line: ..." - always ELF for objects tccgen.c : - fix memory leak in new switch code - move static 'in_sizeof' out of function profiling : - define 'static' to empty resolve_sym() : - replace by dlsym() win32/64: fix R_XXX_RELATIVE fixme - was fixed for i386 already in 8e4d64be2fc1d707c7800c5096f6e0ea22cbd - do not -Lsystemdir if compiling to .o
* tccgen: arm/i386: save_reg_upstackgrischka2016-10-045-23/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tccgen.c:gv() when loading long long from lvalue, before was saving all registers which caused problems in the arm function call register parameter preparation, as with void foo(long long y, int x); int main(void) { unsigned int *xx[1], x; unsigned long long *yy[1], y; foo(**yy, **xx); return 0; } Now only the modified register is saved if necessary, as in this case where it is used to store the result of the post-inc: long long *p, v, **pp; v = 1; p = &v; p[0]++; printf("another long long spill test : %lld\n", *p); i386-gen.c : - found a similar problem with TOK_UMULL caused by the vstack juggle in tccgen:gen_opl() (bug seen only when using EBX as 4th register)
* tccpp: no cache for include if #elif seengrischka2016-10-042-10/+9
| | | | | | | | #ifndef guards are cached, however after #elif on the same level, the file must be re-read. Also: preprocess asm as such even when there is no assembler (arm).
* Alternative fix for "Incorrect function call code on ARMv6"grischka2016-10-032-0/+16
| | | | | | | | | | | "make test" crashes without that "save_regs()". This partially reverts commit 49d3118621a68f6583228f123efd16f0f803d908. Found another solution: In a 2nd pass Just look if any of the argument registers has been saved again, and restore if so.
* configure: fix tcc_lddir, cpugrischka2016-10-036-67/+70
| | | | ... and other minor cosmetic fixes
* switch: binary searchPavlas, Zdenek2016-10-031-23/+51
|
* switch: fix label sortingPavlas, Zdenek2016-10-032-2/+9
|
* tccgen: fix long long -> char/short castgrischka2016-10-023-4/+12
| | | | | | | | | | | | | | | | | | | | | | | This was causing assembler bugs in a tcc compiled by itself at i386-asm.c:352 when ExprValue.v was changed to uint64_t: if (op->e.v == (int8_t)op->e.v) op->type |= OP_IM8S; A general test case: #include <stdio.h> int main(int argc, char **argv) { long long ll = 4000; int i = (char)ll; printf("%d\n", i); return 0; } Output was "4000", now "-96". Also: add "asmtest2" as asmtest with tcc compiled by itself
* win32/64: msys2 supportgrischka2016-10-025-29/+27
| | | | | | | | | | | | Support ./configure && make under msys2 (a new msys fork) on win32 and win64. Get rid of CONFIG_WIN64 make-var. (On windows, WIN32 in general is used for both 32 and 64 bit platforms) Also: - cleanup win32/build-tcc.bat - adjust win32/(doc/)tcc-win32.tx
* Incorrect function call code on ARMv6Balazs Kezes2016-10-013-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 2016-08-11 09:24 +0100, Balazs Kezes wrote: > I think it's just that that copy_params() never restores the spilled > registers. Maybe it needs some extra code at the end to see if any > parameters have been spilled to stack and then restore them? I've spent some time on this and I've found an alternative solution. Although I'm not entirely sure about it but I've attached a patch nevertheless. And while poking at that I've found another problem affecting the unsigned long long division on arm and I've attached a patch for that too. More details in the patches themselves. Please review and consider them for merging! Thank you! -- Balazs [PATCH 1/2] Fix slow unsigned long long division on ARM The macro AEABI_UXDIVMOD expands to this bit: #define AEABI_UXDIVMOD(name,type, rettype, typemacro) \ ... while (num >= den) { \ ... while ((q << 1) * den <= num && q * den <= typemacro ## _MAX / 2) \ q <<= 1; \ ... With the current ULONG_MAX version the inner loop goes only until 4 billion so the outer loop will progress very slowly if num is large. With ULLONG_MAX the inner loop works as expected. The current version is probably a result of a typo. The following bash snippet demonstrates the bug: $ uname -a Linux eper 4.4.16-2-ARCH #1 Wed Aug 10 20:03:13 MDT 2016 armv6l GNU/Linux $ cat div.c int printf(const char *, ...); int main(void) { unsigned long long num, denom; num = 12345678901234567ULL; denom = 7; printf("%lld\n", num / denom); return 0; } $ time tcc -run div.c 1763668414462081 real 0m16.291s user 0m15.860s sys 0m0.020s [PATCH 2/2] Fix long long dereference during argument passing on ARMv6 For some reason the code spills the register to the stack. copy_params in arm-gen.c doesn't expect this so bad code is generated. It's not entirely clear why the saving part is necessary. It was added in commit 59c35638 with the comment "fixed long long code gen bug" with no further clarification. Given that tcctest.c passes without this, maybe it's no longer needed? Let's remove it. Also add a new testcase just for this. After I've managed to make the tests compile on a raspberry pi, I get the following diff without this patch: --- test.ref 2016-08-22 22:12:43.380000000 +0100 +++ test.out3 2016-08-22 22:12:49.990000000 +0100 @@ -499,7 +499,7 @@ 2 1 0 1 0 4886718345 -shift: 9 9 9312 +shift: 291 291 291 shiftc: 36 36 2328 shiftc: 0 0 9998683865088 manyarg_test: More discussion on this thread: https://lists.nongnu.org/archive/html/tinycc-devel/2016-08/msg00004.html
* Fix building man pages.orbea2016-10-011-1/+1
| | | | | The path for texi2pod.pl in the makefile was wrong causing the perl script to not be found.
* tccelf: allow multiple declaration of bss/common symbolsgrischka2016-10-011-5/+8
| | | | | | | | | | | | | | also in combination with one initialized: For example 1.c int xxx; 2.c int xxx = 2; 3.c int xxx; tcc 1.c 2.c 3.c
* tccpp: parse_line_comment: fix possible buffer overrungrischka2016-10-011-3/+3
|
* tccpp: allow "0x1e+1" in asmgrischka2016-10-011-9/+13
|
* tccpp: token ## pasting: preserve parts if pasting failsgrischka2016-10-011-10/+12
| | | | | | | | | for example #define LBL(name) _ ## name ## : LBL(main) will give two tokens '_main' and ':' and the warning
* Revert "-fnormalize-inc-dirs"grischka2016-10-014-100/+1
| | | | | | | Too much code. gcc 3.x doesn't have that either. This reverts commit 41785a0bf9d505a3647a10ddc330417f52fd4528. This reverts commit 21665f433890e2038626f0b3123b189a62a67dc9.
* tcc -E: add one space in cases: tiny solutiongrischka2016-10-013-54/+26
| | | | | | replaces f5f82abc99424c4ece836000934fcf57a867c635 Also: fix tcc flags in Makefile, fix tcc -E
* build: restore out-of-tree supportgrischka2016-10-016-48/+58
|
* build: revert Makefiles to 0.9.26 state (mostly)grischka2016-10-0110-579/+379
| | | | | | | | | | | | Except - that libtcc1.a is now installed in subdirs i386/ etc. - the support for arm and arm64 - some of the "Darwin" fixes - tests are mosly unchanged Also - removed the "legacy links for cross compilers" (was total mess) - removed "out-of-tree" build support (was broken anyway)
* test/pp: cleanupgrischka2016-10-016-74/+20
|
* libtcc: reimplement option -Wl,[-no]-whöle-archivegrischka2016-10-015-108/+114
| | | | - taking advantage of previous commit "incremental -Wl parsing"
* libtcc: -Wl,... incremental parsinggrischka2016-10-013-38/+31
| | | | parse -Wl linker options immediately
* Revert "output all sections if we produce an executable file"grischka2016-10-013-14/+1
| | | | | | | | | -- Not a fix This reverts commit 089ce6235c99638ad4542a57af4d09e2be0efc88. Revert "handle a -s option by executing sstrip/strip program" -- related, not a fix. This reverts commit 5cd4393a542ef4c64df7dcbb3fbe3a629666239d.
* Revert part of "fix installation amd bcheck for Windows"grischka2016-10-018-92/+58
| | | | | | | tccelf.c : force linking bcheck by adding elf symbol __bound_init bcheck.c : use (size_t)1 for x86_64 Fixes 7e7e6148fdb4adbda936f80b5d4ac3d738908d95
* libtcc: filetype cleanupgrischka2016-10-015-55/+58
| | | | - does not change signature of tcc_add_file
* Remove misc. filesgrischka2016-10-0135-6966/+9
| | | | | | | | | | | | - from win32/include/winapi: various .h The winapi header set cannot be complete no matter what. So lets have just the minimal set necessary to compile the examples. - remove CMake support (hard to keep up to date) - some other files Also, drop useless changes in win32/lib/(win)crt1.c
* tccpp: cleanupgrischka2016-10-015-184/+169
| | | | | | | | | | | | | | | | - "utf8 in identifiers" from 936819a1b90f2618bb3f86730189cf2895948ba0 - CValue: remove member str.data_allocated - make tiny allocator private to tccpp - allocate macro_stack objects on heap because otherwise it could crash after error/setjmp in preprocess_delete():end_macro() - mov "TinyAlloc" defs to tccpp.c - define_push: take int* str again
* libtcc: cleanup @listfilegrischka2016-10-015-170/+141
| | | | | | | | | Also: - allow more than one item per line - respect "quoted items" and escaped quotes \" (also for LIBTCCAPI tcc_setoptions) - cleanup some copy & paste
* libtcc: cleanup -x<filetype> switch codegrischka2016-10-014-39/+34
| | | | | Abusing filename[0] as type is just too much of a hack. -- From 05364072042ff37904a7b0b14cdd85a1ea1ca11d
* Revert "ability to compile multiple *.c files with -c switch"grischka2016-10-012-48/+24
| | | | | | | copy & paste coding, twisted control flow This reverts commit a13f183e4c2c4b4d1d40e142b57a4298672dfd2c. Also, set linker args for DLLs also.
* tccpp: #pragma once: make it workgrischka2016-10-012-37/+25
| | | | | | | | | | | after several "fixes" and "improvements" b3782c3cf5e66f74207303c381a305daabccdb12 5fb57bead41cd3a84f0aa3f98d00b5fe5de25a08 feature did not work at all - Use 'once' flag, not 'ifndef_macro' - Ignore filename letter case on _WIN32 - Increment global pp_once for each compilation
* tccpp: restore -D symbols for multiple sourcesgrischka2016-10-012-22/+18
| | | | | | | | | | | | | | | ... also for built-in defines The case: $ tcc -D FOO a.c b.c with // a.c #undef FOO // b.c #ifndef FOO # error -D FOO has been lost #endif
* Revert "--whole-archive support"grischka2016-10-016-43/+3
| | | | | | | | | | | | - would parse linker args in two different places - would mess up "tcc -v ..." output: tcc -v test.c -> test.c +> test.c - would use function "tcc_load_alacarte()" to do the contrary of what its name suggests. This reverts commit 19a169ceb896f78205bc23b847938c58f14d1dda.
* gtst_addr(): short conditional jumps (i386, x86_64)Pavlas, Zdenek2016-09-304-3/+34
|
* switch: collect case ranges first, then generate codePavlas, Zdenek2016-09-301-49/+65
| | | | | Collect cases first, then emit lookup code. Elliminates jumps to implement pass-through and jumps to link cases.
* Prevent tail spin crash when option -pthread is used.Jean-Claude Beaudoin2016-09-291-2/+4
|
* Use etags to produce target TAGS.Jean-Claude Beaudoin2016-09-291-1/+1
|
* Rein in unintended external functions on Windows.Jean-Claude Beaudoin2016-09-274-5/+7
|
* More properly propagate ONE_SOURCE.Jean-Claude Beaudoin2016-09-271-1/+8
|
* pstrcpy looks to be needed by Windows win32/win64 builds. Reverted as ↵Christian Jullien2016-09-262-2/+2
| | | | PUB_FUNC to allow tcc.exe build again.
* Merge branch 'mob' of git://repo.or.cz/tinycc into mypatchChristian Jullien2016-09-265-20/+20
|\ | | | | | | Add Visual Studio processor identification
| * Rein in unintended external functions.Jean-Claude Beaudoin2016-09-255-20/+20
| |
* | Add Microsoft processor identificationChristian Jullien2016-09-261-0/+6
|/
* Fix test for __*LP*__ predefined macrosChristian Jullien2016-09-251-11/+11
|
* Improve __*LP*__ predefined macrosChristian Jullien2016-09-251-2/+9
|
* Add test for __*LP*__ predefined macrosChristian Jullien2016-09-252-0/+39
|