https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120904
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > Therefore, the addition cannot have overflowed and data_ <= data_ + size_ is > always true in all defined cases This is not true. > Pointer arithmetic is required to stay in bounds, and is not defined to cast > to This is true but we dont know what the bounds are here. Adding a large unsigned number is the same as subtracting a small one in some cases. That is size_ could be -1z you would still have well defined code. Note with the check i mentioned gcc still does not optimize away the conditional. But that is due to pr 108017