OSDN Git Service

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 fb0b414..60b6905 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 37f8112..5998e55 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 eddb699..fd201a3 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 b6ef1e6..31d06a3 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