https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89695
--- Comment #5 from Matthijs van Duin <matthijsvanduin at gmail dot com> --- So for reference, the Itanium C++ ABI says: "A type which is trivial for the purposes of the ABI will be passed and returned according to the rules of the base C ABI, e.g. in registers; often this has the effect of performing a trivial copy of the type." It is not clear to me what the justification is for that last remark, can someone quote what's in the base C ABI that forbids this optimization? Eliding the trivial copy should be permitted under the as-if rule anyway, there's no way to detect its elision that doesn't involve undefined behaviour.