Re: [g++] -O produces incorrect code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Sonntag 07 Oktober 2007 schrieb Martin Schröder:

> We have tracked it down to one source file; if it is compiled with -O,
> we get the above error and valgrind screams:

We already had several occurences of such a problem and each time it was a 
fault in our code and not in gcc.

Generally one cannot help without the code. Where to get it? But one hint:

Use #include <valgrind/memcheck.h> and check each value in the line with

VALGRIND_CHECK_VALUE_IS_DEFINED(variable)

Do this with each subexpression and follow the stack up to the declaration of 
the offending variable. 

One particularly nasty problem was once a bitfield with only 31 defined bits 
but all bits were used in a comparison. Only in compiled code 32. bit was 
left uninitialized.

Greetings
Christoph


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux