Microblaze: Modified trap instruction

Message ID BY5PR02MB70411767A95DED5ECE1035C8D6C40@BY5PR02MB7041.namprd02.prod.outlook.com
State New
Headers show
Series
  • Microblaze: Modified trap instruction
Related show

Commit Message

Nagaraju Mekala April 4, 2020, 8:59 a.m.
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 <nmekala@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 <nmekala@xilix.com>


Attached is the patch.

Thanks
Nagaraju

Comments

Michael Eager April 4, 2020, 6:15 p.m. | #1
OK to apply.

On 4/4/20 1:59 AM, Nagaraju Mekala wrote:
> 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 <nmekala@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 <nmekala@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

> 


-- 
Michael Eager    eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306
Jason Merrill via Gcc-patches April 5, 2020, 4:06 p.m. | #2
On Sat, 2020-04-04 at 11:15 -0700, Michael Eager wrote:
> OK to apply.

> 

> On 4/4/20 1:59 AM, Nagaraju Mekala wrote:

> > 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 <nmekala@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

I fixed up nits in the ChangeLog and committed the patch on Nagaraju's behalf.

jeff
> >
Nagaraju Mekala April 5, 2020, 4:20 p.m. | #3
> -----Original Message-----

> From: Jeff Law <law@redhat.com>

> Sent: Sunday, April 5, 2020 9:36 PM

> To: Michael Eager <eager@eagercon.com>; Nagaraju Mekala

> <nmekala@xilinx.com>; gcc-patches@gcc.gnu.org

> Cc: Sadanand Mutyala <sadanan@xilinx.com>

> Subject: Re: [PATCH]Microblaze: Modified trap instruction

> 

> On Sat, 2020-04-04 at 11:15 -0700, Michael Eager wrote:

> > OK to apply.

Thank you.
> >

> > On 4/4/20 1:59 AM, Nagaraju Mekala wrote:

> > > 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 <nmekala@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

> I fixed up nits in the ChangeLog and committed the patch on Nagaraju's

> behalf.

Thank you.
- Nagaraju
>

> jeff

> > >

Patch

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" } } */