3 weeks agoMakefile: Add rules to create tags and TAGS.mob
Lee Duhem [Wed, 26 Nov 2014 03:48:07 +0000]
Makefile: Add rules to create tags and TAGS.

3 weeks ago.gitignore: Ignore generated files.
Lee Duhem [Wed, 26 Nov 2014 03:40:14 +0000]
.gitignore: Ignore generated files.

4 weeks agolittle optimization to crt1
Carlos Montiers [Sun, 23 Nov 2014 04:51:38 +0000]
little optimization to crt1

4 weeks ago__getmainargs compatibility checking success
Carlos Montiers [Sat, 22 Nov 2014 22:00:49 +0000]
__getmainargs compatibility checking success

6 weeks agowin32: fix implicit function warning
James Buren [Mon, 3 Nov 2014 22:16:03 +0000]
win32: fix implicit function warning

This includes windows.h to fix a warning about
an implicit function usage of ExitProcess().

2 months agoFilter-out warning about softfloat in tests2
Matteo Cypriani [Thu, 16 Oct 2014 15:17:46 +0000]
Filter-out warning about softfloat in tests2

2 months agotccgen: use lvalue as result from bitfield assignment
grischka [Tue, 23 Sep 2014 10:30:08 +0000]
tccgen: use lvalue as result from bitfield assignment

test case:

    #include <stdio.h>
    int main(int argc, char **argv)
    {
        struct _s { unsigned a:9, b:5, c:7; } _s, *s = &_s;
        int n = 250;
        s->a = s->b = s->c = n + 4;
        printf("--> %d / %d / %d\n", s->a, s->b, s->c);
        return 0;
    }

before:
--> 254 / 30 / 126
now:
--> 30 / 30 / 126

3 months agoAccept CPPFLAGS from the environment
Matteo Cypriani [Sun, 7 Sep 2014 15:57:09 +0000]
Accept CPPFLAGS from the environment

Don't override CPPFLAGS so that it can be passed through the
environment.

(This is a patch Thomas Preud'homme wrote for Debian in February 2013.)

3 months agotccelf: layout_sections: add missing param strsec
Matteo Cypriani [Sun, 7 Sep 2014 15:29:38 +0000]
tccelf: layout_sections: add missing param strsec

This fixes compilation on (k)FreeBSD.

3 months agoClear CFLAGS & LDFLAGS in tests
Matteo Cypriani [Sun, 7 Sep 2014 15:05:58 +0000]
Clear CFLAGS & LDFLAGS in tests

Clear CFLAGS and LDFLAGS to build the tests, in case the main Makefile
passes some flags that aren't handled by tcc (we are not compiling tcc
here, we are using tcc to compile the tests).

3 months agoDon't build libtcc1 with -fstack-protector-strong
Matteo Cypriani [Sun, 7 Sep 2014 14:47:02 +0000]
Don't build libtcc1 with -fstack-protector-strong

Prevent libtcc1.a to be compiled with -fstack-protector-strong, so that
linking with tcc doesn't fail because symbol '__stack_chk_fail_local' is
not present in libtcc1.a. This is useful only if the CFLAGS passed from
the main Makefile contain this flag.

4 months agotccgen: nocode_wanted: do not output constants
grischka [Fri, 1 Aug 2014 08:59:38 +0000]
tccgen: nocode_wanted: do not output constants

This for example suppresses string constants such as with

    int main()
    {
        return sizeof "foo";
    }

Actually, setting

    nocode_wanted = 1;

in libtcc.c for the initial global level seemed wrong, since
obviously "nocode_wanted" means code as any side effects, also
such as string constants.

This reverts a part of 2de1b2d14cc920e2c698ff0086f5558c2da7f569
(documented as "Some in-between fixes" in Changelog)

4 months agowin64: fix resource file support
grischka [Fri, 1 Aug 2014 08:51:28 +0000]
win64: fix resource file support

5 months agoRemoved the error message and minor changes.
Carlos Montiers [Thu, 17 Jul 2014 05:08:47 +0000]
Removed the error message and minor changes.

5 months ago__getmainargs return int, not void, and on error, it return -1 and let argv untouched...
Carlos Montiers [Thu, 17 Jul 2014 02:22:05 +0000]
__getmainargs return int, not void, and on error, it return -1 and let argv untouched, also argc. Added a if checking the result of it.

