<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinycc/i386-gen.c, 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>Spelling fixes</title>
<updated>2017-09-25T01:03:26+00:00</updated>
<author>
<name>Larry Doolittle</name>
<email>ldoolitt@recycle.lbl.gov</email>
</author>
<published>2017-09-25T01:03:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=1b6806e5bb39623c75b4aa8d8d6ffe1ef7ea46e7'/>
<id>1b6806e5bb39623c75b4aa8d8d6ffe1ef7ea46e7</id>
<content type='text'>
Comments only, no change to functionality
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Comments only, no change to functionality
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix calling function pointers casted from intergers in DLL</title>
<updated>2017-09-09T13:11:56+00:00</updated>
<author>
<name>Zhang Boyang</name>
<email>zhangboyang.id@gmail.com</email>
</author>
<published>2017-09-09T13:11:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=b39810ff7820665f1780a3dff99420b5061e02c4'/>
<id>b39810ff7820665f1780a3dff99420b5061e02c4</id>
<content type='text'>
The code generated for "((void (*)(void))0x12345678)()" will be a single "CALL 0x12345678" in previous code.
However, this will not work for DLLs, because "CALL imm" is PC related, DLL relocation will break the code.
This commit fixed the problem by forcing TCC generates indirect CALLs in this situation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code generated for "((void (*)(void))0x12345678)()" will be a single "CALL 0x12345678" in previous code.
However, this will not work for DLLs, because "CALL imm" is PC related, DLL relocation will break the code.
This commit fixed the problem by forcing TCC generates indirect CALLs in this situation.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix AL/AX is not extended to EAX when calling indirectly</title>
<updated>2017-09-09T13:01:42+00:00</updated>
<author>
<name>Zhang Boyang</name>
<email>zhangboyang.id@gmail.com</email>
</author>
<published>2017-09-09T13:01:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=02370acdc9967255cd06a928499fd1981356595e'/>
<id>02370acdc9967255cd06a928499fd1981356595e</id>
<content type='text'>
AL/AX should be extended to EAX when calling functions. However, the previous code did this only for direct calls, indirect calls were ignored.
New code also avoid redundant code when generating JMP instruction. (i.e. expanding code should be generated with CALL instruction only)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
AL/AX should be extended to EAX when calling functions. However, the previous code did this only for direct calls, indirect calls were ignored.
New code also avoid redundant code when generating JMP instruction. (i.e. expanding code should be generated with CALL instruction only)
</pre>
</div>
</content>
</entry>
<entry>
<title>called function should pop the arguments when using fastcall</title>
<updated>2017-08-21T11:38:11+00:00</updated>
<author>
<name>Zhang Boyang</name>
<email>zhangboyang.id@gmail.com</email>
</author>
<published>2017-08-21T11:38:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=b8fe8fc2105455eb5004be89fa8575aa928a18f3'/>
<id>b8fe8fc2105455eb5004be89fa8575aa928a18f3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor sym &amp; attributes</title>
<updated>2017-07-09T10:34:11+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-07-09T10:34:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=9ba76ac834608f76b734674048a7cc4334051e32'/>
<id>9ba76ac834608f76b734674048a7cc4334051e32</id>
<content type='text'>
tcc.h:
* cleanup struct 'Sym'
* include some 'Attributes' into 'Sym'
* in turn get rid of VT_IM/EXPORT, VT_WEAK
* re-number VT_XXX flags
* replace some 'long' function args by 'int'

tccgen.c:
* refactor parse_btype()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tcc.h:
* cleanup struct 'Sym'
* include some 'Attributes' into 'Sym'
* in turn get rid of VT_IM/EXPORT, VT_WEAK
* re-number VT_XXX flags
* replace some 'long' function args by 'int'

tccgen.c:
* refactor parse_btype()
</pre>
</div>
</content>
</entry>
<entry>
<title>unsorted adjustments</title>
<updated>2017-07-09T10:07:40+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-07-09T10:07:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5'/>
<id>9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5</id>
<content type='text'>
- configure
  * use aarch64 instead of arm64

- Makefile
  * rename the custom include file to "config-extra.mak"
  * Also avoid "rm -r /*" if $(tccdir) is empty

- pp/Makefile
  * fix .expect generation with gcc

- tcc.h
  * cleanup #defines for _MSC_VER

- tccgen.c:
  * fix const-propagation for &amp;,|
  * fix anonymous named struct (ms-extension) and enable
    -fms-extension by default

- i386-gen.c
  * clear VT_DEFSIGN

- x86_64-gen.c/win64:
  * fix passing structs in registers
  * fix alloca (need to keep "func_scratch" below each alloca area on stack)
    (This allows to compile a working gnu-make on win64)

- tccpp.c
  * alternative approach to 37999a4fbf3487b363fd0c2f9b7ab622401b202a
    This is to avoid some slowdown with ## token pasting.
  * get_tok_str() : return &lt;eof&gt; for TOK_EOF
  * -funsigned-char: apply to "string" literals as well

- tccpe/tools.c: -impdef: support both 32 and 64 bit dlls anyway
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- configure
  * use aarch64 instead of arm64

- Makefile
  * rename the custom include file to "config-extra.mak"
  * Also avoid "rm -r /*" if $(tccdir) is empty

- pp/Makefile
  * fix .expect generation with gcc

- tcc.h
  * cleanup #defines for _MSC_VER

- tccgen.c:
  * fix const-propagation for &amp;,|
  * fix anonymous named struct (ms-extension) and enable
    -fms-extension by default

