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 <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]>
>> To: < [email protected]>
>> Date: Tue, 4 Jul 2006 20:39:43 +0100
>> Message-ID: <[EMAIL PROTECTED]>
>> 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
>> [email protected]
>> http://lists.nongnu.org/mailman/listinfo/tinycc-devel
>



_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to