5 months agoFix mistake. Change jb by jbe. tiny c round (INT_MAX = 0x7FFFFFFF) to a DWORD boundar...
Carlos Montiers [Fri, 11 Jul 2014 00:41:51 +0000]
Fix mistake. Change jb by jbe. tiny c round (INT_MAX = 0x7FFFFFFF) to a DWORD boundary and it becomes 0x80000000. Jle treats as -214783648, but Jbe treats as 214783648. Thanks to Jason Hood for explain me this.

5 months agoFix problem using alloca function, executable crashed even with a exception handler...
Carlos Montiers [Thu, 10 Jul 2014 04:37:20 +0000]
Fix problem using alloca function, executable crashed even with a exception handler function, when try to allocate INT_MAX. Patch provided by Jason Hood in private e-mail, when I ask to him for help. He say: Feel free to pass it on to the mailing list.

5 months agoRename:
jiang [Tue, 1 Jul 2014 15:54:49 +0000]
Rename:
68_macro_concat.c -> 68_macro_param_list_err_1.c
69_macro_concat.c -> 69_macro_param_list_err_2.c
and Remove spaces

5 months agoSpecify license of lib/armeabi.c
Thomas Preud'homme [Tue, 1 Jul 2014 14:01:16 +0000]
Specify license of lib/armeabi.c

5 months agobug:
jiang [Sun, 29 Jun 2014 12:35:57 +0000]
bug:

----------------------------------------------------------------------
#define hexCh(c (c >= 10 ? 'a' + c - 10 : '0' + c)
  hexCh(c);

out:
jiang@jiang:~/test$ ./tcc -E c4.c
# 1 "c4.c"

(c >= 10 ? 'a' + c - 10 : '0' + c);
---------------------------------------------------------------

#define hexCh(c/3) (c >= 10 ? 'a' + c - 10 : '0' + c)
hexCh(c);

out:
jiang@jiang:~/test$ ./tcc -E c4.c
# 1 "c4.c"

/3) (c >= 10 ? 'a' + c - 10 : '0' + c);
jiang@jiang:~/test$

after patch:

# 1 "c4.c"
c4.c:1: error: may not appear in macro parameter list: "("
jiang@jiang:~/test$

jiang@jiang:~/test$ ./tcc -E c4.c
# 1 "c4.c"
c4.c:1: error: may not appear in macro parameter list: "/"
jiang@jiang:~/test$

5 months agoRevert the many un-reviewed commits starting from early April
David Mertens [Wed, 25 Jun 2014 02:16:17 +0000]
Revert the many un-reviewed commits starting from early April

Starting early April, a number of commits were pushed to the mob branch
that did not reflect the interest, wishes, or code quality of the tcc
community. This commit reverts those commits, while cherry-picking
grishka's commit for win64 linkage issues.

5 months agowin64: try to fix linkage
grischka [Thu, 8 May 2014 15:32:29 +0000]
win64: try to fix linkage

- revert to R_X86_64_PC32 for near calls on PE
- revert to s1->section_align set to zero by default

Untested. Compared to release_0_9_26 the pe-image looks back to
normal.  There are some differences in dissassembly (r10/r11 usage)
but maybe that's ok.

6 months agorevert vstore()
jiang [Sun, 22 Jun 2014 17:08:54 +0000]
revert vstore()

6 months agoRevert "Win: Enable use "*.def + *.c" files as library instead of *.a by "-l" option"
Thomas Coudray [Fri, 20 Jun 2014 12:26:29 +0000]
Revert "Win: Enable use "*.def + *.c" files as library instead of *.a by "-l" option"

This reverts commit 7a3f6d49415fd5f1fa99d25aba40c7884d5774a4.

6 months agoWin: Enable use "*.def + *.c" files as library instead of *.a by "-l" option
YX Hao [Mon, 16 Jun 2014 08:00:46 +0000]
Win: Enable use "*.def + *.c" files as library instead of *.a by "-l" option

example: "-lshell32" will try "shell32.def + shell32.c"

Add lib type "%s/%s.c" for tcc_add_library() ('-l' option parse)

So tcc can use all files as scripts.

6 months agoLet init_putz one-time generation.
jiang [Wed, 28 May 2014 14:09:49 +0000]
Let init_putz one-time generation.
At the same time, increase the GCC style warning
---------------------------------------------------------------------------
int main()
{
int a[10] = {[5]=5};
return 0;
}

Disassembly of section .text:

0000000000000000 <main>:
   0: 55                    push   %rbp
   1: 48 89 e5              mov    %rsp,%rbp
   4: 48 81 ec 30 00 00 00  sub    $0x30,%rsp
   b: b8 05 00 00 00        mov    $0x5,%eax
  10: 89 45 ec              mov    %eax,-0x14(%rbp)
  13: 48 b8 14 00 00 00 00  movabs $0x14,%rax
  1a: 00 00 00
  1d: 49 89 c2              mov    %rax,%r10
  20: b8 00 00 00 00        mov    $0x0,%eax
  25: 48 89 c6              mov    %rax,%rsi
  28: 48 8d 45 d8           lea    -0x28(%rbp),%rax
  2c: 48 89 c7              mov    %rax,%rdi
  2f: 4c 89 d2              mov    %r10,%rdx
  32: b8 00 00 00 00        mov    $0x0,%eax
  37: e8 fc ff ff ff        callq  38 <main+0x38>
  3c: 48 b8 10 00 00 00 00  movabs $0x10,%rax
  43: 00 00 00
  46: 49 89 c2              mov    %rax,%r10
  49: b8 00 00 00 00        mov    $0x0,%eax
  4e: 48 89 c6              mov    %rax,%rsi
  51: 48 8d 45 f0           lea    -0x10(%rbp),%rax
  55: 48 89 c7              mov    %rax,%rdi
  58: 4c 89 d2              mov    %r10,%rdx
  5b: b8 00 00 00 00        mov    $0x0,%eax
  60: e8 fc ff ff ff        callq  61 <main+0x61>
  65: b8 00 00 00 00        mov    $0x0,%eax
  6a: e9 00 00 00 00        jmpq   6f <main+0x6f>
  6f: c9                    leaveq
  70: c3                    retq

After the patch

0000000000000000 <main>:
   0: 55                    push   %rbp
   1: 48 89 e5              mov    %rsp,%rbp
   4: 48 81 ec 30 00 00 00  sub    $0x30,%rsp
   b: 48 b8 28 00 00 00 00  movabs $0x28,%rax
  12: 00 00 00
  15: 49 89 c2              mov    %rax,%r10
  18: b8 00 00 00 00        mov    $0x0,%eax
  1d: 48 89 c6              mov    %rax,%rsi
  20: 48 8d 45 d8           lea    -0x28(%rbp),%rax
  24: 48 89 c7              mov    %rax,%rdi
  27: 4c 89 d2              mov    %r10,%rdx
  2a: b8 00 00 00 00        mov    $0x0,%eax
  2f: e8 fc ff ff ff        callq  30 <main+0x30>
  34: b8 05 00 00 00        mov    $0x5,%eax
  39: 89 45 ec              mov    %eax,-0x14(%rbp)
  3c: b8 00 00 00 00        mov    $0x0,%eax
  41: e9 00 00 00 00        jmpq   46 <main+0x46>
  46: c9                    leaveq
  47: c3                    retq
 -----------------------------------------------------------------------------------
"c5.c"
int main()
{
  // union st
   struct st
   {
    char c;
    short s;
   // char cc[];
    };
   // union st
  struct st
    ss = { 1, 2, 3};
   // int a = ss;
    char cb[1] = {1,2,3};
    return 0;
}

c5.c:12: warning: excess elements in struct initializer
c5.c:14: warning: excess elements in array initializer
c5.c:14: warning: excess elements in array initializer

6 months agoConsidering the effect of CH_EOF on line_num
jiang [Wed, 28 May 2014 13:51:50 +0000]
Considering the effect of CH_EOF on line_num

6 months agoModify the 66_macro_concat_end.expect
jiang [Wed, 28 May 2014 02:38:26 +0000]
Modify the 66_macro_concat_end.expect

I was busy recently, forget test. Thank Austin

7 months agoThe number of rows to display warning is wrong
jiang [Fri, 23 May 2014 07:46:08 +0000]
The number of rows to display warning is wrong
For example:
#define TOK_ASM_weak TOK_WEAK1
#define TOK_ASM_weak TOK_WEAK
Output:
C8.c:3: warning: TOK_ASM_weak redefined

