summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-01 11:15:17 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-01 11:15:17 +0000
commit79d123c1c7478ff538d15e545c9f1164a9bb756c (patch)
tree5ab3fb691d7f0c24f34cdd3ade7d2c0354bed2e0 /gcc
parented8613ec472156fe0dc2189f6f5eec0ca41694da (diff)
downloadgcc-79d123c1c7478ff538d15e545c9f1164a9bb756c.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237909 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ira-lives.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 685847bf043..6551c0ec31c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-01 Alan Modra <amodra@gmail.com>
+
+ PR rtl-optimization/71709
+ * ira-lives.c (find_call_crossed_cheap_reg): Exit loop on arg reg
+ being set, not referenced.
+
2016-07-01 Yuri Rumyantsev <ysrumyan@gmail.com>
PR tree-optimization/70729
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 6950ffb17b3..6b7ee81bea1 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);