RTL checking pointed out a couple of cases where rl78.c was extracting
info from rtx without checking the rtx type first.  Applied.

2012-08-09  DJ Delorie  <d...@redhat.com>

        * config/rl78/rl78.c (rl78_alloc_physical_registers): Check for
        SET before extracting SET_SRC.
        (rl78_remove_unused_sets): Check for REG before extractnig REGNO.

Index: config/rl78/rl78.c
===================================================================
--- config/rl78/rl78.c  (revision 190277)
+++ config/rl78/rl78.c  (working copy)
@@ -2217,7 +2217,8 @@
          && GET_CODE (PATTERN (insn)) != CALL)
          continue;
 
-      if (GET_CODE (SET_SRC (PATTERN (insn))) == ASM_OPERANDS)
+      if (GET_CODE (PATTERN (insn)) == SET
+         && GET_CODE (SET_SRC (PATTERN (insn))) == ASM_OPERANDS)
        continue;
 
       valloc_method = get_attr_valloc (insn);
@@ -2644,7 +2645,7 @@
 
       dest = SET_DEST (insn);
 
-      if (REGNO (dest) > 23)
+      if (GET_CODE (dest) != REG || REGNO (dest) > 23)
        continue;
 
       if (find_regno_note (insn, REG_UNUSED, REGNO (dest)))

Reply via email to