https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120428
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- The library code should be exactly equivalent, except for being slightly simpler (one level of function call has been inlined into its caller now) and doing: ptr += n; return ptr; instead of: return ptr + n; Otherwise, I see no differences and so no reason the compiler can't optimize it identically.