https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955
--- Comment #14 from Paul Eggert <eggert at gnu dot org> --- (In reply to Dan Gohman from comment #13) > *p can't alias a or b without violating the weaker assumption. Sorry, you've lost me there. Pointers in realloc'ed storage can alias already-existing pointers, and surely this aliasing can inhibit optimization; perhaps my example doesn't show this correctly but I expect that other examples could. > the weaker assumption would be usable by a much broader set of functions, > so it may even provide overall stronger alias information in practice. >From what I've seen so far I tend to agree, but there are contrary opinions, e.g., Richard Biener's "We cannot use the malloc attribute on realloc, ever." <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23383#23>. It might be helpful for Richard to chime in here and explain. Even if GCC does not change the meaning of __attribute__ ((malloc)), perhaps there should be a new directive (__attribute__ ((new)), say) with the weaker semantics. Anyway, the original bug report is about GCC's documentation, and the proposed patch does fix the documentation bug, so we could start with it.