Re: [Tinycc-devel] [PATCH] tcc: remove buggy nodata_wanted optimization

2018-03-12 Thread Mikulas Patocka
On Fri, 23 Feb 2018, Michael Matz wrote: > Hi, > > On Thu, 22 Feb 2018, Mikulas Patocka wrote: > > > I think that that nodata_wanted misoptimization should be removed at all > > - in the C language, you can jump to any location in the function with > > goto or switch-case statement - thus

Re: [Tinycc-devel] [PATCH] tcc: remove buggy nodata_wanted optimization

2018-02-23 Thread Michael Matz
Hi, On Thu, 22 Feb 2018, grischka wrote: However NODATA_WANTED does more than that, for example it also suppresses the "hello" with if (0) puts("hello"); Therefor I'd suggest a less radical change, such as: @@ -6916,7 +6916,7 @@ static void decl_initializer_alloc(CType *type,

Re: [Tinycc-devel] [PATCH] tcc: remove buggy nodata_wanted optimization

2018-02-23 Thread Michael Matz
Hi, On Thu, 22 Feb 2018, Mikulas Patocka wrote: > I think that that nodata_wanted misoptimization should be removed at all > - in the C language, you can jump to any location in the function with > goto or switch-case statement - thus reasoning such as "all the > variables behind if (0) are

Re: [Tinycc-devel] [PATCH] tcc: remove buggy nodata_wanted optimization

2018-02-22 Thread grischka
Mikulas Patocka wrote: Hi The commit 7f1ab9b1e111b9ea9261eec4b7c6fb0f42591eef ("tccgen: nodata_wanted") breaks tcc, it generates incorrect code where different local variables are aliasing each other. It can be tested with this program, if you compile it with broken tcc, it prints "2".