On 09/23/14 04:51, Felix Yang wrote:
Hi,

     Ignore the previous message.
     Attached please find the updated patch.
     Bootstrapped on x86_64-suse-linux. Please apply this patch if OK for trunk.

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog    (revision 215500)
+++ gcc/ChangeLog    (working copy)
@@ -1,3 +1,8 @@
+2014-09-23  Felix Yang  <felix.y...@huawei.com>
+
+    * ira.c (update_equiv_regs): Check all definitions for a multiple-set
+    register to make sure that the RHS have the same value.
+
  2014-09-23  Ilya Enkovich  <ilya.enkov...@intel.com>

      * cfgcleanup.c (try_optimize_cfg): Do not remove label
Index: gcc/ira.c
===================================================================
--- gcc/ira.c    (revision 215500)
+++ gcc/ira.c    (working copy)
@@ -3467,16 +3467,43 @@ update_equiv_regs (void)
        if (note && GET_CODE (XEXP (note, 0)) == EXPR_LIST)
          note = NULL_RTX;

-      if (DF_REG_DEF_COUNT (regno) != 1
-          && (! note
+      if (DF_REG_DEF_COUNT (regno) != 1)
+        {
+          rtx list;
This should probably be "rtx_insn_list list".

+          list = reg_equiv[regno].init_insns;
+          for (; list; list = XEXP (list, 1))
Please use the next/insn member functions of the rtx_insn_list rather than the old style XEXP accessor macros.


+        {
+          rtx note_tmp, insn_tmp;
+          insn_tmp = XEXP (list, 0);
+          note_tmp = find_reg_note (insn_tmp, REG_EQUAL, NULL_RTX);
+
+          if (note_tmp == 0
+              || ! rtx_equal_p (XEXP (note, 0), XEXP (note_tmp, 0)))
Under what conditions did you find an insn on this list that did not have a note? There's a deeper question I'm getting to, but let's start here.

Rather than use "== 0", if you have an RTX use "== NULL_RTX". That applies to the note_tmp == 0 test above.


Can you make the edits noted above & answer the question WRT insns on the reg_equiv[].init_insns list without notes and repost?

Thanks,
Jeff

Reply via email to