This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR64876, regressions in powerpc64 Go testsuite
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Tue, 3 Feb 2015 15:08:01 +0100
- Subject: Re: Fix PR64876, regressions in powerpc64 Go testsuite
- Authentication-results: sourceware.org; auth=none
- References: <20150203135735 dot GJ14796 at bubble dot grove dot modra dot org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 04, 2015 at 12:27:35AM +1030, Alan Modra wrote:
> +static bool
> +chain_already_loaded (rtx_insn *last)
> +{
> + if (last != NULL)
> + {
> + 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;
> + }
> + }
> + /* This function is only called when we are about to emit a call,
> + and we know that the static chain is set just before a call, so
> + there is no need to look at previous insns. */
> + return false;
> +}
> +
> /* Expand code to perform a call under the AIX or ELFv2 ABI. */
>
> void
> @@ -33002,7 +33092,9 @@ rs6000_call_aix (rtx value, rtx func_desc, rtx fla
> 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))
Shouldn't that be !chain_already_loaded (get_last_insn_anywhere ()) ?
Jakub