diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-12 21:24:40 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-12 21:24:40 +0000 |
commit | 490aa3a5f950802a63e6a5cf69074a071ee75d32 (patch) | |
tree | 1e88256bef0a3bccd655c38fe76b924cd24e59c5 /gcc/sched-deps.c | |
parent | 5663a70936a9f09291707d8995c466de63c641e8 (diff) | |
download | gcc-490aa3a5f950802a63e6a5cf69074a071ee75d32.tar.gz |
PR target/62025
* sched-deps.c (find_inc): Check if inc_insn doesn't clobber
any registers that are used in mem_insn.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213887 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r-- | gcc/sched-deps.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 51c1a011496..049927fe6e0 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -4751,6 +4751,24 @@ find_inc (struct mem_inc_info *mii, bool backwards) "inc conflicts with store failure.\n"); goto next; } + + /* The inc instruction could have clobbers, make sure those + registers are not used in mem insn. */ + FOR_EACH_INSN_DEF (def, mii->inc_insn) + if (!reg_overlap_mentioned_p (DF_REF_REG (def), mii->mem_reg0)) + { + df_ref use; + FOR_EACH_INSN_USE (use, mii->mem_insn) + if (reg_overlap_mentioned_p (DF_REF_REG (def), + DF_REF_REG (use))) + { + if (sched_verbose >= 5) + fprintf (sched_dump, + "inc clobber used in store failure.\n"); + goto next; + } + } + newaddr = mii->inc_input; if (mii->mem_index != NULL_RTX) newaddr = gen_rtx_PLUS (GET_MODE (newaddr), newaddr, |