This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64185] Optimized code gives unexpected results
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 Dec 2014 07:52:44 +0000
- Subject: [Bug c/64185] Optimized code gives unexpected results
- Auto-submitted: auto-generated
- References: <bug-64185-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64185
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |mpolacek at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
-fsanitize=undefined says
q.c:71:22: runtime error: index 1 out of bounds for type 'kv_t [1]'
q.c:73:20: runtime error: index 3 out of bounds for type 'kv_t [1]'
An out-of-bounds access is not just something that "looks not clean", it is a
bug, you're triggering undefined behavior so all bets are off. Invalid.