tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] (no subject)


From: Daniel Glöckner
Subject: Re: [Tinycc-devel] (no subject)
Date: Sat, 11 May 2019 01:16:07 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Andy,

On Fri, May 10, 2019 at 07:30:24PM +0300, ANDY TAKKER wrote:
> A lot of words are said about compatibility and portability, but GCC
> and PCC bring one result, and TCC is completely different.

Let's for a second assume that you run that code on an architecture with
sizeof(char*) == sizeof(int).

Why should TCC generate the same output as GCC and PCC?
You attempt to skip the prologue of the function by adding 3 to the
address, but the prologue is not standardized. The one used by TCC
is different from the one used by GCC. Just compare the output of
GCC with -O0 and GCC with -O3 -fomit-frame-pointer. That should also
give you different results. And with -O3 GCC might even decide to omit
that asm statement because it has no needed outputs, doesn't clobber
anything and isn't marked as volatile.

> Here is
> another interesting link closely related to the TCC.
> https://forum.nasm.us/index.php?topic=2524.0

If you have access to the output of that obscure mix of compiler,
assembler, and linker, please provide the disassembly of the _start
function.

> nop&double jump:

Sometimes TCC has to reserve space for an instruction before it knows
if it is needed or how long it will be. To fill the gaps, it uses nops.

Best regards,

  Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]