[arm] PR 80389 - if architecture and cpu mismatch, don't print an architecture name...
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 11 Apr 2017 14:57:41 +0000 (14:57 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Tue, 11 Apr 2017 14:57:41 +0000 (14:57 +0000)
In this PR we incorrectly print the architecture name in a .cpu
directive in the assembly file when the -mcpu and -march options
conflict (don't target the same base architecture).  In this case the
.arch overrides the .cpu directive and we should emit a .arch option.

PR target/80389
* config/arm/arm.c (arm_configure_build_target): When -mcpu and -arch conflict,
set target->arch_name instead of target->cpu_name.

From-SVN: r246843

gcc/ChangeLog
gcc/config/arm/arm.c

index 272f60343377e439f95467ebedfe3fed8660e975..8a729436f1e13cdc3b747d2b7e4036f0edeb5c0e 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-11  Richard Earnshaw  <rearnsha@arm.com>
+
+       PR target/80389
+       * config/arm/arm.c (arm_configure_build_target): When -mcpu and -arch
+       conflict, set target->arch_name instead of target->cpu_name.
+
 2017-04-11  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/80374
index a9b61a339425d6df0d72dc4c87e4528fbd218eb3..a2d80cfd645928fb8b3178a8e0c7173adce5d598 100644 (file)
@@ -3098,15 +3098,15 @@ arm_configure_build_target (struct arm_build_target *target,
                arm_selected_tune = arm_selected_cpu;
 
              arm_selected_cpu = arm_selected_arch;
+             target->arch_name = arm_selected_arch->name;
            }
          else
            {
              /* Architecture and CPU are essentially the same.
                 Prefer the CPU setting.  */
              arm_selected_arch = NULL;
+             target->core_name = arm_selected_cpu->name;
            }
-
-         target->core_name = arm_selected_cpu->name;
        }
       else
        {