Patchwork Fix ICE in m68k_delegitimize_address

login
register
mail settings
Submitter Andreas Schwab
Date Nov. 16, 2010, 7:46 p.m.
Message ID <m239r159xi.fsf@igel.home>
Download mbox | patch
Permalink /patch/71447/
State New
Headers show

Comments

Andreas Schwab - Nov. 16, 2010, 7:46 p.m.
The operand of the RELOC{16,32} UNSPEC can also contain a LABEL_REF.

Andreas.

2010-11-16  Andreas Schwab  <schwab@linux-m68k.org>

	* config/m68k/m68k.c (m68k_delegitimize_address): Also expect
	LABEL_REF in UNSPEC operand.

Patch

Index: gcc/config/m68k/m68k.c
===================================================================
--- gcc/config/m68k/m68k.c	(revision 166814)
+++ gcc/config/m68k/m68k.c	(working copy)
@@ -4684,7 +4684,7 @@  m68k_delegitimize_address (rtx orig_x)
 	  && XINT (unspec, 1) != UNSPEC_RELOC32))
     return orig_x;
   x = XVECEXP (unspec, 0, 0);
-  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+  gcc_assert (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF);
   if (unspec != XEXP (addr.offset, 0))
     x = gen_rtx_PLUS (Pmode, x, XEXP (XEXP (addr.offset, 0), 1));
   if (addr.index)