TODO: Add note on handling of floating-point values.
[tinycc.git] / TODO
blobeb846d920e72184cce9a4f58eadd39c2523e7451
1 TODO list:
3 Bugs:
5 - fix macro substitution with nested definitions (ShangHongzhang)
6 - FPU st(0) is left unclean (kwisatz haderach). Incompatible with
7   optimized gcc/msc code
9 - constructors
10 - cast bug (Peter Wang)
11 - define incomplete type if defined several times (Peter Wang).
12 - test binutils/gcc compile
13 - tci patch + argument.
14 - see -lxxx bug (Michael Charity).
15 - see transparent union pb in /urs/include/sys/socket.h
16 - precise behaviour of typeof with arrays ? (__put_user macro)
17   but should suffice for most cases)
18 - handle '? x, y : z' in unsized variable initialization (',' is
19   considered incorrectly as separator in preparser)
20 - transform functions to function pointers in function parameters
21   (net/ipv4/ip_output.c)
22 - fix function pointer type display
23 - check lcc test suite -> fix bitfield binary operations
24 - check section alignment in C
25 - fix invalid cast in comparison 'if (v == (int8_t)v)'
26 - finish varargs.h support (gcc 3.2 testsuite issue)
27 - fix static functions declared inside block
28 - fix multiple unions init
29 - sizeof, alignof, typeof can still generate code in some cases.
30 - Fix the remaining libtcc memory leaks.
31 - make libtcc fully reentrant (except for the compilation stage itself).
33 Portability:
35 - it is assumed that int is 32-bit and sizeof(int) == 4
36 - int is used when host or target size_t would make more sense
37 - struct CString is written into an int array and ends up misaligned
38 - TCC handles target floating-point (fp) values using the host's fp
39   arithmetic, which is simple and fast but may lead to exceptions
40   and inaccuracy and wrong representations when cross-compiling
42 Linking:
44 - static linking does not work
45 - with "-run" and libtcc, no PLT is used, so branches may be out of
46   range and relocations may fail; as a result libtest fails on arm64; see:
47   https://lists.gnu.org/archive/html/tinycc-devel/2015-03/msg00111.html
49 Bound checking:
51 - '-b' bug.
52 - fix bound exit on RedHat 7.3
53 - setjmp is not supported properly in bound checking.
54 - fix bound check code with '&' on local variables (currently done
55   only for local arrays).
56 - bound checking and float/long long/struct copy code. bound
57   checking and symbol + offset optimization
59 Missing features:
61 - disable-asm and disable-bcheck options
62 - __builtin_expect()
63 - improve '-E' option.
64 - atexit (Nigel Horne)
65 - packed attribute
66 - C99: add complex types (gcc 3.2 testsuite issue)
67 - postfix compound literals (see 20010124-1.c)
69 Optimizations:
71 - suppress specific anonymous symbol handling
72 - more parse optimizations (=even faster compilation)
73 - memory alloc optimizations (=even faster compilation)
74 - optimize VT_LOCAL + const
75 - better local variables handling (needed for other targets)
77 Not critical:
79 - C99: fix multiple compound literals inits in blocks (ISOC99
80   normative example - only relevant when using gotos! -> must add
81   boolean variable to tell if compound literal was already
82   initialized).
83 - add PowerPC or ARM code generator and improve codegen for RISC (need
84   to suppress VT_LOCAL and use a base register instead).
85 - interactive mode / integrated debugger
86 - fix preprocessor symbol redefinition
87 - add portable byte code generator and interpreter for other
88   unsupported architectures.
89 - C++: variable declaration in for, minimal 'class' support.
90 - win32: __intxx. use resolve for bchecked malloc et al.
91   check exception code (exception filter func).
92 - handle void (__attribute__() *ptr)()
93 - VLAs are implemented in a way that is not compatible with signals:
94   http://lists.gnu.org/archive/html/tinycc-devel/2015-11/msg00018.html
96 Fixed (probably):
98 - bug with defines:
99     #define spin_lock(lock) do { } while (0)
100     #define wq_spin_lock spin_lock
101     #define TEST() wq_spin_lock(a)
102 - typedefs can be structure fields
103 - see bugfixes.diff + improvement.diff from Daniel Glockner
104 - long long constant evaluation
105 - add alloca()
106 - gcc '-E' option.
107 - #include_next support for /usr/include/limits ?
108 - function pointers/lvalues in ? : (linux kernel net/core/dev.c)
109 - win32: add __stdcall, check GetModuleHandle for dlls.