Bug 59718 - Behaviour of -mcpu documented incorrectly for ARM targets
Summary: Behaviour of -mcpu documented incorrectly for ARM targets
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-08 11:34 UTC by Bernard
Modified: 2014-02-05 15:03 UTC (History)
0 users

See Also:
Host:
Target: arm, aarch64
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-01-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard 2014-01-08 11:34:44 UTC
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.
Comment 1 Richard Earnshaw 2014-01-08 11:59:20 UTC
Yes, the docs could be much clearer.
Comment 2 James Greenhalgh 2014-02-05 11:43:22 UTC
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
Comment 3 James Greenhalgh 2014-02-05 14:41:08 UTC
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
Comment 4 James Greenhalgh 2014-02-05 14:55:49 UTC
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
Comment 5 James Greenhalgh 2014-02-05 15:03:14 UTC
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.