diff options
author | Sebastian Perta <sebastian.perta@renesas.com> | 2018-01-22 13:53:48 +0000 |
---|---|---|
committer | Sebastian Perta <sebastianperta@gcc.gnu.org> | 2018-01-22 13:53:48 +0000 |
commit | 049b866d3c110f152f8b11c6de30d88e299fa474 (patch) | |
tree | 736718f06723b1908aed2e8407c459fa5217244f /gcc/config | |
parent | 6b271a2ec41ac5eb9331a7c5857e3719c9a24ef4 (diff) | |
download | gcc-049b866d3c110f152f8b11c6de30d88e299fa474.zip gcc-049b866d3c110f152f8b11c6de30d88e299fa474.tar.gz gcc-049b866d3c110f152f8b11c6de30d88e299fa474.tar.bz2 |
rl78.c (rl78_note_reg_set): fixed dead reg check for non-QImode registers
2018-01-12 Sebastian Perta <sebastian.perta@renesas.com>
* config/rl78/rl78.c (rl78_note_reg_set): fixed dead reg check
for non-QImode registers
From-SVN: r256945
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/rl78/rl78.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c index efa4b39..3e34a88 100644 --- a/gcc/config/rl78/rl78.c +++ b/gcc/config/rl78/rl78.c @@ -3792,16 +3792,21 @@ static void rl78_note_reg_set (char *dead, rtx d, rtx insn) { int r, i; - + bool is_dead; if (GET_CODE (d) == MEM) rl78_note_reg_uses (dead, XEXP (d, 0), insn); if (GET_CODE (d) != REG) return; + /* Do not mark the reg unused unless all QImode parts of it are dead. */ r = REGNO (d); - if (dead [r]) - add_reg_note (insn, REG_UNUSED, gen_rtx_REG (GET_MODE (d), r)); + is_dead = true; + for (i = 0; i < GET_MODE_SIZE (GET_MODE (d)); i ++) + if (!dead [r + i]) + is_dead = false; + if(is_dead) + add_reg_note (insn, REG_UNUSED, gen_rtx_REG (GET_MODE (d), r)); if (dump_file) fprintf (dump_file, "note set reg %d size %d\n", r, GET_MODE_SIZE (GET_MODE (d))); for (i = 0; i < GET_MODE_SIZE (GET_MODE (d)); i ++) |