tinycc-devel
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
[Tinycc-devel] global 64-bit variables initialization
From
:
Masha Rabinovich
Subject
:
[Tinycc-devel] global 64-bit variables initialization
Date
:
Wed, 19 Nov 2008 01:54:42 +0100
/*
TCC bug:
only lower 32 bit of 64-bit global variables are properly initialized,
higher 32 bit have garbage
Environment:
Win2000
TCC version:
version 2008-09-15 from
http://repo.or.cz/w/tinycc.git
version 0.9.24 from
http://bellard.org/tcc/
Expected output:
0000000000000000
0000000000000000
0000000000000000
Received output:
0000000000020000
0000000000000000
0000000028234700
*/
#include <stdio.h>
struct S1
{
unsigned long long a, b;
};
struct S1 xx = {0};
unsigned long long y = 0;
int main()
{
printf("%02X", ((unsigned char*)&xx.a)[0]);
printf("%02X", ((unsigned char*)&xx.a)[1]);
printf("%02X", ((unsigned char*)&xx.a)[2]);
printf("%02X", ((unsigned char*)&xx.a)[3]);
printf("%02X", ((unsigned char*)&xx.a)[4]);
printf("%02X", ((unsigned char*)&xx.a)[5]);
printf("%02X", ((unsigned char*)&xx.a)[6]);
printf("%02X", ((unsigned char*)&xx.a)[7]);
printf("\n");
printf("%02X", ((unsigned char*)&xx.b)[0]);
printf("%02X", ((unsigned char*)&xx.b)[1]);
printf("%02X", ((unsigned char*)&xx.b)[2]);
printf("%02X", ((unsigned char*)&xx.b)[3]);
printf("%02X", ((unsigned char*)&xx.b)[4]);
printf("%02X", ((unsigned char*)&xx.b)[5]);
printf("%02X", ((unsigned char*)&xx.b)[6]);
printf("%02X", ((unsigned char*)&xx.b)[7]);
printf("\n");
printf("%02X", ((unsigned char*)&y)[0]);
printf("%02X", ((unsigned char*)&y)[1]);
printf("%02X", ((unsigned char*)&y)[2]);
printf("%02X", ((unsigned char*)&y)[3]);
printf("%02X", ((unsigned char*)&y)[4]);
printf("%02X", ((unsigned char*)&y)[5]);
printf("%02X", ((unsigned char*)&y)[6]);
printf("%02X", ((unsigned char*)&y)[7]);
printf("\n");
}
reply via email to
[Prev in Thread]
Current Thread
[
Next in Thread
]
[Tinycc-devel] global 64-bit variables initialization
,
Masha Rabinovich
<=
[Tinycc-devel] Re: global 64-bit variables initialization
,
Masha Rabinovich
,
2008/11/20
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Daniel Glöckner
,
2008/11/20
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Masha Rabinovich
,
2008/11/20
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Masha Rabinovich
,
2008/11/20
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Daniel Glöckner
,
2008/11/20
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Masha Rabinovich
,
2008/11/20
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Jerry
,
2008/11/21
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Masha Rabinovich
,
2008/11/21
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Jerry
,
2008/11/22
Re: [Tinycc-devel] Re: global 64-bit variables initialization
,
Masha Rabinovich
,
2008/11/22
Prev by Date:
Re: [Tinycc-devel] can tcc compile assembly language program?
Next by Date:
[Tinycc-devel] TCC bug: L"" is missing in preprocessor output
Previous by thread:
[Tinycc-devel] can tcc compile assembly language program?
Next by thread:
[Tinycc-devel] Re: global 64-bit variables initialization
Index(es):
Date
Thread