https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90372
Bug ID: 90372 Summary: [x64][missed optimization] pushes unused r12 onto stack on unique_ptr use Product: gcc Version: 9.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marc at kdab dot com Target Milestone: --- In the following example: https://godbolt.org/z/jHSYue one(), using std::unique_ptr, pushes r12 to the stack just to pop it back at the end. r12 does not appear to be used in-between. The similar two() function does not do this, even though the rest of the function (except the stack unwind trampoline) is instruction-by-instruction identical. Expected: r12 is not pushed/popped.