Also:
- A few bugfixes in virtualmips
- Compile Smaller C (smlrc) using MIPS16e
(this frees up ~20KB of space for smlrc improvements)
TBD:
- MIPS16e disassembler in virtualmips
Delete device names from all the drivers.
Move device inslude files from include/sys to include/machine directory.
Only include files which have something useful for user layer
(like special ioctls codes) should be placed into sys.
All architectures:
- "return" statement at function's end doesn't jump to immediately
following epilog anymore
- zero and non-zero constants are recognized in conditional
expressions of "if", "do/while" and "for" statements, no code
generated to evaluate these constant conditions and related
unnecessary jumps aren't generated anymore either
- in "for (clause-1; expr-2; expr-3) body", "expr-3" and "body" are
now reordered to the more natural code flow "body expr-3", thereby
getting rid of unnecessary jumps
MIPS code generator:
- function prologue/epilogue shortened further
- RA is not explicitly saved/restored in leaf functions
- assignment of 0 (e.g. "int a = 0;") is done from register 0
directly, avoiding a load of a constant
- Update license text (remove irrelevant FreeBSD references)
- Update root readme.txt
- Improve prologue/epilogue generation
Don't generate unnecessary jumps back and forth to/from
"sub sp, size_of_locals".
Instead, with the help of fgetpos()/fsetpos()
initially write ";sub sp, 0" and then, when
the size is finally known, go back and overwrite it with
" sub sp, size_of_locals".
gcc 5.0 defaults to -std=gnu11 meaning code which relies on implicit
ints will no longer compile. Passing -std=gnu89 restores the default
but causes problems because the system headers are written in gnu11.
Using -idirafter instead of -nostdinc resolves all problems and should
be compatible with old GCC versions (and clang).
- type specifiers may occur in any order
(e.g. "unsigned short int" and "int short unsigned")
- use .rodata/.rdata section for string literals
- arbitrary length string literals (hooray!)
- better concatenation of adjacent string literals
(now works even across preprocessor directives)
Support .bss section
- -nobss option in smlrc: use .data instead of .bss as before
- take advantage of .bss in smlrc (put a large array into it)
Remove dead/useless code
Remove useless/rarely used features/options:
-use-gp (MIPS)
-flat16/-flat32 (x86)
-seg16t (x86), -seg16 is now the default
-ctor-fxn
Add/change:
- use EXIT_FAILURE=1 instead of -1 in smlrc when aborting
due to an error
- properly sign-/zero-extend returned values, e.g. the following
function must return 255 and not -1:
unsigned char f(void) { return -1; }
- properly decay arrays on the left side of ->, e.g. the following must
compile:
{
struct {char c;} s[1];
s[0].c = 'a'; putchar(s[0].c);
(s+0)->c = 'b'; putchar(s[0].c);
(*s).c = 'c'; putchar(s[0].c);
s->c = 'd'; putchar(s[0].c);
putchar('\n');
}
Also:
- support structure passing/returning by value (x86 only)