Hello All,

    There is a bug in trap instruction generation.
    Instead of "bri 0" instruction "brki r0, -1" was used, corrected it now.
    
    ChangeLog:
    2020-04-04 Nagaraju Mekala <nmek...@xilix.com>
    
        * gcc/config/microblaze/microblaze.md
        (trap): update in the pattern
        * gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
        (dg-final): update in the scan-assembler instruction
    
    Signed-off-by :Nagaraju Mekala <nmek...@xilix.com>

diff --git a/gcc/config/microblaze/microblaze.md 
b/gcc/config/microblaze/microblaze.md
index 1970cc6..7049acd 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -2303,7 +2303,7 @@
 (define_insn "trap"
   [(trap_if (const_int 1) (const_int 0))]
   ""
-  "brki\tr0,-1"
+  "bri\t0"
  [(set_attr "type" "trap")]
 )
 
diff --git a/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c 
b/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
index fdcde1f..580b4db 100644
--- a/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
+++ b/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
@@ -5,4 +5,4 @@ void trap ()
   __builtin_trap ();
 }
 
-/* { dg-final { scan-assembler "brki\tr0,-1" } } */
\ No newline at end of file
+/* { dg-final { scan-assembler "bri\t0" } } */

Attached is the patch.

Thanks
Nagaraju

Attachment: 0001-Patch-Microblaze-Modified-trap-instruction.patch
Description: 0001-Patch-Microblaze-Modified-trap-instruction.patch

Reply via email to