summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-30 06:53:31 +0000
committerxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-30 06:53:31 +0000
commit48c8dd80ebccb45a49f2fbdc1a4ea260e46db5cd (patch)
treecddc971ff059f063a09fd2eca1f25f0cdfba0a8f /gcc/function.c
parent8f0676e4332d2dc462bfce8a42b265966ef1f982 (diff)
downloadlinaro-gcc-48c8dd80ebccb45a49f2fbdc1a4ea260e46db5cd.tar.gz
linaro-gcc-48c8dd80ebccb45a49f2fbdc1a4ea260e46db5cd.tar.bz2
linaro-gcc-48c8dd80ebccb45a49f2fbdc1a4ea260e46db5cd.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201326 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c49
1 files changed, 36 insertions, 13 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 3e33fc70632..953fd48b2ad 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