I am given to understand that the behaviour of the -mcpu option for both the ARM and AArch64 targets is that it is a shorthand for specifying -march=foo -mtune=bar, where bar is a CPU that implements foo. However, the documentation for AArch64 (gcc-4.8.2/gcc/AArch64-Options.html#AArch64-Options) says that -mcpu is the same as -march, except that it takes CPU names rather than architecture versions. http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/ARM-Options.html#ARM-Options is similar except that it seems to describe the correct behaviour in one specific case. These sections should be rewritten to correctly describe the behaviour of -mcpu.
Yes, the docs could be much clearer.
Author: jgreenhalgh Date: Wed Feb 5 11:42:50 2014 New Revision: 207501 URL: http://gcc.gnu.org/viewcvs?rev=207501&root=gcc&view=rev Log: [ARM Documentation] Clarify -mcpu, -mtune, -march gcc/ PR target/59718 * doc/invoke.texi (-march=): Clarify documentation for ARM. (-mtune=): Likewise. (-mcpu=): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/invoke.texi
Author: jgreenhalgh Date: Wed Feb 5 14:40:36 2014 New Revision: 207505 URL: http://gcc.gnu.org/viewcvs?rev=207505&root=gcc&view=rev Log: [Backport: ARM Documentation] Clarify -mcpu, -mtune, -march gcc/ Backport from mainline. 2014-02-05 James Greenhalgh <james.greenhalgh@arm.com> PR target/59718 * doc/invoke.texi (-march): Clarify documentation for ARM. (-mtune): Likewise. (-mcpu): Likewise. Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/doc/invoke.texi
Author: jgreenhalgh Date: Wed Feb 5 14:55:18 2014 New Revision: 207506 URL: http://gcc.gnu.org/viewcvs?rev=207506&root=gcc&view=rev Log: [Backport: ARM Documentation] Clarify -mcpu, -mtune, -march gcc/ Backport from mainline. 2014-02-05 James Greenhalgh <james.greenhalgh@arm.com> PR target/59718 * doc/invoke.texi (-march): Clarify documentation for ARM. (-mtune): Likewise. (-mcpu): Likewise. Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/doc/invoke.texi
Fixed on trunk and all current release branches (4.8/4.7). The text now reads: This specifies the name of the target ARM processor. GCC uses this name to derive the name of the target ARM architecture (as if specified by -march) and the ARM processor type for which to tune for performance (as if specified by -mtune). Where this option is used in conjunction with -march or -mtune, those options take precedence over the appropriate part of this option.