https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66457
Bug ID: 66457 Summary: gcc generates an extra "mov ??, %edx" before "call mcount" when "-pg" is enabled in cross compilation Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: leedypku at gmail dot com Target Milestone: --- # On Darwin, with cross compilation, some code omitted $ echo 'int main(){}' | i386-jos-elf-gcc -pg -m32 -S -x c -o - - main: pushl %ebp movl %esp, %ebp .LP0: movl $.LP0,%edx # this line call _mcount popl %ebp ret .ident "GCC: (GNU) 4.9.2" # On Linux, some code omitted $ echo 'int main(){}' | gcc -pg -S -m32 -x c -o - - main: pushl %ebp movl %esp, %ebp call mcount popl %ebp ret .ident "GCC: (Ubuntu 4.8.2-19ubuntu1) 4.8.2" 1. It happens only in cross compilation. 2. The target is i386-jos-elf and the host is Darwin. 3. I've tested with GCC version 4.6.1, 4.6.4 and 4.9.2. 4. How can I disable it?