summaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2019-07-10 16:07:10 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2019-07-10 16:07:10 +0000
commit613caed2feb9cfc8158308670b59df3d031ec629 (patch)
treea7a6e3e8f35c31ba35b57e041c14eab9ac773965 /gcc/lra-constraints.c
parent12bb04368e7fcbdd8d3744a440eee23c9293958f (diff)
re PR target/91102 (aarch64 ICE on Linux kernel with -Os starting with r270266)
2019-07-10 Vladimir Makarov <vmakarov@redhat.com> PR target/91102 * lra-constraints.c (process_alt_operands): Don't match user defined regs only if they are early clobbers. 2019-07-10 Vladimir Makarov <vmakarov@redhat.com> PR target/91102 * gcc.target/aarch64/pr91102.c: New test. From-SVN: r273357
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index d1d99e01cde..55d8d133d39 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -2172,8 +2172,9 @@ process_alt_operands (int only_alternative)
else
{
/* Operands don't match. If the operands are
- different user defined explicit hard registers,
- then we cannot make them match. */
+ different user defined explicit hard
+ registers, then we cannot make them match
+ when one is early clobber operand. */
if ((REG_P (*curr_id->operand_loc[nop])
|| SUBREG_P (*curr_id->operand_loc[nop]))
&& (REG_P (*curr_id->operand_loc[m])
@@ -2192,9 +2193,17 @@ process_alt_operands (int only_alternative)
&& REG_P (m_reg)
&& HARD_REGISTER_P (m_reg)
&& REG_USERVAR_P (m_reg))
- break;
+ {
+ int i;
+
+ for (i = 0; i < early_clobbered_regs_num; i++)
+ if (m == early_clobbered_nops[i])
+ break;
+ if (i < early_clobbered_regs_num
+ || early_clobber_p)
+ break;
+ }
}
-
/* Both operands must allow a reload register,
otherwise we cannot make them match. */
if (curr_alt[m] == NO_REGS)