Fix AVR ICE

Submitted by Tom de Vries on Sept. 20, 2011, 5:09 p.m.

Details

Message ID 4E78C8C1.6090603@codesourcery.com
State New
Headers show

Commit Message

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.

Comments

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 hide | download patch | download mbox

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