Commit b871a06f by Alan Modra Committed by Alan Modra

re PR target/64876 (Regressions in gcc-testresults for powerpc64 gccgo in 5.0…

re PR target/64876 (Regressions in gcc-testresults for powerpc64 gccgo in 5.0 due to change for static chain for closures (219776))

	PR target/64876
	* config/rs6000/rs6000.c (chain_already_loaded): New function.
	(rs6000_call_aix): Use it.

From-SVN: r220463
parent 2f72ca14
2015-02-06 Alan Modra <amodra@gmail.com>
PR target/64876
* config/rs6000/rs6000.c (chain_already_loaded): New function.
(rs6000_call_aix): Use it.
2015-02-05 Jan Hubicka <hubicka@ucw.cz>
* ipa-cp.c (ipa_value_from_jfunc, ipa_context_from_jfunc): Add bounds
......
......@@ -32919,6 +32919,28 @@ rs6000_legitimate_constant_p (machine_mode mode, rtx x)
}
/* Return TRUE iff the sequence ending in LAST sets the static chain. */
static bool
chain_already_loaded (rtx_insn *last)
{
for (; last != NULL; last = PREV_INSN (last))
{
if (NONJUMP_INSN_P (last))
{
rtx patt = PATTERN (last);
if (GET_CODE (patt) == SET)
{
rtx lhs = XEXP (patt, 0);
if (REG_P (lhs) && REGNO (lhs) == STATIC_CHAIN_REGNUM)
return true;
}
}
}
return false;
}
/* Expand code to perform a call under the AIX or ELFv2 ABI. */
......@@ -33002,7 +33024,9 @@ rs6000_call_aix (rtx value, rtx func_desc, rtx flag, rtx cookie)
originally direct, the 3rd word has not been written since no
trampoline has been built, so we ought not to load it, lest we
override a static chain value. */
if (!direct_call_p && TARGET_POINTERS_TO_NESTED_FUNCTIONS)
if (!direct_call_p
&& TARGET_POINTERS_TO_NESTED_FUNCTIONS
&& !chain_already_loaded (crtl->emit.sequence_stack->last))
{
rtx sc_reg = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
rtx func_sc_offset = GEN_INT (2 * GET_MODE_SIZE (Pmode));
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