diff mbox

[mips] Fix switch statement for mips16 (PR target/56942)

Message ID b765a7da-7bf9-438e-a76d-76b37d90c56c@BAMAIL02.ba.imgtec.org
State New
Headers show

Commit Message

Steve Ellcey June 19, 2013, 4:36 p.m. UTC
Steven and Richard,

I saw the email about the s390 switch statement

	http://gcc.gnu.org/ml/gcc-patches/2013-06/msg01026.html

and tested this patch on MIPS to see if using NEXT_INSN instead of
next_real_insn fixed PR 56942.  It did, so is this the right long
term fix for MIPS?  Is it OK to check it in?  Since Steven added
an assert in tablejump_p, I did not include any here, though I could
if we thought it was needed.

Steve Ellcey
sellcey@mips.com


2013-06-19  Steve Ellcey  <sellcey@imgtec.com>

	PR target/56942
	* config/mips/mips.md (casesi_internal_mips16_<mode>):
	Use NEXT_INSN instead of next_real_insn.

Comments

Steven Bosscher June 19, 2013, 5:59 p.m. UTC | #1
On Wed, Jun 19, 2013 at 6:36 PM, Steve Ellcey wrote:
> Steven and Richard,
>
> I saw the email about the s390 switch statement
>
>         http://gcc.gnu.org/ml/gcc-patches/2013-06/msg01026.html
>
> and tested this patch on MIPS to see if using NEXT_INSN instead of
> next_real_insn fixed PR 56942.  It did, so is this the right long
> term fix for MIPS?

Yes it is. Also for other targets that look for JUMP_TABLE_DATA via next_*_insn.

Sorry for not getting the necessary changes in any quicker. I'll try
to get things cleaned up a bit next weekend.

Ciao!
Steven
Richard Sandiford June 19, 2013, 6:16 p.m. UTC | #2
"Steve Ellcey " <sellcey@mips.com> writes:
> 2013-06-19  Steve Ellcey  <sellcey@imgtec.com>
>
> 	PR target/56942
> 	* config/mips/mips.md (casesi_internal_mips16_<mode>):
> 	Use NEXT_INSN instead of next_real_insn.

OK, thanks.

Richard
diff mbox

Patch

diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index ce322d8..b832dda 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -5948,7 +5948,7 @@ 
    (clobber (reg:SI MIPS16_T_REGNUM))]
   "TARGET_MIPS16_SHORT_JUMP_TABLES"
 {
-  rtx diff_vec = PATTERN (next_real_insn (operands[2]));
+  rtx diff_vec = PATTERN (NEXT_INSN (operands[2]));
 
   gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC);