Bug 57907

Summary: warning: switch -mcpu=cortex-a15 conflicts with -march=armv7-a switch [enabled by default]
Product: gcc Reporter: Christian Helmuth <christian.helmuth>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.stohr, ramana
Priority: P3    
Version: 4.7.3   
Target Milestone: 4.9.0   
Host: Target: arm-elf-eabi
Build: Known to work:
Known to fail: Last reconfirmed: 2013-08-14 00:00:00

Description Christian Helmuth 2013-07-16 12:02:04 UTC
The manpage states that "This option [-march] can be used in conjunction with or instead of the -mcpu= option." and this works for, e.g., -mcpu=cortex-a9. On the other GCC complains for -mcpu=cortex-a15 and -mcpu=cortex-a7 in conjunction with -march=armv7-a.

The following command line reproduces the issue:

> echo "int main() {}" | /usr/local/genode-gcc/bin/genode-arm-g++ -c -x c++ - -o /tmp/stdin.o -march=armv7-a -mcpu=cortex-a15
<stdin>:1:0: warning: switch -mcpu=cortex-a15 conflicts with -march=armv7-a switch [enabled by default]

Examples in bugzilla never user both options for ARM but just -mcpu. Will the combination be supported in the future or should I adapt the mcpu-only approach? Does it have drawbacks?
Comment 1 Richard Earnshaw 2013-07-23 16:23:26 UTC
You get the warning because Cortex-A15 implements a superset of ARM-v7a, due to the addition of the HW division instructions.  This means that -march=armv7-a and -mcpu=cortex-a15 leads to an ambiguity as to what architectural features you want and hence the warning.

It's not currently possible to specify the exact architecture variant that A15 supports in the command line; we're looking at fixing that in future.
Comment 2 Alexander Stohr 2014-01-29 14:38:38 UTC
Cortex-A15 is getting pretty widespread with even a speed up / follow up / revised variant popping up from the chip vendors.
having no matching command set profile for that core should not be the long term state.
ticking this report now in the hope it can be resolved in a near future now.
Comment 3 Ramana Radhakrishnan 2014-01-29 14:40:20 UTC
This is now fixed. 

With the commit for v7ve http://gcc.gnu.org/ml/gcc-cvs/2014-01/msg00982.html

Ramana
Comment 4 Ramana Radhakrishnan 2014-02-11 15:58:28 UTC
fixed.