On 09/27/14 08:48, Felix Yang wrote:
Thanks for the explaination.
I have changed the loop_depth into a short interger hoping that we can
save some memory :-)
Thanks.

Attached please find the updated patch. Bootstrapped and reg-tested on
x86_64-suse-linux.
Please do a final revew once the assignment is ready.

As for the new list walking interface, I choose the function
"no_equiv" and tried the "checked cast" way.
The bad news is that GCC failed to bootstrap with the following change:

Index: ira.c
===================================================================
--- ira.c (revision 215536)
+++ ira.c (working copy)
@@ -3242,12 +3242,12 @@ no_equiv (rtx reg, const_rtx store ATTRIBUTE_UNUSE
    void *data ATTRIBUTE_UNUSED)
  {
    int regno;
-  rtx list;
+  rtx_insn_list *list;

    if (!REG_P (reg))
      return;
    regno = REGNO (reg);
-  list = reg_equiv[regno].init_insns;
+  list = as_a <rtx_insn_list *> (reg_equiv[regno].init_insns);
    if (list == const0_rtx)
      return;
    reg_equiv[regno].init_insns = const0_rtx;
@@ -3258,9 +3258,9 @@ no_equiv (rtx reg, const_rtx store ATTRIBUTE_UNUSE
      return;
    ira_reg_equiv[regno].defined_p = false;
    ira_reg_equiv[regno].init_insns = NULL;
-  for (; list; list =  XEXP (list, 1))
+  for (; list; list = list->next ())
      {
-      rtx insn = XEXP (list, 0);
+      rtx_insn *insn = list->insn ();
        remove_note (insn, find_reg_note (insn, REG_EQUIV, NULL_RTX));
      }
  }
Yea. I'm going to post a patch shortly to go ahead with this conversion. There's a couple issues that come into play.

First const0_rtx is not an INSN, so we *really* don't want it in the INSN field of an INSN_LIST. That's probably the ICE you're seeing.

const0_rtx is being used to mark pseudos which we've already determined can't have a valid equivalence. So we just need a different marker. That different marker must be embeddable in an INSN_LIST node. The easiest is just a NULL insn ;-)

The other tests for the const0_rtx marker in ira.c need relatively trivial updating. And in the end we don't need the checked cast at all ;-)



Jeff

Reply via email to