[Bug rtl-optimization/54365] ARM optimization bug when pointer arithmetic wraps
fweimer at redhat dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 30 13:56:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54365
--- Comment #8 from Florian Weimer <fweimer at redhat dot com> 2012-08-30 13:56:04 UTC ---
(In reply to comment #7)
> This is not surprising, just use integer arithmetic instead of pointer
> arithmetic. Pointer arithmetic not only has undefined wrapping, it is defined
> only within the bounds of the object it points into (or one past the last byte
> in it, but you can't dereference it in that case).
I was hoping that -fwrapv would turn pointer arithmetic into pure address
arithmetic as well. The -fwrapv documentation only mentions integer arithmetic
so this is not a bug, it's just ... surprising.
More information about the Gcc-bugs
mailing list