[LLVMbugs] [Bug 2528] False positive "dead store" for aliased pointer
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Mon Jul 7 13:40:57 PDT 2008
http://llvm.org/bugs/show_bug.cgi?id=2528
Ted Kremenek <kremenek at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Ted Kremenek <kremenek at apple.com> 2008-07-07 15:40:51 ---
I think you're misreading the bug report. The warning I see is:
<stdin>:11:40: warning: Value stored to 'bytes' is never read
unsigned bg = *((unsigned*)bytes); bytes += sizeof(unsigned);
^ ~~~~~~~~~~~~~~~~
1 diagnostic generated.
The warning is not about the assignment to bg, its about the "+=" performed to
"bytes". Both the HTML output and console output indicate that the bug has to
do with the expression:
bytes += sizeof(unsigned);
What happens is that the value of bytes is incremented (which is essentially a
load, addition, store), but then that new value stored to bytes is never read.
So this isn't a false positive. There is a dead store here (and a dead
operation).
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list