From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>,
Peter Bergner <bergner@vnet.ibm.com>
Cc: Andrew Pinski <pinskia@gmail.com>,
GCC Patches <gcc-patches@gcc.gnu.org>, Jeff Law <law@redhat.com>,
Vladimir Makarov <vmakarov@redhat.com>,
"Bill Schmidt" <wschmidt@linux.vnet.ibm.com>
Subject: [PATCH] Fix aarch64 fallout of [PATCH, LRA] Fix PR rtl-optimization 77289, LRA matching constraint problem
Date: Mon, 12 Sep 2016 14:05:00 -0000 [thread overview]
Message-ID: <AM4PR0701MB21620B0A84C1D7F82A0DC706E4FF0@AM4PR0701MB2162.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <57D6A451.1030700@foss.arm.com>
[-- Attachment #1: Type: text/plain, Size: 158 bytes --]
Hi,
the attached patch boot-straps and reg-tests cleanly
on x86_64-pc-linux-gnu, powerpc and aarch64 targets.
Is it OK for trunk?
Thanks
Bernd.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-pr77289.diff --]
[-- Type: text/x-patch; name="patch-pr77289.diff", Size: 4027 bytes --]
2016-09-12 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR rtl-optimization/77289
* lra-constraints.c (get_final_hard_regno): Removed.
(get_hard_regno): Add new parameter final_p.
(get_reg_class): Directly call lra_get_elimination_hard_regno.
(operands_match_p): Adjust call to get_hard_regno.
(uses_hard_regs_p): Likewise.
(process_alt_operands): Likewise.
Index: gcc/lra-constraints.c
===================================================================
--- gcc/lra-constraints.c (revision 240073)
+++ gcc/lra-constraints.c (working copy)
@@ -182,27 +182,15 @@ get_try_hard_regno (int regno)
return ira_class_hard_regs[rclass][0];
}
-/* Return the final hard regno which will be after elimination.
- We do this because the final hard regno could have a different class. */
-static int
-get_final_hard_regno (int regno)
-{
- if (! HARD_REGISTER_NUM_P (regno))
- regno = lra_get_regno_hard_regno (regno);
- if (regno < 0)
- return regno;
- return lra_get_elimination_hard_regno (regno);
-}
-
/* Return the hard regno of X after removing its subreg. If X is not
a register or a subreg of a register, return -1. If X is a pseudo,
- use its assignment. We do not process register eliminiations while
- matching constraints. See PR77289. */
+ use its assignment. If FINAL_P return the final hard regno which will
+ be after elimination. */
static int
-get_hard_regno (rtx x)
+get_hard_regno (rtx x, bool final_p)
{
rtx reg;
- int offset, hard_regno;
+ int hard_regno;
reg = x;
if (SUBREG_P (x))
@@ -213,11 +201,12 @@ static int
hard_regno = lra_get_regno_hard_regno (hard_regno);
if (hard_regno < 0)
return -1;
- offset = 0;
+ if (final_p)
+ hard_regno = lra_get_elimination_hard_regno (hard_regno);
if (SUBREG_P (x))
- offset += subreg_regno_offset (hard_regno, GET_MODE (reg),
- SUBREG_BYTE (x), GET_MODE (x));
- return hard_regno + offset;
+ hard_regno += subreg_regno_offset (hard_regno, GET_MODE (reg),
+ SUBREG_BYTE (x), GET_MODE (x));
+ return hard_regno;
}
/* If REGNO is a hard register or has been allocated a hard register,
@@ -229,11 +218,11 @@ get_reg_class (int regno)
{
int hard_regno;
- if ((hard_regno = regno) >= FIRST_PSEUDO_REGISTER)
+ if (! HARD_REGISTER_NUM_P (hard_regno = regno))
hard_regno = lra_get_regno_hard_regno (regno);
if (hard_regno >= 0)
{
- hard_regno = get_final_hard_regno (hard_regno);
+ hard_regno = lra_get_elimination_hard_regno (hard_regno);
return REGNO_REG_CLASS (hard_regno);
}
if (regno >= new_regno_start)
@@ -694,7 +683,7 @@ operands_match_p (rtx x, rtx y, int y_hard_regno)
{
int j;
- i = get_hard_regno (x);
+ i = get_hard_regno (x, false);
if (i < 0)
goto slow;
@@ -1713,7 +1702,7 @@ uses_hard_regs_p (rtx x, HARD_REG_SET set)
if (REG_P (x))
{
- x_hard_regno = get_final_hard_regno (REGNO (x));
+ x_hard_regno = get_hard_regno (x, true);
return (x_hard_regno >= 0
&& overlaps_hard_reg_set_p (set, mode, x_hard_regno));
}
@@ -1840,7 +1829,7 @@ process_alt_operands (int only_alternative)
op = no_subreg_reg_operand[nop] = *curr_id->operand_loc[nop];
/* The real hard regno of the operand after the allocation. */
- hard_regno[nop] = get_hard_regno (op);
+ hard_regno[nop] = get_hard_regno (op, true);
operand_reg[nop] = reg = op;
biggest_mode[nop] = GET_MODE (op);
@@ -2001,7 +1990,7 @@ process_alt_operands (int only_alternative)
lra_assert (nop > m);
this_alternative_matches = m;
- m_hregno = get_hard_regno (*curr_id->operand_loc[m]);
+ m_hregno = get_hard_regno (*curr_id->operand_loc[m], false);
/* We are supposed to match a previous operand.
If we do, we win if that one did. If we do
not, count both of the operands as losers.
next prev parent reply other threads:[~2016-09-12 13:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-11 20:53 Bernd Edlinger
2016-09-11 21:11 ` Peter Bergner
2016-09-12 13:24 ` Kyrill Tkachov
2016-09-12 14:05 ` Bernd Edlinger [this message]
2016-09-12 21:54 ` [PATCH] Fix aarch64 fallout of " Jeff Law
2016-09-12 22:06 ` Bernd Edlinger
2016-09-13 20:03 ` 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=AM4PR0701MB21620B0A84C1D7F82A0DC706E4FF0@AM4PR0701MB2162.eurprd07.prod.outlook.com \
--to=bernd.edlinger@hotmail.de \
--cc=bergner@vnet.ibm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kyrylo.tkachov@foss.arm.com \
--cc=law@redhat.com \
--cc=pinskia@gmail.com \
--cc=vmakarov@redhat.com \
--cc=wschmidt@linux.vnet.ibm.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).