Currently reg_dead_at_p returns 0 for registers that are set but never
used.  This patch repairs that oversight.  This fixes PR59278.


2014-11-27  Segher Boessenkool  <seg...@kernel.crashing.org>

gcc/
        PR rtl-optimization/59278
        combine (reg_dead_at_p): Consider REG_UNUSED notes.

---
 gcc/combine.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/combine.c b/gcc/combine.c
index 83a0a10..91ddff4 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -12990,6 +12990,9 @@ reg_dead_at_p (rtx reg, rtx_insn *insn)
     {
       if (INSN_P (insn))
         {
+         if (find_regno_note (insn, REG_UNUSED, reg_dead_regno))
+           return 1;
+
          note_stores (PATTERN (insn), reg_dead_at_p_1, NULL);
          if (reg_dead_flag)
            return reg_dead_flag == 1 ? 1 : 0;
-- 
1.8.1.4

Reply via email to