[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] [BUG] x86_64-tcc compiled by i386-tcc is wrong
From: |
Sergey Korshunoff |
Subject: |
[Tinycc-devel] [BUG] x86_64-tcc compiled by i386-tcc is wrong |
Date: |
Fri, 20 Mar 2015 16:41:04 +0300 |
A x86_64-tcc compiler compiled by i386-tcc is wrong.
./configure --enable-cross --cc=x86_64-tcc
make; make install; x86_64-tcc 009-test.c; a.out
0x6006c0 0x6006bc
./configure --enable-cross --cc=i386-tcc
make; make install; x86_64-tcc 009-test.c; a.out
0x6006c0 0x1006006bc
PS: 009-test.c is the test program described in the another thread
/* Tickle a bug in TinyC on 64-bit systems:
* the LSB of the top word or ARGP gets set
* for no obvious reason.
*
* Source: a legacy language interpreter which
* has a little stack / stack pointer for arguments.
*
* Output is: 0x8049620 0x10804961c
* Should be: 0x8049620 0x804961c
*/
#include <stdio.h>
#define NARGS 20000
int ARG[NARGS];
int *ARGSPACE = ARG;
int *ARGP = ARG - 1;
main()
{
printf("%p %p\n", ARGSPACE, ARGP);
}
- [Tinycc-devel] [BUG] x86_64-tcc compiled by i386-tcc is wrong,
Sergey Korshunoff <=