Patchwork Fix AVR ICE

login
register
mail settings
Submitter Tom de Vries
Date Sept. 20, 2011, 5:09 p.m.
Message ID <4E78C8C1.6090603@codesourcery.com>
Download mbox | patch
Permalink /patch/115607/
State New
Headers show

Comments

Tom de Vries - Sept. 20, 2011, 5:09 p.m.
Hi Bernd,

this patch fixes an ICE in final.c:final() when building for AVR with
--enable-checking=yes,rtl.
The ICE happens when the jump label is a return, but expected to be a label.

Tested on X86_64 and AVR (courtesy of Johann).

ok for trunk?

Thanks,
- Tom

2011-09-20 Tom de Vries  <tom@codesourcery.com>

	* final.c (final): Handle if JUMP_LABEL is not LABEL_P.
Bernd Schmidt - Sept. 20, 2011, 9:47 p.m.
On 09/20/11 19:09, Tom de Vries wrote:
> 
> 	* final.c (final): Handle if JUMP_LABEL is not LABEL_P.

This is ok.


Bernd

Patch

Index: gcc/final.c
===================================================================
--- gcc/final.c (revision 178804)
+++ gcc/final.c (working copy)
@@ -1739,7 +1739,7 @@  final (rtx first, FILE *file, int optimi
       if (optimize_p && JUMP_P (insn))
 	{
 	  rtx lab = JUMP_LABEL (insn);
-	  if (lab && LABEL_NUSES (lab) == 1)
+	  if (lab && LABEL_P (lab) && LABEL_NUSES (lab) == 1)
 	    {
 	      LABEL_REFS (lab) = insn;
 	    }