7 months agoforget Delete __va_ld_reg
jiang [Wed, 21 May 2014 04:50:12 +0000]
forget Delete __va_ld_reg

7 months agoDelete a = (a > = 0)? A: -a; \
jiang [Tue, 20 May 2014 07:23:55 +0000]
Delete a = (a > = 0)? A: -a; \

7 months agoclean '\t'
jiang [Tue, 20 May 2014 07:18:59 +0000]
clean '\t'

7 months agoIn the local use of local stack, use a global stack in the global time
jiang [Tue, 20 May 2014 06:59:37 +0000]
In the local use of local stack, use a global stack in the global time

7 months agoint main()
jiang [Sat, 17 May 2014 04:32:00 +0000]
int main()
{
struct st {
int aa:16;
int bb:16;
} s;
s.aa = 1;
s.bb = 2;
return 0;
}
objdump -d:
elf64-x86-64
Disassembly of section .text:

0000000000000000 <main>:
   0: 55                    push   %rbp
   1: 48 89 e5              mov    %rsp,%rbp
   4: 48 81 ec 10 00 00 00  sub    $0x10,%rsp
   b: b8 01 00 00 00        mov    $0x1,%eax
  10: 48 89 c1              mov    %rax,%rcx
  13: 81 e1 ff ff 00 00     and    $0xffff,%ecx
  19: 8b 55 fc              mov    -0x4(%rbp),%edx
  1c: 81 e2 00 00 ff ff     and    $0xffff0000,%edx
  22: 09 d1                 or     %edx,%ecx
  24: 89 4d fc              mov    %ecx,-0x4(%rbp)
  27: b8 02 00 00 00        mov    $0x2,%eax
  2c: 48 89 c1              mov    %rax,%rcx
  2f: 81 e1 ff ff 00 00     and    $0xffff,%ecx
  35: c1 e1 10              shl    $0x10,%ecx
  38: 8b 55 fc              mov    -0x4(%rbp),%edx
  3b: 81 e2 ff ff 00 00     and    $0xffff,%edx
  41: 09 d1                 or     %edx,%ecx
  43: 89 4d fc              mov    %ecx,-0x4(%rbp)
  46: b8 00 00 00 00        mov    $0x0,%eax
  4b: e9 00 00 00 00        jmpq   50 <main+0x50>
  50: c9                    leaveq
  51: c3                    retq

After the patch

Disassembly of section .text:

0000000000000000 <main>:
   0: 55                    push   %rbp
   1: 48 89 e5              mov    %rsp,%rbp
   4: 48 81 ec 10 00 00 00  sub    $0x10,%rsp
   b: 8b 45 fc              mov    -0x4(%rbp),%eax
   e: 81 e0 00 00 ff ff     and    $0xffff0000,%eax
  14: 83 c8 01              or     $0x1,%eax
  17: 89 45 fc              mov    %eax,-0x4(%rbp)
  1a: 8b 45 fc              mov    -0x4(%rbp),%eax
  1d: 81 e0 ff ff 00 00     and    $0xffff,%eax
  23: 81 c8 00 00 02 00     or     $0x20000,%eax
  29: 89 45 fc              mov    %eax,-0x4(%rbp)
  2c: b8 00 00 00 00        mov    $0x0,%eax
  31: e9 00 00 00 00        jmpq   36 <main+0x36>
  36: c9                    leaveq
  37: c3                    retq

