https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64287
Bug ID: 64287 Summary: Disable -fuse-caller-save when -pg is active Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org As discussed in https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01496.html : ... A problem is detected with building Linux kernel on MIPS platform when both -fuse-caller-save and -pg options are present. The reason for this is that -fuse-caller-save relies on the analysis of RTL code, but when profiling is active (with -pg option) the code is instrumented by adding a call to mcount function at the beginning of each function. And this is realized on the most platforms simply by fprintf function, so this instrumentation is not reflected in RTL code. The result is that bad code is produced. A solution could be to disable -fuse-caller-save when -pg is active. ...