diff options
author | Zhenqiang Chen <zhenqiang.chen@linaro.org> | 2013-07-30 06:53:31 +0000 |
---|---|---|
committer | Xuepeng Guo <xguo@gcc.gnu.org> | 2013-07-30 06:53:31 +0000 |
commit | 14a8763670981928cef330b7bf8c0244bb982a29 (patch) | |
tree | cddc971ff059f063a09fd2eca1f25f0cdfba0a8f /gcc/function.c | |
parent | 0100cd3f7e52acbf862e6c46e5d56c348fffb88c (diff) | |
download | gcc-14a8763670981928cef330b7bf8c0244bb982a29.zip gcc-14a8763670981928cef330b7bf8c0244bb982a29.tar.gz gcc-14a8763670981928cef330b7bf8c0244bb982a29.tar.bz2 |
re PR rtl-optimization/57637 (Miscompare on 178.galgel in SPEC2000 on arm)
gcc/
2013-07-30 Zhenqiang Chen <zhenqiang.chen@linaro.org>
PR rtl-optimization/57637
* function.c (move_insn_for_shrink_wrap): Also check the
GEN set of the LIVE problem for the liveness analysis
if it exists, otherwise give up.
gcc/testsuite/
2013-07-30 Zhenqiang Chen <zhenqiang.chen@linaro.org>
* gcc.target/arm/pr57637.c: New testcase.
From-SVN: r201326
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/gcc/function.c b/gcc/function.c index 3e33fc7..953fd48 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5506,22 +5506,45 @@ move_insn_for_shrink_wrap (basic_block bb, rtx insn, except for any part that overlaps SRC (next loop). */ bb_uses = &DF_LR_BB_INFO (bb)->use; bb_defs = &DF_LR_BB_INFO (bb)->def; - for (i = dregno; i < end_dregno; i++) + if (df_live) { - if (REGNO_REG_SET_P (bb_uses, i) || REGNO_REG_SET_P (bb_defs, i)) - next_block = NULL; - CLEAR_REGNO_REG_SET (live_out, i); - CLEAR_REGNO_REG_SET (live_in, i); - } + for (i = dregno; i < end_dregno; i++) + { + if (REGNO_REG_SET_P (bb_uses, i) || REGNO_REG_SET_P (bb_defs, i) + || REGNO_REG_SET_P (&DF_LIVE_BB_INFO (bb)->gen, i)) + next_block = NULL; + CLEAR_REGNO_REG_SET (live_out, i); + CLEAR_REGNO_REG_SET (live_in, i); + } - /* Check whether BB clobbers SRC. We need to add INSN to BB if so. - Either way, SRC is now live on entry. */ - for (i = sregno; i < end_sregno; i++) + /* Check whether BB clobbers SRC. We need to add INSN to BB if so. + Either way, SRC is now live on entry. */ + for (i = sregno; i < end_sregno; i++) + { + if (REGNO_REG_SET_P (bb_defs, i) + || REGNO_REG_SET_P (&DF_LIVE_BB_INFO (bb)->gen, i)) + next_block = NULL; + SET_REGNO_REG_SET (live_out, i); + SET_REGNO_REG_SET (live_in, i); + } + } + else { - if (REGNO_REG_SET_P (bb_defs, i)) - next_block = NULL; - SET_REGNO_REG_SET (live_out, i); - SET_REGNO_REG_SET (live_in, i); + /* DF_LR_BB_INFO (bb)->def does not comprise the DF_REF_PARTIAL and + DF_REF_CONDITIONAL defs. So if DF_LIVE doesn't exist, i.e. + at -O1, just give up searching NEXT_BLOCK. */ + next_block = NULL; + for (i = dregno; i < end_dregno; i++) + { + CLEAR_REGNO_REG_SET (live_out, i); + CLEAR_REGNO_REG_SET (live_in, i); + } + + for (i = sregno; i < end_sregno; i++) + { + SET_REGNO_REG_SET (live_out, i); + SET_REGNO_REG_SET (live_in, i); + } } /* If we don't need to add the move to BB, look for a single |