This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/64185] Optimized code gives unexpected results


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]