<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinycc/tcctok.h, branch main</title>
<subtitle>Tiny C Compiler by Fabrice Bellard Git mirror of the final release by Bellard, discarding all changes after. The repository at https://repo.or.cz/tinycc.git has become untrustworthy. Also the tcc sources have become tainted with AI slop.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/'/>
<entry>
<title>various stuff</title>
<updated>2017-10-11T16:13:43+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-10-11T16:13:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=da8c62f75d893449e232944fc62566c020b4d010'/>
<id>da8c62f75d893449e232944fc62566c020b4d010</id>
<content type='text'>
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure &amp;&amp; make can be used with either
  cygwin's "GCC for Win32 Toolchain"
      ./configure --cross-prefix=i686-w64-mingw32-
  or with an existing tcc:
      ./configure --cc=&lt;old-tccdir&gt;/tcc.exe

tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)

tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)

tests:
- remove -I "expr" diff option to allow tests with
  busybox-diff.

libtcc.c, tcc.c:
- removed -iwithprefix option.  It is supposed to be
  combined with -iprefix which we don't have either.

tccgen.c:
- fix assignments and return of 'void', as in
     void f() {
         void *p, *q;
         *p = *q:
         return *p;
     }
  This appears to be allowed but should do nothing.

tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
  This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.

  The patch was giving tcc's system includes priority over -I which
  is not how it should be.

tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
  used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
  (weak) symbols

tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
  (it was so once except the RX mapping wasn't used at all).

tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.

tccasm.c:
- keep forward asm labels static, otherwise they will endup
  in dynsym eventually.

configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
      make XTCC=&lt;tcc program to use&gt;
- use $(wildcard ...) for install to allow installing just
  a cross compiler for example
      make cross-arm
      make install
- use name &lt;target&gt;-libtcc1.a

build-tcc.bat:
- add  options: -clean, -b bindir
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure &amp;&amp; make can be used with either
  cygwin's "GCC for Win32 Toolchain"
      ./configure --cross-prefix=i686-w64-mingw32-
  or with an existing tcc:
      ./configure --cc=&lt;old-tccdir&gt;/tcc.exe

tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)

tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)

tests:
- remove -I "expr" diff option to allow tests with
  busybox-diff.

libtcc.c, tcc.c:
- removed -iwithprefix option.  It is supposed to be
  combined with -iprefix which we don't have either.

tccgen.c:
- fix assignments and return of 'void', as in
     void f() {
         void *p, *q;
         *p = *q:
         return *p;
     }
  This appears to be allowed but should do nothing.

tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
  This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.

  The patch was giving tcc's system includes priority over -I which
  is not how it should be.

tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
  used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
  (weak) symbols

tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
  (it was so once except the RX mapping wasn't used at all).

tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.

tccasm.c:
- keep forward asm labels static, otherwise they will endup
  in dynsym eventually.

configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
      make XTCC=&lt;tcc program to use&gt;
- use $(wildcard ...) for install to allow installing just
  a cross compiler for example
      make cross-arm
      make install
- use name &lt;target&gt;-libtcc1.a

build-tcc.bat:
- add  options: -clean, -b bindir
</pre>
</div>
</content>
</entry>
<entry>
<title>#pragma comment(option,"-..."), bitfields test, etc...</title>
<updated>2017-07-14T17:26:01+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-07-14T17:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=69a137ff889f552b3ce58b861f3f0601c1818d6b'/>
<id>69a137ff889f552b3ce58b861f3f0601c1818d6b</id>
<content type='text'>
tccpp.c:
* #pragma comment(option,"-some-option")
  to set commandline option from C code.  May work only
  for some options.
libtcc.c:
* option "-d1..9": sets a 'g_debug' global variable.
  (for development)
tests2/Makefile:
* new make targets: tests2.37 / tests2.37+
  run single test from tests2,  optionally update .expect
* new variable GEN-ALWAYS to always generate certain .expects
* bitfields test
tccgen.c:
* bitfields: fix a bug and improve slightly more
* _Generic: ignore "type match twice"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tccpp.c:
* #pragma comment(option,"-some-option")
  to set commandline option from C code.  May work only
  for some options.
libtcc.c:
* option "-d1..9": sets a 'g_debug' global variable.
  (for development)
tests2/Makefile:
* new make targets: tests2.37 / tests2.37+
  run single test from tests2,  optionally update .expect
* new variable GEN-ALWAYS to always generate certain .expects
* bitfields test
tccgen.c:
* bitfields: fix a bug and improve slightly more
* _Generic: ignore "type match twice"
</pre>
</div>
</content>
</entry>
<entry>
<title>tccpp: Implement __COUNTER__</title>
<updated>2017-07-09T03:30:47+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2017-07-09T03:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=824dcebe59f52a686b003214c1af0633cf5fe89e'/>
<id>824dcebe59f52a686b003214c1af0633cf5fe89e</id>
<content type='text'>
This requires one more change in how macro arguments are expanded:
the standard requires that macro args are expanded before substituting
into the replacement list.  This implies expanding them only once
even when they occur multiple times in the list.  TCC expanded
them repeatedly in that case.  Without __COUNTER__ that's harmless.

So, simply always expand arguments (when used without # and ##) once
and store the resulting tokens.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This requires one more change in how macro arguments are expanded:
the standard requires that macro args are expanded before substituting
into the replacement list.  This implies expanding them only once
even when they occur multiple times in the list.  TCC expanded
them repeatedly in that case.  Without __COUNTER__ that's harmless.

So, simply always expand arguments (when used without # and ##) once
and store the resulting tokens.
</pre>
</div>
</content>
</entry>
<entry>
<title>add C11's _Generic</title>
<updated>2017-07-05T08:57:50+00:00</updated>
<author>
<name>Matthias Gatto</name>
<email>uso.cosmo.ray@gmail.com</email>
</author>
<published>2016-12-09T10:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=157bad52cdb052015f64a29e47099b2470f67c3e'/>
<id>157bad52cdb052015f64a29e47099b2470f67c3e</id>
<content type='text'>
Simple implementation, I'm not even sure to respect C standart here,
but it should work with most use case.

This add an case in unary(), and generate TokString depending of _Generic
controlling exression, use begin_macro to "push"
the generated TokString, then call unary() again before exiting the switch
so the just add token are reevaluate again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simple implementation, I'm not even sure to respect C standart here,
but it should work with most use case.

This add an case in unary(), and generate TokString depending of _Generic
controlling exression, use begin_macro to "push"
the generated TokString, then call unary() again before exiting the switch
so the just add token are reevaluate again.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "partial revert of the commit 4ad186c5ef61"</title>
<updated>2017-02-05T13:30:19+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2016-10-14T09:23:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=3b84e61eaddb068707a7a3d40a9ebd5e69975965'/>
<id>3b84e61eaddb068707a7a3d40a9ebd5e69975965</id>
<content type='text'>
There seems nothing wrong.  With

    int t1 = 176401255;
    float f = 0.25;
    int t2 = t1 * f; // 176401255 * 0.25 = 44100313.75

according to the arithmetic conversion rules, the number
176401255 needs to be converted to float, and the compiler
can choose either the nearest higher or nearest lower
representable number "in an implementation-defined manner".

Which may be 176401248 or 176401264.  So as result both
44100312 and 44100313 are correct.

This reverts commit 664c19ad5ef16f3463087a33ecfe5d5ac24f81ec.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There seems nothing wrong.  With

    int t1 = 176401255;
    float f = 0.25;
    int t2 = t1 * f; // 176401255 * 0.25 = 44100313.75

according to the arithmetic conversion rules, the number
176401255 needs to be converted to float, and the compiler
can choose either the nearest higher or nearest lower
representable number "in an implementation-defined manner".

Which may be 176401248 or 176401264.  So as result both
44100312 and 44100313 are correct.

This reverts commit 664c19ad5ef16f3463087a33ecfe5d5ac24f81ec.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccasm: Implement .set sym, expr</title>
<updated>2016-12-15T16:47:10+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2016-08-07T02:27:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=c4edfb4e0804aa005ee9e199420a17828076120a'/>
<id>c4edfb4e0804aa005ee9e199420a17828076120a</id>
<content type='text'>
That, as well as "sym = expr", if expr contains symbols.
Slightly tricky because a definition from .set is overridable,
whereas proper definitions aren't.

This doesn't yet allow using this for override tricks from C
and global asm blocks because the symbol tables from C and asm
are separate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
That, as well as "sym = expr", if expr contains symbols.
Slightly tricky because a definition from .set is overridable,
whereas proper definitions aren't.

This doesn't yet allow using this for override tricks from C
and global asm blocks because the symbol tables from C and asm
are separate.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement __builtin_choose_expr</title>
<updated>2016-12-15T16:47:08+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2016-07-13T13:11:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=8a1a2a60336264a5f96fae4c7f02424c6928b7c3'/>
<id>8a1a2a60336264a5f96fae4c7f02424c6928b7c3</id>
<content type='text'>
Follows GCC implementation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follows GCC implementation.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccasm: Accept .balign</title>
<updated>2016-12-15T16:47:07+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2016-06-29T15:22:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=63e3ff7cca5437518f540261b34170ce80a47686'/>
<id>63e3ff7cca5437518f540261b34170ce80a47686</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tccasm: Implement .pushsection and .popsection</title>
<updated>2016-12-15T16:47:06+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2016-06-28T13:11:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=c82e52d55bd31eea943c616ad780f27e5ab9dc7a'/>
<id>c82e52d55bd31eea943c616ad780f27e5ab9dc7a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/libtcc1.c: cleanup</title>
<updated>2016-10-19T17:21:36+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2016-10-19T17:15:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=02642bc94cb65a59a9eb95b8214bf66960ecde6e'/>
<id>02642bc94cb65a59a9eb95b8214bf66960ecde6e</id>
<content type='text'>
- remove #include dependencies from libtcc1.c
  for easier cross compilation
- clear_cache only on ARM
- error-message for mprotect failure
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- remove #include dependencies from libtcc1.c
  for easier cross compilation
- clear_cache only on ARM
- error-message for mprotect failure
</pre>
</div>
</content>
</entry>
</feed>
