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,
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);
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
3 matches
Mail list logo