diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2018-11-30 20:15:56 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@redhat.com> | 2018-11-30 20:15:56 +0000 |
commit | a6fe004b483a14900cd8ea1415d3a94d7a89fa7b (patch) | |
tree | dcaf0b373a2f1c955e18ce034d8c0952bda239bb /gcc/lra-constraints.c | |
parent | 04888aefb49ab851075b54ad06fc2b315c7447c7 (diff) |
2018-11-30 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/88179
* lra-constraints.c (address_eliminator::address_eliminator):
Don't eleminate regs in illegitimate address.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@266682 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 10 |
1 files changed, 8 insertions, 2 deletions
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); } } |