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
This commit is contained in:
Alan Modra 2016-07-01 20:45:17 +09:30 committed by Alan Modra
parent 466cf5747f
commit 55dcc361e6
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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);