Re: [Tinycc-devel] bounds checking

2019-12-09 Thread Herman ten Brugge via Tinycc-devel
I hope I fixed this now. I attached the wine Makefile I used. Could you update sourceforge? Regards,     Herman On 2019-12-10 08:35, Christian Jullien wrote: Hello Herman, === Compiling with your patch on ARM (32bit) gives this error: test3 ../tcc -B.. -I../include

[Tinycc-devel] 111_conversion.c with bounds checking

2019-12-09 Thread Herman ten Brugge via Tinycc-devel
I still have one small problem with testcase 111_conversion.c The problem is that it fails on i386.c (linux) when compiling with: tcc 111_conversion.c -o 111_conversion -b ./111_conversion I fixed this (and commited it in git) with the following patch in tccgen.c:     if ((p->r2 & V

Re: [Tinycc-devel] bounds checking

2019-12-09 Thread Christian Jullien
Hello Herman, === Compiling with your patch on ARM (32bit) gives this error: test3 ../tcc -B.. -I../include -I.. -I.. -DCONFIG_TRIPLET="\"arm-linux-gnueabihf\"" -DTCC_CPU_VERSION=7 -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT -DTCC_ARM_VFP -run ../tcc.c -B.. -I..

[Tinycc-devel] bounds checking

2019-12-09 Thread Herman ten Brugge via Tinycc-devel
I just committed a large patch that fix a lot of bounds checking problems. I tested the bounds checking code now works on x86_64 and i386 on linux and windows. The test/tests2 directory can now be tested with -b enabled. There are a lot of changes (not complete): - split up bcheck.c from libtc

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hello, On Mon, 9 Dec 2019, Ulrich Schmidt wrote: > Am 09.12.2019 um 16:42 schrieb Michael Matz: > > And here's the crux: define "compiling state related values". Is the > > memory allocator part of that? The token hash table? The sections? > > The symbol table? Do all of those really need to

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Ulrich Schmidt
Am 09.12.2019 um 16:42 schrieb Michael Matz: And here's the crux: define "compiling state related values". Is the memory allocator part of that? The token hash table? The sections? The symbol table? Do all of those really need to become per-state? Do we really need to support multi-threading

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hello, [sorry for the flurry of mails, I probably should have responded once to a set of mails :) ] On Sat, 7 Dec 2019, Ulrich Schmidt wrote: > After reading all your posts. I see there are 2 scenarios/goals in the > comunity. > > scenario 1: > I want a tiny and fast c compiler (tcc/tcc.exe).

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Domingo Alvarez Duarte
Hello ! We can have direct measure using https://github.com/mingodad/tinycc that already does/did the transformation to make tinycc reentrant and maybe revive it. Cheers ! On 9/12/19 16:33, Michael Matz wrote: Hi, On Sat, 7 Dec 2019, Christian Jullien wrote: 2) slower code: most of the t

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hi, On Sat, 7 Dec 2019, Christian Jullien wrote: > > 2) slower code: most of the time the indirection through a pointer >variable (the state) in comparison to a direct access to a static >variable doesn't matter. > > In fact, I experimented the opposite. When moving all global variabl

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hi, On Sat, 7 Dec 2019, Daniel Glöckner wrote: > We need a macro > > #if scenario == 1 > #define PASSPARAM1 > #else > #define PASSPARAM1 s1, > #endif > > Grouping all globals in the TCCState structure might be beneficial > even if we don't switch to those macros, because of the cache locality >

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hi, On Sun, 8 Dec 2019, uso ewin wrote: > I've made a version that should support multi thread on my github > https://github.com/cosmo-ray/tcc/commit/46d0e73edc7e448f0f514936fdb4f62e2c8800a4 > I didn't tests it, it's just here to show the > possibility using _Thread_local. Ulrich doesn't care fo