https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118647
--- Comment #5 from Alfredo Correa <alfredo.correa at gmail dot com> --- (In reply to Andrew Pinski from comment #3) > (In reply to Alfredo Correa from comment #2) > > (In reply to Andrew Pinski from comment #1) > > > The tree level misdetection is recorded as PR 99504. > > > > ok, I am not an expert, but I have the impression that what I reported is > > library problem, not a compiler problem. > > The compiler might or might not see further optimizations, after the library > > failed to dispatch to memcpy. > > I agree what you report should also be done in the library but that does not > mean there should be a recorded bug about it not being optimized to a > memcopy without a library change. I agree. But in fairness and at the risk of adding confusion, if GCC can see the function definitions (and without noexcept), then it does the optimization, at least in this case: https://godbolt.org/z/z1or4WdPr