PR 9722
authorNick Clifton <nickc@redhat.com>
Thu, 15 Jan 2009 12:33:46 +0000 (12:33 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 15 Jan 2009 12:33:46 +0000 (12:33 +0000)
        * config/tc-arm.c (do_t_nop): Check for availability of Thumb2
        instructions before generating a Thumb2 nop.

        * gas/testsuite/gas/arm/archv6m.d: Update expected NOP opcode.
        * gas/testsuite/gas/arm/pr9722.s: New test.
        * gas/testsuite/gas/arm/pr9722.d: Expected disassembly.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/archv6m.d
gas/testsuite/gas/arm/pr9722.d [new file with mode: 0644]
gas/testsuite/gas/arm/pr9722.s [new file with mode: 0644]

index fb0b41448debb38296ba0a1a09c29e2d2936c58f..60b69056124cc8fed01077a2e08774606376d15f 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-15  Nick Clifton  <nickc@redhat.com>
+
+       PR 9722
+       * config/tc-arm.c (do_t_nop): Check for availability of Thumb2
+       instructions before generating a Thumb2 nop.
+
 2009-01-14  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
        
        * config/tc-s390.h: Define LOCAL_LABEL_PREFIX.
index 37f81128578e0b5cd78ed1e05c21f931c4828478..5998e5555ba548279ce5c51aad5ad74888afad30 100644 (file)
@@ -9927,8 +9927,15 @@ do_t_nop (void)
        }
       else
        {
-         inst.instruction = THUMB_OP16 (inst.instruction);
-         inst.instruction |= inst.operands[0].imm << 4;
+         /* PR9722: Check for Thumb2 availability before
+            generating a thumb2 nop instruction.  */
+         if (ARM_CPU_HAS_FEATURE (cpu_variant, arm_arch_t2))
+           {
+             inst.instruction = THUMB_OP16 (inst.instruction);
+             inst.instruction |= inst.operands[0].imm << 4;
+           }
+         else
+           inst.instruction = 0x46c0;
        }
     }
   else
index eddb6994db35e4c54acc369ed07bec670771ebad..fd201a3f8248fa3dee376a0120ec30d95f7e567c 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-15  Nick Clifton  <nickc@redhat.com>
+
+       PR 9722
+       * gas/testsuite/gas/arm/archv6m.d: Update expected NOP opcode.
+       * gas/testsuite/gas/arm/pr9722.s: New test.
+       * gas/testsuite/gas/arm/pr9722.d: Expected disassembly.
+
 2009-01-14  Peter Bergner  <bergner@vnet.ibm.com>
 
        * gas/ppc/power6.s ("mtfsf", "mtfsf.", "mtfsfi", "mtfsfi."): Add tests.
index b6ef1e616b35334be0c24a88660ed6dbaa376c3b..31d06a31584391494835444b7ee154f45cc08163 100644 (file)
@@ -12,4 +12,4 @@ Disassembly of section .text:
 0[0-9a-f]+ <[^>]+> bf30        wfi
 0[0-9a-f]+ <[^>]+> bf40        sev
 0[0-9a-f]+ <[^>]+> 4408        add     r0, r1
-0[0-9a-f]+ <[^>]+> bf00        nop
+0[0-9a-f]+ <[^>]+> 46c0        nop.*
diff --git a/gas/testsuite/gas/arm/pr9722.d b/gas/testsuite/gas/arm/pr9722.d
new file mode 100644 (file)
index 0000000..44f7e48
--- /dev/null
@@ -0,0 +1,10 @@
+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix* *-*-vxworks
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: PR9722: Generation of Thumb NOP instruction
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+0 <.*> 46c0[         ]+nop.*
+0+2 <.*> 46c0[         ]+nop.*
+0+4 <.*> bf00[         ]+nop
diff --git a/gas/testsuite/gas/arm/pr9722.s b/gas/testsuite/gas/arm/pr9722.s
new file mode 100644 (file)
index 0000000..0d54d3a
--- /dev/null
@@ -0,0 +1,8 @@
+        .thumb
+        .text
+        .arch armv4t
+         nop
+        .syntax unified
+         nop
+        .arch armv6t2
+         nop