Fix uninitialised CRIS insn
authorAlan Modra <amodra@gmail.com>
Mon, 16 Jun 2014 00:20:15 +0000 (09:50 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 16 Jun 2014 02:53:54 +0000 (12:23 +0930)
gas/
* config/tc-cris.c (md_create_long_jump): Follow "short" jump
with a nop rather than leaving uninitialised.
gas/testsuite/
* gas/cris/rd-bkw4v32.d: Update.

gas/ChangeLog
gas/config/tc-cris.c
gas/testsuite/ChangeLog
gas/testsuite/gas/cris/rd-bkw4v32.d

index 31c6291bc56c7525dbc6e23c67ca1965f430ebac..953130a31580cb6938324e98d1e57b34a7414116 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-16  Alan Modra  <amodra@gmail.com>
+
+       * config/tc-cris.c (md_create_long_jump): Follow "short" jump
+       with a nop rather than leaving uninitialised.
+
 2014-06-13  Chen Gang  <gang.chen.5i5j@gmail.com>
 
        * config/tc-score7.c: Replace sprintf with strcpy where
index 86d80620d6c28e3bf57b75ab09af422f32ec9c5c..aba4ef7dffce373d8db5acbe9820ea0b79ae88c7 100644 (file)
@@ -1124,9 +1124,15 @@ md_create_long_jump (char *storep, addressT from_addr, addressT to_addr,
 
   if (max_short_minus_distance <= distance
       && distance <= max_short_plus_distance)
-    /* Then make it a "short" long jump.  */
-    md_create_short_jump (storep, from_addr, to_addr, fragP,
+    {
+      /* Then make it a "short" long jump.  */
+      md_create_short_jump (storep, from_addr, to_addr, fragP,
                            to_symbol);
+      if (cris_arch == arch_crisv32)
+       md_number_to_chars (storep + 6, NOP_OPCODE_V32, 2);
+      else
+       md_number_to_chars (storep + 6, NOP_OPCODE, 2);
+    }
   else
     {
       /* We have a "long" long jump: "JUMP [PC+]".  If CRISv32, always
index 43a37e36fa78b45f3bf48c3f295f11416f2a9564..7a42746296fb008c05998cd4eef65dc6affd88b7 100644 (file)
@@ -1,3 +1,7 @@
+2014-06-16  Alan Modra  <amodra@gmail.com>
+
+       * gas/cris/rd-bkw4v32.d: Update.
+
 2014-06-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gas/i386/prefix.s: Add another fwait test.
index 210746c108f9171fed85e1becc416574446ea1eb..35fa5b2230adbf0ee5da4fe09f0ee4210b540ab2 100644 (file)
@@ -43,7 +43,7 @@ Disassembly of section \.text:
     4acc:      b005                    nop 
     4ace:      ffed 4635               ba 8014 <x\+0x8014>
     4ad2:      b005                    nop 
-    4ad4:      0000                    bcc \.
+    4ad4:      b005                    nop 
     4ad6:      6f9e 0000 0000          move.d 0 <x>,r9
                        4ad8: R_CRIS_32 x336
     4adc:      bfbd 0000 0000          jsr 0 <x>