https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667
--- Comment #58 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Rich Felker from comment #57) > and more concerned about the consequences of LTO/whole-program-analysis where > something in the translation process can see the violated restrict > qualifier, infer UB, and blow everything up. That can't happen, in GCC in GIMPLE these are represented as assignments, not {__builtin_,}memcpy calls and are turned into the calls (or inline expansion of the copying) only when being expanded into RTL. All the LTO/whole program optimizations happen on GIMPLE, so at that point nothing can be inferred from that because it simply isn't present in the IL and only after all LTO & IPA optimizations are done individual functions go through the rest of GIMPLE optimizations and then RTL ones. The only exception to that is IPA-RA, which intra partition (for LTO, otherwise within the TU) can take into account what hard registers are used/unused by previously emitted functions and take that knowledge into their callers emitted later; but for those this is a library call like any other.