tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Re: global 64-bit variables initialization


From: Masha Rabinovich
Subject: Re: [Tinycc-devel] Re: global 64-bit variables initialization
Date: Thu, 20 Nov 2008 18:54:22 +0100


Thank you for fast response!

The test case works well now, but there is a regression:

=====

main()
{
}

void* p = main;

=====

TCC shows a compilation error.

On Thu, Nov 20, 2008 at 12:36 PM, Daniel Glöckner <address@hidden> wrote:
On Thu, Nov 20, 2008 at 08:50:22AM +0100, Masha Rabinovich wrote:
> int a = 2.0 ? 0 : 1;
> int b = (_Bool)2.0;
> int c = !2.0;
> int d = 2.0;
> int e = (char)500;
>
> int main()
> {
>   printf("%d %d %d %d %d\n", a, b, c, d, e);
> }
>
> GCC output: 0 1 0 2 -12
>
> TCC output: 1 0 1 0 500

Nice example. It triggers three bugs:
- constants are cast only inside functions
- '?' does not cast to bool
- '!' does not cast to bool

See http://repo.or.cz/w/tinycc/daniel.git

The fix for the first bug needs thorough testing before it is ready for
inclusion.

 Daniel


_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel


reply via email to

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