- i386-gen.c
  * clear VT_DEFSIGN

- x86_64-gen.c/win64:
  * fix passing structs in registers
  * fix alloca (need to keep "func_scratch" below each alloca area on stack)
    (This allows to compile a working gnu-make on win64)

- tccpp.c
  * alternative approach to 37999a4fbf3487b363fd0c2f9b7ab622401b202a
    This is to avoid some slowdown with ## token pasting.
  * get_tok_str() : return &lt;eof&gt; for TOK_EOF
  * -funsigned-char: apply to "string" literals as well

- tccpe/tools.c: -impdef: support both 32 and 64 bit dlls anyway
</pre>
</div>
</content>
</entry>
<entry>
<title>configure: --config-musl/-uClibc switch &amp; misc cleanups</title>
<updated>2017-05-13T06:59:06+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-05-13T06:59:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=28435ec58c2ef9bb571cad5f8a1129aea3ecc204'/>
<id>28435ec58c2ef9bb571cad5f8a1129aea3ecc204</id>
<content type='text'>
- configure:
  - add --config-uClibc,-musl switch and suggest to use
    it if uClibc/musl is detected
  - make warning options magic clang compatible
  - simplify (use $confvars instead of individual options)
- Revert "Remove some unused-parameter lint"
  7443db0d5f841b81a55e918bf8c228dd20f9ddb2
  rather use -Wno-unused-parameter (or just not -Wextra)
- #ifdef functions that are unused on some targets
- tccgen.c: use PTR_SIZE==8 instead of (X86_64 || ARM64)
- tccpe.c: fix some warnings
- integrate dummy arm-asm better
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- configure:
  - add --config-uClibc,-musl switch and suggest to use
    it if uClibc/musl is detected
  - make warning options magic clang compatible
  - simplify (use $confvars instead of individual options)
- Revert "Remove some unused-parameter lint"
  7443db0d5f841b81a55e918bf8c228dd20f9ddb2
  rather use -Wno-unused-parameter (or just not -Wextra)
- #ifdef functions that are unused on some targets
- tccgen.c: use PTR_SIZE==8 instead of (X86_64 || ARM64)
- tccpe.c: fix some warnings
- integrate dummy arm-asm better
</pre>
</div>
</content>
</entry>
<entry>
<title>Spelling fixes in C comments only</title>
<updated>2017-05-08T04:38:09+00:00</updated>
<author>
<name>Larry Doolittle</name>
<email>ldoolitt@recycle.lbl.gov</email>
</author>
<published>2017-05-08T04:38:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=19d8b8a17383863d45823e37f20a94cc1d55c3a6'/>
<id>19d8b8a17383863d45823e37f20a94cc1d55c3a6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixes &amp; cleanups</title>
<updated>2017-02-13T17:23:43+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-02-13T17:23:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=a4a20360e9df90bb8a0ed23d113ed5564882de8a'/>
<id>a4a20360e9df90bb8a0ed23d113ed5564882de8a</id>
<content type='text'>
- tccgen.c/tcc.h: allow function declaration after use:
      int f() { return g(); }
      int g() { return 1; }
  may be a warning but not an error
  see also 76cb1144ef91924c53c57ea71e6f67ce73ce1cc6

- tccgen.c: redundant code related to inline functions removed
  (functions used anywhere have sym-&gt;c set automatically)

- tccgen.c: make 32bit llop non-equal test portable
  (probably not on C67)

- dynarray_add: change prototype to possibly avoid aliasing
  problems or at least warnings

- lib/alloca*.S: ".section .note.GNU-stack,"",%progbits" removed
  (has no effect)

- tccpe: set SizeOfCode field (for correct upx decompression)

- libtcc.c: fixed alternative -run invocation
      tcc "-run -lxxx ..." file.c
  (meant to load the library after file).
  Also supported now:
      tcc files ... options ... -run @ arguments ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- tccgen.c/tcc.h: allow function declaration after use:
      int f() { return g(); }
      int g() { return 1; }
  may be a warning but not an error
  see also 76cb1144ef91924c53c57ea71e6f67ce73ce1cc6

- tccgen.c: redundant code related to inline functions removed
  (functions used anywhere have sym-&gt;c set automatically)

- tccgen.c: make 32bit llop non-equal test portable
  (probably not on C67)

- dynarray_add: change prototype to possibly avoid aliasing
  problems or at least warnings

- lib/alloca*.S: ".section .note.GNU-stack,"",%progbits" removed
  (has no effect)

- tccpe: set SizeOfCode field (for correct upx decompression)

- libtcc.c: fixed alternative -run invocation
      tcc "-run -lxxx ..." file.c
  (meant to load the library after file).
  Also supported now:
      tcc files ... options ... -run @ arguments ...
</pre>
</div>
</content>
</entry>
<entry>
<title>tccgen: factor out gfunc_return</title>
<updated>2017-02-08T18:45:31+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-02-08T18:45:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=68666eee2ade45ab73b07361367d0a38d350d663'/>
<id>68666eee2ade45ab73b07361367d0a38d350d663</id>
<content type='text'>
Also:
- on windows i386 and x86-64, structures of size &lt;= 8 are
  NOT returned in registers if size is not one of 1,2,4,8.
- cleanup: put all tv-push/pop/swap/rot into one place
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also:
- on windows i386 and x86-64, structures of size &lt;= 8 are
  NOT returned in registers if size is not one of 1,2,4,8.
- cleanup: put all tv-push/pop/swap/rot into one place
</pre>
</div>
</content>
</entry>
</feed>
