tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Bug


From: Ben Hinkle
Subject: Re: [Tinycc-devel] Bug
Date: Thu, 6 Jul 2006 08:33:05 -0400

The long long is trying to generate code to compute the negative in '-1LL'. Since the text segment doesn't exist yet the compiler seg-v's. The gen_opl function should follow the same pattern as gen_opic and gen_opif
    c1 = (v1->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST;
    c2 = (v2->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST;
    if (c1 && c2) {
do the computation at compile-time
    } else {
generate code
    }
 
I haven't written the fix but if I have time soon I'd like to give it a shot.
-Ben
 
On 7/5/06, PerfectDark <address@hidden> wrote:
This is known bug and I didnt heard that it was fixed by someone. I tested tcc mostly under win32 and code like that always lead to crush:

//--------------------
long long g_llSomethingVariable = -1LL;

#include <stdio.h>

int main( int argc, char ** argv )
{
return 0;
}
//--------------------

>Could you please provide an example code that triggers this bug?
>
>On Tue, Jul 04, 2006 at 08:39:43PM +0100, Eric Chubb wrote:
>> From: "Eric Chubb" <address@hidden>
>> To: < address@hidden>
>> Date: Tue, 4 Jul 2006 20:39:43 +0100
>> Message-ID: <address@hidden>
>> Subject: [Tinycc-devel] Bug
>>
>> When you try and assign a value to a global variable just before main, the
>> compiler crashes
>>
>
>> _______________________________________________
>> Tinycc-devel mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/tinycc-devel
>



_______________________________________________
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]