7 months agoImproved '\ n' output effect (# pragma pack (push, 8), # pragma pack (pop))
jiang [Sat, 17 May 2014 04:06:18 +0000]
Improved '\ n' output effect (# pragma pack (push, 8), # pragma pack (pop))

7 months ago1 macro_push and macro_pop work I made a mistake, no matter the definition does not...
jiang [Fri, 16 May 2014 16:55:02 +0000]
1 macro_push and macro_pop work I made a mistake, no matter the definition does not define can be macro_push.
And the modified tcctest.c test
2, pack: in the compiler under the mode of s1->ppfp, I have no clear ideas1->ppfp
Some advice thank you Roy to me.This patch, I hope I can pass the Roy test

7 months agoadd push_macro test again
jiang [Fri, 16 May 2014 07:44:51 +0000]
add push_macro test again

7 months agofix push_macro, asked Tom to help me testfix push_macro
jiang [Fri, 16 May 2014 04:15:00 +0000]
fix push_macro, asked Tom to help me testfix push_macro

7 months agoWhen tcc.exe update, abitest-tcc.exe not updated. For security, you must first clean up
jiang [Thu, 15 May 2014 04:09:43 +0000]
When tcc.exe update, abitest-tcc.exe not updated. For security, you must first clean up

7 months agoAdd warning 4
jiang [Wed, 14 May 2014 13:01:00 +0000]
Add warning 4

num en{a1,a2,a3};
enum en ee;
ee = 0xffffffffff;
    char a;
    a = 0xffff;

7 months agoAdd warning 3
jiang [Wed, 14 May 2014 12:44:53 +0000]
Add warning 3
struct st {int a;} ss;
int b;
b = ss;

7 months agoclean '\t'
jiang [Wed, 14 May 2014 04:45:58 +0000]
clean '\t'

7 months agorestore 2dd8587c2f32d17a2cd0443a60a614a3fa9bbe29
jiang [Tue, 13 May 2014 14:05:38 +0000]
restore 2dd8587c2f32d17a2cd0443a60a614a3fa9bbe29

7 months agoModify tcc_error ("invalid type",);
jiang [Tue, 13 May 2014 14:00:42 +0000]
Modify tcc_error ("invalid type",);

7 months agofix 14d0aa450f9a926a852ea01fbdecf27425264d14
jiang [Tue, 13 May 2014 13:57:35 +0000]
fix  14d0aa450f9a926a852ea01fbdecf27425264d14

7 months agoAdd warning 2
jiang [Fri, 9 May 2014 14:41:45 +0000]
Add warning 2
For example:
struct A {
int b: 16;
int c: 16
};
sizeof (struct A);

7 months agoAdd warning
jiang [Fri, 9 May 2014 14:35:19 +0000]
Add warning
For example:
struct A {
int b [];
};

7 months agowin64: try to fix linkage
grischka [Thu, 8 May 2014 15:32:29 +0000]
win64: try to fix linkage

- revert to R_X86_64_PC32 for near calls on PE
- revert to s1->section_align set to zero by default

Untested. Compared to release_0_9_26 the pe-image looks back to
normal.  There are some differences in dissassembly (r10/r11 usage)
but maybe that's ok.

7 months agofix bug if (seen_reg_num + reg_count <= 8)
jiang [Thu, 8 May 2014 07:39:50 +0000]
fix bug if (seen_reg_num + reg_count <= 8)

7 months agoRevert "update static void parse_number()"
grischka [Tue, 6 May 2014 16:24:41 +0000]
Revert "update static void parse_number()"

because:
- Constructing fp numbers isn't quite trivial
- 3 additional calls to strchr per number is noticeable slow

Also: exclude abitest.c:ret_longdouble_test2 on _WIN32
for mixed gcc/tcc scenario

test case:
- make -k test (on win32):
  -2.120000 0.500000 23000000000.000000
  +2.120000 0.500000 22999999999.999996
  ...
  ret_longdouble_test2... failure

This reverts 857f7dbfa65179e6690dbee7ab915fb4458cee11
and deaee6c2496ecb25858290405fef8ef79aece979

7 months agoReturn to: e20c1eb99e1003c1e59522c136dbb15c52d7cc7c
jiang [Sun, 4 May 2014 05:18:31 +0000]
Return to: e20c1eb99e1003c1e59522c136dbb15c52d7cc7c
1: The new patch for the other machines still have the problem.
2: libcrt Rename (what if gcc had libcrt as well)
3: parse_number exact problem
4: VT_VLS is to allow tcc
     Compile the following
     int b = 9;
     struct st {
     int a;
     int b [b]
     };
     struct st st1;
     st1.b [8] = 9;
     printf ("% d \ n", st1.b [8]);

     tcc a problem. Due to problems in front, and now can not be improved
5: they commit much, bug difficult to lock, you can not let other people help develop.
6: ('\ t') too

Thanks to Michael and Ray
Their criticism I have benefited!

7 months agotcc on i386 are still having problems at work.Thank Roy report again. Struck on sever...
jiang [Sat, 3 May 2014 15:51:09 +0000]
tcc on i386 are still having problems at work.Thank Roy report again. Struck on several variables can be connected to commit in the register. I am worried whether tcc can run the os. Since my machine is ubuntu 64 bits I can test my machine.

7 months agoforget commit tccge.c for i386
jiang [Fri, 2 May 2014 16:39:40 +0000]
forget commit tccge.c for i386

7 months agoModify i386-gen.c,
jiang [Fri, 2 May 2014 16:33:19 +0000]
Modify i386-gen.c,
Thank Roy Tam reported problems

7 months agoFix x86-64 vla
jiang [Fri, 2 May 2014 15:45:48 +0000]
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

7 months agoFixes include the double quotes bug
jiang [Fri, 2 May 2014 03:23:54 +0000]
Fixes include the double quotes bug
Added push_macro, pop_macro support
Fix pack bug, when output with-E will pack the bug

7 months agogen_putz () and struct_copy (), is to reduce the third-party call that
jiang [Fri, 2 May 2014 01:42:33 +0000]
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

7 months agoAdd a comment.
jiang [Thu, 1 May 2014 16:39:50 +0000]
Add a comment.
ref: 2a8905c93b4f67a21e3dbf297c3e93c598831528
Sorry, I used the wrong command, I did not mean it.
Thank grischka

7 months agoAttention: never use hard tabs other than 8 (eight) wide
grischka [Thu, 1 May 2014 13:33:29 +0000]
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: 2a8905c93b4f67a21e3dbf297c3e93c598831528

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).

7 months agoupdate for x86_64-gen.c
jiang [Thu, 1 May 2014 12:58:43 +0000]
update for x86_64-gen.c

7 months agoclean
jiang [Thu, 1 May 2014 07:19:03 +0000]
clean

7 months agofix its own making bug. Improved init_putz (). Modify the tests / Makefile to make...
jiang [Thu, 1 May 2014 07:15:01 +0000]
fix its own making bug. Improved init_putz (). Modify the tests / Makefile to make the test more secure

7 months agoExpansion code again for x86_64-gen
jiang [Wed, 30 Apr 2014 17:48:50 +0000]
Expansion code again for x86_64-gen

7 months agorename i386-tok.h i386-asm.c, add PRINTF_ASM_CODE
jiang [Wed, 30 Apr 2014 11:30:30 +0000]
rename i386-tok.h i386-asm.c, add PRINTF_ASM_CODE

7 months agorename libtcc1.c
jiang [Wed, 30 Apr 2014 09:35:44 +0000]
rename libtcc1.c

7 months agoFix va_arg bug, Fix type conversion bug, an increase of loc_stack () function is...
jiang [Wed, 30 Apr 2014 07:26:45 +0000]
Fix va_arg bug, Fix type conversion bug, an increase of loc_stack () function is used to manage loc

7 months agoRestore eda2c756edc4dca004ba217d5bf361235dd9de1f
jiang [Wed, 30 Apr 2014 06:24:44 +0000]
Restore eda2c756edc4dca004ba217d5bf361235dd9de1f

7 months agoReduce the generation of machine code for x86_64, Less of size
jiang [Tue, 29 Apr 2014 15:57:22 +0000]
Reduce the generation of machine code for x86_64, Less of size

7 months agoSo that the generated code, and more short
jiang [Tue, 29 Apr 2014 08:05:16 +0000]
So that the generated code, and more short

7 months agoAdd support for load/store of _Bool value
Thomas Preud'homme [Fri, 14 Jun 2013 14:18:16 +0000]
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.

7 months agofix test3 for x86_64-gen.c
jiang [Mon, 28 Apr 2014 11:43:02 +0000]
fix test3 for x86_64-gen.c

7 months agofix abitest.c for x86_64 bug
jiang [Mon, 28 Apr 2014 06:05:55 +0000]
fix abitest.c for x86_64 bug

7 months agofix tccpp.c
jiang [Mon, 28 Apr 2014 04:53:18 +0000]
fix tccpp.c

7 months agoupdate static void parse_number(const char *p) for tccpp.c
jiang [Mon, 28 Apr 2014 04:42:36 +0000]
update static void parse_number(const char *p) for tccpp.c

7 months agoadd test for abitest.c
jiang [Mon, 28 Apr 2014 04:28:56 +0000]
add test for abitest.c

8 months agotccpe: adjust for new 'hidden' symbols feature
grischka [Thu, 17 Apr 2014 15:01:28 +0000]
tccpe: adjust for new 'hidden' symbols feature

in order to avoid conflicts with windows specific (ab)usage
of the Elf32_Sym -> st_other field.

8 months agoImprove efficiency of macro concatenation
Thomas Preud'homme [Mon, 14 Apr 2014 12:45:10 +0000]
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.

8 months agoRemove unused variable
Michael Matz [Mon, 14 Apr 2014 03:41:57 +0000]
Remove unused variable

8 months agox86_64: Handle PLT relocs to hidden symbols
Michael Matz [Mon, 14 Apr 2014 02:58:05 +0000]
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.

8 months agoParse assembler .hidden directive
Michael Matz [Mon, 14 Apr 2014 01:33:50 +0000]
Parse assembler .hidden directive

This makes TCCs assembler understand the '.hidden symbol' directive
(and emits a STV_HIDDEN ELF symbol then).

8 months agoParse and emit hidden visibility
Michael Matz [Mon, 14 Apr 2014 00:53:11 +0000]
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.

8 months agotccpe: speed up .def file loading
grischka [Sun, 13 Apr 2014 18:30:46 +0000]
tccpe: speed up .def file loading

The fgets replacement meant to work with "int fd"
was just too slow.

8 months agotests2: fix and enable 46_grep test.
minux [Sat, 12 Apr 2014 18:04:10 +0000]
tests2: fix and enable 46_grep test.

8 months agotests2: fix 30_hanoi test and enable it.
minux [Sat, 12 Apr 2014 17:37:37 +0000]
tests2: fix 30_hanoi test and enable it.

8 months agoMake build CPU detection a tad more flexible
Thomas Preud'homme [Sat, 12 Apr 2014 08:20:12 +0000]
Make build CPU detection a tad more flexible

8 months agoFix preprocessor concat with empty arg
Thomas Preud'homme [Sat, 12 Apr 2014 04:00:13 +0000]
Fix preprocessor concat with empty arg

8 months agobuild: add initial NetBSD support.
minux [Sat, 12 Apr 2014 05:42:46 +0000]
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")

8 months agobuild: ignore and properly clean tests/vla_test
minux [Sat, 12 Apr 2014 05:10:58 +0000]
build: ignore and properly clean tests/vla_test

8 months agotcc.h: add ELF interpreter for DragonFly BSD.
minux [Sat, 12 Apr 2014 05:10:12 +0000]
tcc.h: add ELF interpreter for DragonFly BSD.

8 months agotccrun: fix build on DragonFly BSD.
minux [Sat, 12 Apr 2014 04:52:20 +0000]
tccrun: fix build on DragonFly BSD.

8 months agowin32/include/process.h: update prototypes to match mingw.
minux [Sat, 12 Apr 2014 04:09:57 +0000]
win32/include/process.h: update prototypes to match mingw.

This eliminates an argument type mismatch warning during tcc
self-compilation on windows.

8 months agotcc, libtcc: fix build on windows with latest mingw.
minux [Sat, 12 Apr 2014 03:49:53 +0000]
tcc, libtcc: fix build on windows with latest mingw.

8 months agotiny_impdef: remove artificial length restriction.
minux [Sat, 12 Apr 2014 03:23:05 +0000]
tiny_impdef: remove artificial length restriction.

8 months agoadd missing prototypes
Urs Janssen [Thu, 10 Apr 2014 09:53:54 +0000]
add missing prototypes

8 months agoPrevent ## to appear at start or end of macro
Thomas Preud'homme [Tue, 8 Apr 2014 14:19:48 +0000]
Prevent ## to appear at start or end of macro

8 months agoAdd new tests for macro nesting
Thomas Preud'homme [Mon, 7 Apr 2014 15:30:57 +0000]
Add new tests for macro nesting

8 months agoFix test for macro nesting
Thomas Preud'homme [Mon, 7 Apr 2014 13:12:08 +0000]
Fix test for macro nesting

8 months agoCorrected spelling mistakes in comments and strings
Vincent Lefevre [Mon, 7 Apr 2014 11:31:00 +0000]
Corrected spelling mistakes in comments and strings

8 months agocorrected a typo
Vincent Lefevre [Mon, 7 Apr 2014 11:20:49 +0000]
corrected a typo

8 months agotests2: cleanup
grischka [Mon, 7 Apr 2014 09:20:45 +0000]
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 e31579b0769e1f9c0947d12e83316d1149307b1a