rl78.c (rl78_alloc_physical_registers): Check for SET before extracting SET_SRC.

* 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.

From-SVN: r190278
This commit is contained in:
DJ Delorie 2012-08-09 20:45:29 -04:00 committed by DJ Delorie
parent 23459cbecd
commit 1c6b102126
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2012-08-09 DJ Delorie <dj@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.
2012-08-09 Oleg Endo <olegendo@gcc.gnu.org>
PR target/54089

View file

@ -2217,7 +2217,8 @@ rl78_alloc_physical_registers (void)
&& 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 @@ rl78_remove_unused_sets (void)
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)))