Commit 55dcc361 by Alan Modra Committed by Alan Modra

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
parent 466cf574
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> 2016-07-01 Yuri Rumyantsev <ysrumyan@gmail.com>
PR tree-optimization/70729 PR tree-optimization/70729
......
...@@ -1014,7 +1014,7 @@ find_call_crossed_cheap_reg (rtx_insn *insn) ...@@ -1014,7 +1014,7 @@ find_call_crossed_cheap_reg (rtx_insn *insn)
break; break;
} }
if (reg_overlap_mentioned_p (reg, PATTERN (prev))) if (reg_set_p (reg, prev))
break; break;
} }
prev = PREV_INSN (prev); prev = PREV_INSN (prev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment