Commit Graph

2645 Commits

Author SHA1 Message Date
grischka
69fdb57edd unions: initzialize only one field
struct {
      union {
        int a,b;
      };
      int c;
    } sss = { 1,2 };

This had previously assigned 1,2 to a,b and 0 to c which is wrong.
2009-06-17 02:09:07 +02:00
grischka
bba515afe5 tccelf: accept BSS symbol with same name from other module
... such as 'int baz;' in two files at the same time
2009-06-17 02:08:54 +02:00
Sam Watkins
e7297581fc pass constness from structs to members 2009-06-16 04:26:44 +08:00
Shinichiro Hamaji
dca2b15df4 x86-64: Align return value of alloca by 16. 2009-06-11 08:33:41 +09:00
Shinichiro Hamaji
8ea8305199 x86-64: Add alloca. 2009-06-09 03:23:08 +09:00
grischka
110a4edc15 drop alloca #define
(Because GNU's alloca.h unconditionally #undef's alloca)

Also, remove gcc specific sections in headers. and
instead change tests such that gcc does not use them.
2009-05-16 22:30:13 +02:00
grischka
68310299b6 ulibc: #define TCC_UCLIBC and load elf_interp 2009-05-16 22:29:40 +02:00
grischka
bf8d8f5f3e update Changelog, bump version: 0.9.25 2009-05-11 19:01:26 +02:00
grischka
aed6a7cb60 fix "cached include" optimization
comparing the filenames as in the #include statement can be
ambiguous if including files are in different directories.

Now caches and checks the really opened filename instead.
2009-05-11 18:55:16 +02:00
Daniel Glöckner
530b77e365 ARM: fix big immediate offset construction
The loop constructs to iterate over the non-overlapping, even
positions of two or three bytes in a word were broken.

This patch fixes the loops. It has been verified to generate the
72 combinations for two and the 80 combinations for three bytes.
2009-05-11 18:54:14 +02:00
grischka
ca4b4a52ad fix build with msvc 2009-05-11 18:53:52 +02:00
grischka
03c787d6ce fix unused/uninitalized warnings 2009-05-11 18:46:39 +02:00
grischka
40f5ce002e fix warnings with tcc_add/get_symbol 2009-05-11 18:46:25 +02:00
grischka
67aebdd5b7 enable making tcc using libtcc 2009-05-11 18:46:02 +02:00
grischka
0a35f9d66e move static prototypes to libtcc.c 2009-05-11 18:45:56 +02:00
grischka
f9181416f6 move some global variables into TCCState 2009-05-11 18:45:44 +02:00
grischka
5c6509578e make tcc from tcc.c and libtcc from libtcc.c 2009-05-05 20:41:17 +02:00
grischka
b8f6e1ae30 move minor things from libtcc.c to other files 2009-05-05 20:30:39 +02:00
grischka
92204e8818 move global variables to libtcc.c 2009-05-05 20:30:13 +02:00
grischka
9dc9cbf319 move libtcc interface and helper functions to libtcc.c 2009-05-05 20:18:53 +02:00
grischka
0d1ed74102 move parser/generator to tccgen.c 2009-05-05 20:18:10 +02:00
grischka
805990b94e move preprocessor to tccpp.c 2009-05-05 20:17:49 +02:00
grischka
ae37bd5abc move declarations to tcc.h 2009-05-05 20:17:26 +02:00
grischka
a93bcdffae new files: tcc.h libtcc.c tccpp.c tccgen.c 2009-05-05 20:17:11 +02:00
grischka
15626621fb cleanup makefiles 2009-04-19 21:24:32 +02:00
grischka
e9e89ad699 enable backtrace only when it's supported 2009-04-18 18:39:27 +02:00
Shinichiro Hamaji
859da934e0 Return value of exit should be void. 2009-04-18 23:55:51 +09:00
Shinichiro Hamaji
48ae0c0468 Fixes for tests/Makefile.
- On x86-64, we need $(TARGET) in RUN_TCC.
- s/RuN_TCC/RUN_TCC/
2009-04-18 23:53:25 +09:00
grischka
5829791ffa fix makefiles etc for subdirs 2009-04-18 15:08:03 +02:00
grischka
ea5e81bd6a new subdirs: include, lib, tests 2009-04-18 15:08:03 +02:00
grischka
e8a52a8249 win32: readme.txt->tcc-win32.txt, update tcc-doc 2009-04-18 15:08:03 +02:00
grischka
eca1fbaf92 mute strange difference in tcctest 2009-04-18 15:08:03 +02:00
grischka
b56f956247 libtcc: add support to be build as DLL 2009-04-18 15:08:03 +02:00
grischka
d165e87340 libtcc: new api tcc_set_lib_path 2009-04-18 15:08:03 +02:00
grischka
73ba078d2f tcc_relocate: return error and remove unused code 2009-04-18 15:08:03 +02:00
Shinichiro Hamaji
d36fea34e3 Call relocate_sym() before we return the offset, so user doesn't need to check the return value twice. 2009-04-18 15:08:03 +02:00
grischka
dd5630ff95 tcc -E: fix pasting empty tokens
/* test case */
#define t(x,y,z) x ## y ## z
int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,),
        t(10,,), t(,11,), t(,,12), t(,,) };

tcc -E: xpected result:
int j[] = { 123, 45, 67, 89,
 10, 11, 12, };
2009-04-18 15:08:02 +02:00
grischka
0f0ed4a8bf tcc -E: preserve spaces, alternative solution
/* test case */
#define STR(x) #x
#define MKSTR(x) STR(x)
MKSTR(-A-)
MKSTR(+ B +)

tcc -E: expected result:
"-A-"
"+ B +"
2009-04-18 15:08:02 +02:00
grischka
90697c4c56 CONFIG_TCC_STATIC: add dummy for dlclose 2009-04-18 15:08:02 +02:00
grischka
d62301b050 avoid warning uninitialized 2009-04-18 15:08:02 +02:00
Shinichiro Hamaji
9a7173bf69 x86-64: Fix tcc -run. We need extra memory for PLT and GOT.
Size of the extra buffer is too large for now.
2009-04-18 15:08:02 +02:00
grischka
e6ba81b012 get rid of 8 bytes memory leak 2009-04-18 15:08:02 +02:00
grischka
b1697be691 change tcc_add/get_symbol to use void* 2009-04-18 15:08:02 +02:00
grischka
795f67428e alternative int tcc_relocate(TCCState *s1, void *ptr); 2009-04-18 15:08:02 +02:00
grischka
9a8b2912ed TOK_builtin_malloc: alternative solution 2009-04-18 15:08:02 +02:00
Shinichiro Hamaji
742cf05875 x86-64: Define make variable TARGET so that test2 and test3 use correct flag. 2009-04-18 15:08:02 +02:00
Shinichiro Hamaji
85d016b507 x86-64: Remove code for debug print.
Now, we concat buffers before relocation. So this only happens when users try creating >2GB binary.
2009-04-18 15:08:02 +02:00
Shinichiro Hamaji
39a4b859d4 x86-64: Fix cast from integers to pointers.
Now,

./tcc -run -DTCC_TARGET_X86_64 tcc.c -run tcctest.c

works!
2009-04-18 15:08:02 +02:00
Shinichiro Hamaji
51a7f163ad Work around for the issue TCC doesn't handle -2147483648 properly.
TCC produces code which is incompatible with GCC for the following code:

    printf("%lld\n", (long long)-2147483648);
    printf("%lld\n", (long long)-2147483649);

For now, just avoid using the corner value.
2009-04-18 15:08:01 +02:00
Shinichiro Hamaji
83fd36333a Fixes for issues I've just found/introduced to x86 TCC.
- Cast from pointer to long long makes TCC output an error. Use cast to int before we apply shift operation for a pointer value.
- Removed test cases for casts from pointer to char/short because they produce warning.
2009-04-18 15:08:01 +02:00