[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] VLAs broken on mob branch
From: |
Sergey Korshunoff |
Subject: |
Re: [Tinycc-devel] VLAs broken on mob branch |
Date: |
Mon, 27 Apr 2015 17:58:00 +0300 |
> Let's go for correctness over performance for now and apply change 4?
Let's compare a tcc with all patches added and gcc. A test program
(some modification of your):
#include <stdio.h>
int main(int argc)
{
unsigned long our_sp;
int c = 3;
while (c--) {
char test[argc];
__asm__ ("\t movl %%esp,%0" : "=r"(our_sp));
fprintf(stderr,"1: SP=%p\n", (void *)our_sp);
char test2[argc]; // 2'd VLA
__asm__ ("\t movl %%esp,%0" : "=r"(our_sp));
fprintf(stderr,"2: SP=%p\n", (void *)our_sp);
char test3[argc]; // 3'd VLA
__asm__ ("\t movl %%esp,%0" : "=r"(our_sp));
fprintf(stderr,"3: SP=%p\n", (void *)our_sp);
if(0)
label:
continue;
goto label;
}
}
Output of the gcc program:
1: SP=0xbfc26d40
2: SP=0xbfc26d30
3: SP=0xbfc26d20
1: SP=0xbfc26d40
2: SP=0xbfc26d30
3: SP=0xbfc26d20
1: SP=0xbfc26d40
2: SP=0xbfc26d30
3: SP=0xbfc26d20
Output of the tcc program:
1: SP=0xbfeb1dd0
2: SP=0xbfeb1dc0
3: SP=0xbfeb1db0
1: SP=0xbfeb1dc0
2: SP=0xbfeb1db0
3: SP=0xbfeb1da0
1: SP=0xbfeb1db0
2: SP=0xbfeb1da0
3: SP=0xbfeb1d90
Additional vla_sp_save() is not a solution.
if we add '{' after if(0) then there is no a "boom" even w/o
additional vla_sp_save().
But the output is the same (wrong).
PS: I need to test tcc w/o all new patches.
- Re: [Tinycc-devel] VLAs broken on mob branch, (continued)
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/25
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/25
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/25
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/25
- Re: [Tinycc-devel] VLAs broken on mob branch, Pip Cet, 2015/04/25
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/25
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/26
- Re: [Tinycc-devel] VLAs broken on mob branch, Pip Cet, 2015/04/27
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/27
- Re: [Tinycc-devel] VLAs broken on mob branch, Pip Cet, 2015/04/27
- Re: [Tinycc-devel] VLAs broken on mob branch,
Sergey Korshunoff <=
- Re: [Tinycc-devel] VLAs broken on mob branch, Pip Cet, 2015/04/27
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Pip Cet, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Pip Cet, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Pip Cet, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/28
- Re: [Tinycc-devel] VLAs broken on mob branch, Sergey Korshunoff, 2015/04/29