public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Felix Yang <fei.yang0953@gmail.com>
Cc: "Yangfei (Felix)" <felix.yang@huawei.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>,
	       "vmakarov@redhat.com" <vmakarov@redhat.com>
Subject: Re: [PATCH IRA] update_equiv_regs fails to set EQUIV reg-note for pseudo with more than one definition
Date: Mon, 29 Sep 2014 21:44:00 -0000	[thread overview]
Message-ID: <5429D2C5.2090203@redhat.com> (raw)
In-Reply-To: <CAFc0fxwiqbg5GHzXJczWCP1s7OWs-BKPfuwi1NiA9CwiYPUw5w@mail.gmail.com>

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	other threads:[~2014-09-29 21:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 14:40 Felix Yang
2014-09-22 18:40 ` Jeff Law
2014-09-23  2:48   ` Yangfei (Felix)
2014-09-23 10:46     ` Felix Yang
2014-09-23 10:51       ` Felix Yang
2014-09-23 17:49         ` Jeff Law
2014-09-24 12:07           ` Felix Yang
2014-09-24 21:56             ` Felix Yang
2014-09-25  4:07               ` [PING PATCH " Yangfei (Felix)
2014-09-25 18:57             ` [PATCH " Jeff Law
2014-09-26 13:57               ` Felix Yang
2014-09-26 21:03                 ` Jeff Law
2014-09-27 14:48                   ` Felix Yang
2014-09-29 21:44                     ` Jeff Law [this message]
2014-10-11 13:13                       ` Felix Yang
2014-10-13 20:30                         ` Jeff Law
2015-02-02 15:59                         ` Alex Velenko
2015-02-03  7:24                           ` Jeff Law
2015-02-03  8:29                             ` Bin.Cheng
2015-02-03 12:42                               ` Alex Velenko
2015-02-03 16:28                               ` Jeff Law
2015-02-04  3:03                                 ` Bin.Cheng
2015-02-09 23:32                                   ` Jeff Law
2015-02-10 10:51                                     ` Ajit Kumar Agarwal
2015-02-10 15:46                                       ` Jeff Law
2015-02-12 12:40                                     ` Alex Velenko
2015-02-13 23:18                                       ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5429D2C5.2090203@redhat.com \
    --to=law@redhat.com \
    --cc=fei.yang0953@gmail.com \
    --cc=felix.yang@huawei.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=vmakarov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).