https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109123
--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- > GCC has sunk part of the old_size computation (not the loads but the > subtraction) to after the realloc but before the use of old_size. Is this code motion valid? Is there any point in the middle-end that checks the validity of the pointer beyond a free/realloc? If there is a point where such check happens, perhaps it would be a good place to apply no_warning attribute to the pointer.