From: Jeff Law <law@redhat.com>
To: Felix Yang <fei.yang0953@gmail.com>,
"Yangfei (Felix)" <felix.yang@huawei.com>
Cc: 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: Tue, 23 Sep 2014 17:49:00 -0000 [thread overview]
Message-ID: <5421B28F.1030006@redhat.com> (raw)
In-Reply-To: <CAFc0fxyu257uDv4twJiFUGd-g60NZLGyDNyQthDHwtwvPaXRpQ@mail.gmail.com>
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.yang@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.enkovich@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
next prev parent reply other threads:[~2014-09-23 17:49 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 [this message]
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
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=5421B28F.1030006@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).