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

login
register
mail settings
Submitter Steve Ellcey
Date June 19, 2013, 4:36 p.m.
Message ID <b765a7da-7bf9-438e-a76d-76b37d90c56c@BAMAIL02.ba.imgtec.org>
Download mbox | patch
Permalink /patch/252609/
State New
Headers show

Comments

Steve Ellcey - June 19, 2013, 4:36 p.m.
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.
Steven Bosscher - June 19, 2013, 5:59 p.m.
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.
"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

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);