https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70458
Bug ID: 70458 Summary: Function and function pointers that, when called, imply an optimization barrier Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: fw at gcc dot gnu.org Target Milestone: --- In glibc, we have a few cases where we call a function through an inappropriately typed function pointer, or from a different translation unit which uses an incompatible prototype. The glibc consensus is to keep such calls. I wan to make this more future-proof and want to mark the function definition with a new function attribute (maybe “call_barrier”) which indicates that an arbitrary side effect may happen when control is transition from the caller to the callee, and that this side effect patches up all type incompatibilities which may be present.