Bug#452431: g++-4.2: two cases of bad optimization in x86 (i686) with long long in 32bit

2007-11-22 Thread Thorsten Jordan
Package: g++-4.2 Version: 4.2.2-3 Severity: minor the following snippet of code shows two cases of bad optimization behaviour on gcc 4.1.3 and 4.2.3 (debian unstable). #define PTS_MASK ((1LL 33)-1) #define PTS_WRAP (1LL 33) #define PTS_WRAP2 (1LL 32) long long ptsdiff_mod2_33(long long a,

Bug#350636: gcc-4.0: compiles wrong code with -O2

2006-01-30 Thread Thorsten Jordan
Package: gcc-4.0 Version: 4.0.2-8 Severity: normal i am reading from a stream in c++. The read values differ depending on compiler optimization level. Note that i have a little endian machine (x86)! take this code inline uint32_t read_u32(istream in) { uint32_t i; in.read((char*)i, 4);

Bug#350636: code that reproduces the bug and more info

2006-01-30 Thread Thorsten Jordan
I was able to reproduce the bug with the following code (compile: g++ -Wall -O2 x.cpp) #include stdio.h #include fstream typedef unsigned int Uint32; inline Uint32 read_u32(std::istream in) { Uint32 i; in.read((char*)i, 4); return i; } inline float