From 8e8886f62cc79daf325a26be79682a426899a9a6 Mon Sep 17 00:00:00 2001 From: Robert Suchanek Date: Wed, 15 Jul 2015 11:43:05 +0000 Subject: [PATCH] Fix restoration of hi/lo in MIPS64R2 interrupt handlers. gcc/ * config/mips/mips.c (mips_emit_save_slot_move): Fix typo. gcc/testsuite/ * gcc.target/mips/interrupt_handler-5.c: New test. From-SVN: r225820 --- gcc/ChangeLog | 4 ++++ gcc/config/mips/mips.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/mips/interrupt_handler-5.c | 8 ++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/mips/interrupt_handler-5.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 64208db51a2..dac10abdb74 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-07-15 Robert Suchanek + + * config/mips/mips.c (mips_emit_save_slot_move): Fix typo. + 2015-07-15 Matthew Fortune Robert Suchanek diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 70240f7bf68..c32532b0721 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -11131,7 +11131,7 @@ mips_emit_save_slot_move (rtx dest, rtx src, rtx temp) { mips_emit_move (temp, src); if (TARGET_64BIT) - emit_insn (gen_mthisi_di (gen_rtx_REG (TImode, MD_REG_FIRST), + emit_insn (gen_mthidi_ti (gen_rtx_REG (TImode, MD_REG_FIRST), temp, gen_rtx_REG (DImode, LO_REGNUM))); else emit_insn (gen_mthisi_di (gen_rtx_REG (DImode, MD_REG_FIRST), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7b021537c82..4c430bff2d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-07-15 Robert Suchanek + + * gcc.target/mips/interrupt_handler-5.c: New test. + 2015-07-15 Matthew Fortune Robert Suchanek diff --git a/gcc/testsuite/gcc.target/mips/interrupt_handler-5.c b/gcc/testsuite/gcc.target/mips/interrupt_handler-5.c new file mode 100644 index 00000000000..64194795e34 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/interrupt_handler-5.c @@ -0,0 +1,8 @@ +/* Test the interrupt handler with an accumulator. */ +/* { dg-do assemble } */ +/* { dg-options "-mips64r2" } */ +_Accum a; +__attribute__((interrupt)) +void foo () { + a = a*a; +} -- 2.30.2