Upload Tizen:Base source
[external/binutils.git] / debian / patches / 160_gas_pr12698.diff
1 # DP: Proposed patch for PR gas/12698
2
3 2011-04-15  Bernd Schmidt  <bernds@codesourcery.com>
4
5         gas/
6         * config/tc-arm.c (m_profile_p): New function.
7         (parse_psr, do_t_mrs, do_t_msr): Use m_profile_p.
8
9
10 --- a/gas/config/tc-arm.c
11 +++ b/gas/config/tc-arm.c
12 @@ -234,6 +234,15 @@
13  static const arm_feature_set fpu_neon_ext_fma = ARM_FEATURE (0, FPU_NEON_EXT_FMA);
14  static const arm_feature_set fpu_vfp_ext_fma = ARM_FEATURE (0, FPU_VFP_EXT_FMA);
15  
16 +/* Return whether FEATURES indicates an M profile CPU, without getting
17 +   confused by ARM_ANY.  */
18 +static int
19 +m_profile_p (arm_feature_set features)
20 +{
21 +  return (ARM_CPU_HAS_FEATURE (features, arm_ext_v6m)
22 +         && !ARM_CPU_HAS_FEATURE (features, arm_ext_v7a));
23 +}
24 +
25  static int mfloat_abi_opt = -1;
26  /* Record user cpu selection for object attributes.  */
27  static arm_feature_set selected_cpu = ARM_ARCH_NONE;
28 @@ -5354,7 +5363,7 @@
29    const struct asm_psr *psr;
30    char *start;
31    bfd_boolean is_apsr = FALSE;
32 -  bfd_boolean m_profile = ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m);
33 +  bfd_boolean m_profile = m_profile_p (selected_cpu);
34  
35    /* CPSR's and SPSR's can now be lowercase.  This is just a convenience
36       feature for ease of use and backwards compatibility.  */
37 @@ -10947,7 +10956,7 @@
38      {
39        int flags = inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT);
40  
41 -      if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m))
42 +      if (m_profile_p (selected_cpu))
43         constraint (flags != 0, _("selected processor does not support "
44                     "requested special purpose register"));
45        else
46 @@ -10979,7 +10988,7 @@
47    else
48      flags = inst.operands[0].imm;
49  
50 -  if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m))
51 +  if (m_profile_p (selected_cpu))
52      {
53        int bits = inst.operands[0].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT);
54