This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
I: gcc 3.0.1 bug
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: I: gcc 3.0.1 bug
- From: "Cyril Malkov" <malkov at lostpassword dot com>
- Date: Mon, 1 Oct 2001 02:31:14 +0400
Hello!
The following code:
---------------
#include "stdio.h"
typedef unsigned int ulong;
typedef unsigned short int ushort;
void func( ulong crc )
{
ushort d = *( (ushort*)&crc + 1 );
printf( "%X, %X\n", crc, d );
}
int main()
{
ulong crc = 0x12345678;
func( crc );
func( crc );
func( crc );
return 0;
}
------------
After compiling with 'g++ -O3 t.cpp' it prints the following:
12345678, 804
12345678, 804
12345678, BFFF
===
Cyril Malkov, Passware,
Software Development Director,
http://www.lostpassword.com