From: Chenghua Xu Date: Tue, 14 May 2019 01:42:59 +0000 (+0000) Subject: [MIPS] Skip forward src into next insn when the SRC reg is dead. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4dbf3a15f1b6afa0100c1b026ba13450677931c9;p=gcc.git [MIPS] Skip forward src into next insn when the SRC reg is dead. PR target/90357 gcc/ * config/mips/mips.c (mips_split_move): Skip forward SRC into next insn when the SRC reg is dead. From-SVN: r271146 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0985651503a..db8f647ec78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-05-14 Chenghua Xu + + PR target/90357 + * config/mips/mips.c (mips_split_move): Skip forward SRC into + next insn when the SRC reg is dead. + 2019-05-14 Bin Cheng * gimple-ssa-strength-reduction.c (lookup_cand): Adjust index by 1. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 1de33b28c38..89fc073c62b 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -4849,6 +4849,7 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_) can forward SRC for DEST. This is most useful if the next insn is a simple store. */ rtx_insn *insn = (rtx_insn *)insn_; + struct mips_address_info addr; if (insn) { rtx_insn *next = next_nonnote_nondebug_insn_bb (insn); @@ -4856,7 +4857,17 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_) { rtx set = single_set (next); if (set && SET_SRC (set) == dest) - validate_change (next, &SET_SRC (set), src, false); + { + if (MEM_P (src)) + { + rtx tmp = XEXP (src, 0); + mips_classify_address (&addr, tmp, GET_MODE (tmp), true); + if (REGNO (addr.reg) != REGNO (dest)) + validate_change (next, &SET_SRC (set), src, false); + } + else + validate_change (next, &SET_SRC (set), src, false); + } } } }