This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rtl-optimization]: Fix PR60851, ICE: in extract_constrain_insn_cached, at recog.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>, Vladimir Makarov <vmakarov at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 19 Mar 2015 08:44:17 +0100
- Subject: Re: [PATCH, rtl-optimization]: Fix PR60851, ICE: in extract_constrain_insn_cached, at recog.c
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4Yn6qg6gzD_n0-VCjg9Vuq3FaWsjERMGB=Ynj=dNhDwbQ at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Mar 18, 2015 at 08:00:33PM +0100, Uros Bizjak wrote:
> 2015-03-18 Uros Bizjak <ubizjak@gmail.com>
>
> PR rtl-optimization/60851
> * recog.c (constrain_operands): Accept a pseudo register before reload
> for LRA enabled targets.
>
> --- recog.c (revision 221493)
> +++ recog.c (working copy)
> @@ -2775,6 +2775,10 @@ constrain_operands (int strict, alternative_mask a
> /* Before reload, accept what reload can turn
> into mem. */
> || (strict < 0 && CONSTANT_P (op))
> + /* Before reload, accept a pseudo,
> + since LRA can turn it into mem. */
> + || (targetm.lra_p () && strict < 0 && REG_P (op)
> + && REGNO (op) >= FIRST_PSEUDO_REGISTER)
> /* During reload, accept a pseudo */
> || (reload_in_progress && REG_P (op)
> && REGNO (op) >= FIRST_PSEUDO_REGISTER)))
This looks reasonable to me, but please give Vlad an extra day to comment on
it.
As the two adjacent conditions are mostly the same, perhaps it might be
better written as
|| ((/* Before reload, accept a pseudo, since
LRA can turn it into a mem.
(targetm.lra_p () && strict < 0)
/* During reload, accept a pseudo. */
|| reload_in_progress)
&& REG_P (op)
&& REGNO (op) >= FIRST_PSEUDO_REGISTER)))
or put REG_P && REGNO checks first and only then test when.
For 4.9 backport, please wait a few days after it goes into the trunk.
Jakub