tinycc-devel
[Top][All Lists]
Advanced

[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: Tue, 28 Apr 2015 09:52:20 +0300

Hi, Philip! A nice work :-)

> PS: patch 4 can be wrong for the case of the multiple VLA declaration
> As I understand, SP will be saved only after vla1.

Let's continue. Testing a current mob tcc with 1..4 patches added.
A test program:

void test2()
{
  unsigned long our_sp;
  int count = 10;
  void *addr[count];
  void *addr2[count];
  void *addr3[count];

    __asm__ ("\t movl %%esp,%0" : "=m"(our_sp));
    fprintf(stderr,"1: SP=%p\n", (void *)our_sp);

  for(;count--;) {
    int a[f()];

    addr[count] = a;

    continue;
  }

    __asm__ ("\t movl %%esp,%0" : "=m"(our_sp));
    fprintf(stderr,"2: SP=%p\n", (void *)our_sp);

  if(addr[9] == addr[0]) {
    printf("OK\n");
  } else {
    printf("NOT OK\n");
  }
}

A test compiled by gcc:
1: SP=0xbf896260
2: SP=0xbf896260
OK

A test compiled by tcc:
1: SP=0xbff62dc0
2: SP=0xbff62e20
OK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]