https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70047
Bug ID: 70047 Summary: Warn on inefficient function parameter passing Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jaak at ristioja dot ee Target Milestone: --- According to the x86_64 ABI [1], function arguments are passed using registers and stack memory. It might be useful for x86_64 and other architectures if GCC would provide an option to warn if some parameters would (inefficiently) be passed on the stack instead of being passed via registers. This would help programmers optimize function signatures without disassembling the end result. Depending on the cost of different argument passing techniques in the ABI used, this warning option could benefit from multiple levels or suboptions, e.g. -Wparameter-passing=memory,xmm would warn if parameters are passed on stack or via xmm registers. Just a raw idea. :) [1] System V Application Binary Interface. AMD64 Architecture Processor Supplement. Draft Version 0.99.6. http://www.x86-64.org/documentation/abi.pdf