tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] x86_64 code generate issues


From: Alex Rozenman
Subject: [Tinycc-devel] x86_64 code generate issues
Date: Wed, 19 Aug 2015 17:35:15 +0300

Hello TCC maintainers,

I am compiling the following code (using libtcc, I checked also mob branch):

unsigned int f1() { return *(int*)0x7ffeb7162010ULL; }

I am facing the following issues:
- in the CValue struct, address field is declared as "unsigned int", therefore the address was cut.
- in load(ref, value) function (x86_64-gen.c) "fc" (should denote constant address) is also "int".
- even if my pointer fits in 32 bits the following wrong code is generated:

   0xaaa7bb: mov    0xaaafdc(%rip),%eax        # 0x155579d

This code was generated when my pointer was (0xaaafdc+4).
In general, PC relative indirection looks inappropriate in case of arbitrary const pointer indirection.

Another question - when a next stable version is going to be released? "mob" branch has a lots of good fixes we wanted to use.

Best regards,
Alex Rozenman (address@hidden).


reply via email to

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