aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira-lives.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-07-01 20:45:17 +0930
committerAlan Modra <amodra@gcc.gnu.org>2016-07-01 20:45:17 +0930
commit55dcc361e67fb135be96f5e80e93ee98304b3c1e (patch)
tree5ab3fb691d7f0c24f34cdd3ade7d2c0354bed2e0 /gcc/ira-lives.c
parent466cf5747f1a203800c3118f3fcec04ecb6f9d39 (diff)
downloadgcc-55dcc361e67fb135be96f5e80e93ee98304b3c1e.zip
gcc-55dcc361e67fb135be96f5e80e93ee98304b3c1e.tar.gz
gcc-55dcc361e67fb135be96f5e80e93ee98304b3c1e.tar.bz2
strcpy arg optimised out
For functions that return an argument unchanged, like strcat, find_call_crossed_cheap_reg attempts to find an assignment between a pseudo reg and the arg reg before the call, so that uses of the pseudo after the call can instead use the return value. The exit condition on the loop looking at previous insns was wrong. Uses of the arg reg don't matter. What matters is the insn setting the arg reg as any assignment involving the arg reg prior to that insn is likely a completely unrelated use of the hard reg. PR rtl-optimization/71709 * ira-lives.c (find_call_crossed_cheap_reg): Exit loop on arg reg being set, not referenced. From-SVN: r237909
Diffstat (limited to 'gcc/ira-lives.c')
-rw-r--r--gcc/ira-lives.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 6950ffb..6b7ee81 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -1014,7 +1014,7 @@ find_call_crossed_cheap_reg (rtx_insn *insn)
break;
}
- if (reg_overlap_mentioned_p (reg, PATTERN (prev)))
+ if (reg_set_p (reg, prev))
break;
}
prev = PREV_INSN (prev);