https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92769
Bug ID: 92769 Summary: No way to set CR0[SO] on function return Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.le...@c-s.fr Target Milestone: --- Linux system calls and Linux VDSO calls require the error status to be reflected through SO bit of CR0 register on function return. There is no way to do that from C functions. This requires to add Assembly trampoline functions just for that, with all associated drawbacks (adding a stack frame to save LR, etc ...) Would it be possible to add to builtin-functions which would set/clear SO on function return ? Something like: - __builtin_ppc_return_with_so_set() - __builtin_ppc_return_with_so_cleared()