https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84443
Bug ID: 84443 Summary: powerpc suboptimal code generation (shrink wrap unlikely path) for Linux spinlocks Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: npiggin at gmail dot com Target Milestone: --- Created attachment 43452 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43452&action=edit testcase with comment at the top describing desired output A small fast path code gets several non-volatile registers saved on stack, and a sub-optimal restore in the return path. The example is derived from (but not identical to) the Linux kernel spinlock implementation. Tested with gcc version 8.0.1 20180207 (experimental) [trunk revision 257435] (Debian 8-20180207-2).