[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 150748] memcheck and -O1: if (not_initialized_i < 0)" error not
From:       Chris Jefferson <chris () bubblescope ! net>
Date:       2007-10-17 13:14:25
Message-ID: 20071017131425.21387.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=150748         




------- Additional Comments From chris bubblescope net  2007-10-17 15:14 -------
The problem is that if you look at the assembler output, there isn't a compare!

gcc's optimizer decides to choose a value for i (I'm not sure how, I'd guess 0), then \
optimizes using that. Therefore your code becomes:

#include <stdio.h> 
main () 
{ printf ("i >= 0\n"); } 

Which has no invalid reads or writes.

I'm not a valgrind expert, but if valgrind doesn't warn that optimization can do \
this, then it should, perhaps with a simple example like this one :)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic