[Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"

pangbw at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Sep 17 19:02:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124

--- Comment #25 from baoshan <pangbw at gmail dot com> ---
(In reply to Andrew Pinski from comment #24)
> (In reply to baoshan from comment #23)
> > I have seen two places that would convert "A-1" to "A+(-1)", and due the
> > type is unsigned int, it would be converted to "A+4294967295". This looks
> > not right to me.
> 
> Why wrapping is well defined for unsigned types so adding 4294967295 is the
> same as subtracting by 1.

What is wrapping? and where it is defined? I don't know this part and I like to
learn it.
Thanks.



More information about the Gcc-bugs mailing list