Commit Graph

2073 Commits

Author SHA1 Message Date
6755b4a3de Modify i386-gen.c,
Thank Roy Tam reported problems
2014-05-03 00:33:19 +08:00
e647c3137d Fix x86-64 vla
For example, it should look like this
High stack
-------------
----- Func_ret_sub
------------
---- Vla stack
-------------
---- Known loc
--------------
Low

Increased loc_stack () function is used for temporary stack management, call save_reg (), released by load ()
Like this
Before use
High
----- Known loc
----
---
----
---- Pop_stack
Low
loc_stack (size, 1)
After use
High
----- Known loc
---- Pop_stack
---
----
----
Low
2014-05-02 23:45:48 +08:00
6c8207633f Fixes include the double quotes bug
Added push_macro, pop_macro support
Fix pack bug, when output with-E will pack the bug
2014-05-02 11:23:54 +08:00
5b52a44b52 gen_putz () and struct_copy (), is to reduce the third-party call that
generates faster code tcc
Now only for x86-64
parse_number also to reduce the reliance on third-party libraries, allowing
faster analysis tcc
2014-05-02 09:42:33 +08:00
ee99fd45ab Add a comment.
ref: 2a8905c93b
Sorry, I used the wrong command, I did not mean it.
Thank grischka
2014-05-02 00:39:50 +08:00
504d40a328 Attention: never use hard tabs other than 8 (eight) wide
The attached fix (libcrt.c) is just one example.  There seem
many more such introduced from latest commits that look badly
formatted in anyone else's editors and should be fixed.

General recommended policy:
- if possible, do not add new hard tabs ('\t') at all.
  Use spaces (soft tabs) instead
- in any case, configure your editor to read/write hard tabs
  with width of 8 (eight)

Also:
- Avoid merge commits (unless for very good reason).  Instead
  use "git cherry-pick" or "git rebase" to put your commits on
  top of the public branch.  ref: 2a8905c93b

Also:
- jiang: please explain what you are doing, in the commit message
  and on the list. Subscribe to the mailing list to receive feedback
  from people for your work.

  For example, what was wrong with 'parse_number'? Show a test
  case and how your version fixes it (it is slower btw).
2014-05-01 15:33:29 +02:00
59a22d59a2 update for x86_64-gen.c 2014-05-01 20:58:43 +08:00
2742fbcf95 clean 2014-05-01 15:19:03 +08:00
87a850f553 fix its own making bug. Improved init_putz (). Modify the tests / Makefile to make the test more secure 2014-05-01 15:15:01 +08:00
9e3713facd Expansion code again for x86_64-gen 2014-05-01 01:48:50 +08:00
2b2e7f85d7 rename i386-tok.h i386-asm.c, add PRINTF_ASM_CODE 2014-04-30 19:30:30 +08:00
ba61fd9cd1 rename libtcc1.c 2014-04-30 17:35:44 +08:00
5af0ea7fb8 Fix va_arg bug, Fix type conversion bug, an increase of loc_stack () function is used to manage loc 2014-04-30 15:26:45 +08:00
9ff288648b Restore eda2c756ed 2014-04-30 14:24:44 +08:00
515169f21b Reduce the generation of machine code for x86_64, Less of size 2014-04-29 23:57:22 +08:00
2a8905c93b So that the generated code, and more short 2014-04-29 16:05:16 +08:00
02e2fe3c26 Add support for load/store of _Bool value
Add support for loading _Bool value in i386, x86_64 and arm as well as
support for storing _Bool value on arm.
2014-04-29 16:01:57 +08:00
e20c1eb99e fix test3 for x86_64-gen.c 2014-04-28 19:43:02 +08:00
89f7aea980 fix abitest.c for x86_64 bug 2014-04-28 14:05:55 +08:00
deaee6c249 fix tccpp.c 2014-04-28 12:53:18 +08:00
857f7dbfa6 update static void parse_number(const char *p) for tccpp.c 2014-04-28 12:42:36 +08:00
4b50557553 add test for abitest.c 2014-04-28 12:28:56 +08:00
2ac238fc50 tccpe: adjust for new 'hidden' symbols feature
in order to avoid conflicts with windows specific (ab)usage
of the Elf32_Sym -> st_other field.
2014-04-17 17:01:28 +02:00
6b7a6fcbc8 Improve efficiency of macro concatenation
As per grischka comment, always output a space after macro concatenation
instead of trying to detect if it's necessary as the current approach
has a huge cost.
2014-04-14 20:49:14 +08:00
356c6f6293 Remove unused variable 2014-04-14 05:41:57 +02:00
e69c506617 x86_64: Handle PLT relocs to hidden symbols
For calls to hidden symbols we don't need a PLT slot, rewrite
the reloc into PC32.
2014-04-14 04:58:05 +02:00
a9fda392a0 Parse assembler .hidden directive
This makes TCCs assembler understand the '.hidden symbol' directive
(and emits a STV_HIDDEN ELF symbol then).
2014-04-14 03:33:50 +02:00
fbda78aefe Parse and emit hidden visibility
This adds parsing of (GCC compatible) visibility attribute
in order to mark selected global symbols as hidden.  The generated
.o files contain hidden symbols already, the TCC linker doesn't
yet do the right thing.
2014-04-14 02:53:11 +02:00
112148172b tccpe: speed up .def file loading
The fgets replacement meant to work with "int fd"
was just too slow.
2014-04-13 20:30:46 +02:00
aa255f37f2 tests2: fix and enable 46_grep test. 2014-04-12 14:04:10 -04:00
0a51386960 tests2: fix 30_hanoi test and enable it. 2014-04-12 13:37:37 -04:00
0e3d2e0bea Make build CPU detection a tad more flexible 2014-04-12 16:20:12 +08:00
6e56bb387d Fix preprocessor concat with empty arg 2014-04-12 16:11:42 +08:00
9714d2e75f build: add initial NetBSD support.
Not able to generate ELF files on NetBSD yet (lacks the note and crt1.o
is actually named crt0.o on NetBSD), but -run works with these extra
defines:
-D__lint__ -D"__symbolrename(x)=asm(#x)" -D__NetBSD__

The -D__lint__ is an ugly hack, TCC should be able to emulate GCC just
fine, but it seems TCC doesn't support __builtin_va_list yet?
	typedef __builtin_va_list __va_list;
/usr/include/sys/ansi.h:72: error: ';' expected (got "__va_list")
2014-04-12 01:42:46 -04:00
469ae3a7e5 build: ignore and properly clean tests/vla_test 2014-04-12 01:10:58 -04:00
b8eb7dd8e8 tcc.h: add ELF interpreter for DragonFly BSD. 2014-04-12 01:10:12 -04:00
8d3e0b3080 tccrun: fix build on DragonFly BSD. 2014-04-12 00:52:20 -04:00
5f7cdd29b6 win32/include/process.h: update prototypes to match mingw.
This eliminates an argument type mismatch warning during tcc
self-compilation on windows.
2014-04-12 00:09:57 -04:00
df0267b287 tcc, libtcc: fix build on windows with latest mingw. 2014-04-11 23:49:53 -04:00
bba1c381f4 tiny_impdef: remove artificial length restriction. 2014-04-11 23:23:05 -04:00
822f4630e3 add missing prototypes 2014-04-10 11:53:54 +02:00
a715d7143d Prevent ## to appear at start or end of macro 2014-04-08 22:19:48 +08:00
91d4db600b Add new tests for macro nesting 2014-04-07 23:30:57 +08:00
c2422ba87f Fix test for macro nesting 2014-04-07 21:16:04 +08:00
3e9a7e9d69 Corrected spelling mistakes in comments and strings 2014-04-07 13:31:00 +02:00
d09a46d655 corrected a typo 2014-04-07 13:20:49 +02:00
f90bad0925 tests2: cleanup
- remove -norunsrc switch
  Meaning and usage (-run -norun...???) look sort of screwed.  Also
  general usefulness is unclear, so it was actually to support exactly
  one (not even very interesting) test

This partially reverts e31579b076
2014-04-07 11:20:45 +02:00
76accfb8d5 win32: libtcc1.a needs to be built with tcc
gcc/mingw produces msvc compatible pecoff objects, tcc only
knows ELF.
2014-04-07 11:16:06 +02:00
f01373765b stdbool.h: Make conformant to ISOC99
For conformance to ISO C the stdbool.h header has to provide
the macro __bool_true_false_are_defined (defined to 1).  Yep,
that name is really in the standard.
2014-04-07 00:30:31 +02:00
0961a38493 Declare wint_t in <stddef.h> when needed
Some old glibcs <wctype.h> require <stddef.h> to provide
wint_t, accomodate them.
2014-04-07 00:27:46 +02:00