[GAS/ARM] Fix selected_cpu with default CPU and -mcpu
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Fri, 24 Mar 2017 13:22:16 +0000 (13:22 +0000)
committerThomas Preud'homme <thomas.preudhomme@arm.com>
Fri, 24 Mar 2017 13:23:36 +0000 (13:23 +0000)
When GAS is compiled with DEFAULT_CPU set and then run with a -mcpu or
-march option, selected_cpu will be set to the default CPU. This means
the -mcpu is ignored which is surprising behavior. This commit instead
sets selected_cpu from the value passed to -mcpu/-march.

2017-03-24  Thomas preud'homme  <thomas.preudhomme@arm.com>

gas/
* config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt when
CPU_DEFAULT is defined.

gas/ChangeLog
gas/config/tc-arm.c

index 5fda819abcc8c3edf80e533f5cdec55eb596820b..e74ff8ec5320217e55f3aaeee7bf30550f7f2752 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-24  Thomas preud'homme  <thomas.preudhomme@arm.com>
+
+       * config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt when
+       CPU_DEFAULT is defined.
+
 2017-03-21  Palmer Dabbbelt  <palmer@dabbelt.com>
 
        * config/tc-riscv.c (md_show_usage): Remode defuct -m32, -m64,
index ef6b609d0878c140d4b48128e5cc7cf6b7144e5d..bbfe634a64a5978385602245ee7ba36d94f28f73 100644 (file)
@@ -25040,8 +25040,8 @@ md_begin (void)
       mcpu_cpu_opt = &cpu_default;
       selected_cpu = cpu_default;
     }
-  else if (no_cpu_selected ())
-    selected_cpu = cpu_default;
+  else
+    selected_cpu = *mcpu_cpu_opt;
 #else
   if (mcpu_cpu_opt)
     selected_cpu = *mcpu_cpu_opt;
This page took 0.039278 seconds and 4 git commands to generate.