From 9cb95c07fae669d450a0d29579e300ff52b45822 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Fri, 30 Nov 2018 20:15:56 +0000 Subject: [PATCH] re PR rtl-optimization/88179 ([MIPS] pr84941.c ICE in lra_eliminate_reg_if_possible at lra-eliminations.c:1393 start with r266385) 2018-11-30 Vladimir Makarov PR rtl-optimization/88179 * lra-constraints.c (address_eliminator::address_eliminator): Don't eleminate regs in illegitimate address. From-SVN: r266682 --- gcc/ChangeLog | 6 ++++++ gcc/lra-constraints.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7cda0b4191a..29e42c000d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-30 Vladimir Makarov + + PR rtl-optimization/88179 + * lra-constraints.c (address_eliminator::address_eliminator): + Don't eleminate regs in illegitimate address. + 2018-11-30 David Malcolm PR preprocessor/88257 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 88546d2138a..04a90723aab 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -359,14 +359,20 @@ address_eliminator::address_eliminator (struct address_info *ad) if (m_base_loc != NULL) { m_base_reg = *m_base_loc; - lra_eliminate_reg_if_possible (m_base_loc); + /* If we have non-legitimate address which is decomposed not in + the way we expected, don't do elimination here. In such case + the address will be reloaded and elimination will be done in + reload insn finally. */ + if (REG_P (m_base_reg)) + lra_eliminate_reg_if_possible (m_base_loc); if (m_ad->base_term2 != NULL) *m_ad->base_term2 = *m_ad->base_term; } if (m_index_loc != NULL) { m_index_reg = *m_index_loc; - lra_eliminate_reg_if_possible (m_index_loc); + if (REG_P (m_index_reg)) + lra_eliminate_reg_if_possible (m_index_loc); } } -- 2.30.2