diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-05-02 09:13:49 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-05-02 09:13:49 +0200 |
commit | 6aae324cce99057e81876888e5f83e20bad9f55d (patch) | |
tree | ded425eea0d88fb780f3a7aa47e92d5c227063ad /gcc/ree.c | |
parent | 481c45f690ae5cfeca07e86c348ddfbe0885e069 (diff) | |
download | gcc-6aae324cce99057e81876888e5f83e20bad9f55d.zip gcc-6aae324cce99057e81876888e5f83e20bad9f55d.tar.gz gcc-6aae324cce99057e81876888e5f83e20bad9f55d.tar.bz2 |
re PR rtl-optimization/53160 (likely wrong code bug)
PR rtl-optimization/53160
* ree.c (combine_reaching_defs): Handle the case where cand->insn
has been modified by ree pass already.
* gcc.c-torture/execute/pr53160.c: New test.
From-SVN: r187035
Diffstat (limited to 'gcc/ree.c')
-rw-r--r-- | gcc/ree.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -667,6 +667,24 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state) if (!outcome) return false; + /* If cand->insn has been already modified, update cand->mode to a wider + mode if possible, or punt. */ + if (state->modified[INSN_UID (cand->insn)].kind != EXT_MODIFIED_NONE) + { + enum machine_mode mode; + rtx set; + + if (state->modified[INSN_UID (cand->insn)].kind + != (cand->code == ZERO_EXTEND + ? EXT_MODIFIED_ZEXT : EXT_MODIFIED_SEXT) + || state->modified[INSN_UID (cand->insn)].mode != cand->mode + || (set = single_set (cand->insn)) == NULL_RTX) + return false; + mode = GET_MODE (SET_DEST (set)); + gcc_assert (GET_MODE_SIZE (mode) >= GET_MODE_SIZE (cand->mode)); + cand->mode = mode; + } + merge_successful = true; /* Go through the defs vector and try to merge all the definitions |