This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Expand sibling-tail-calls via accumulator register
- From: Kai Tietz <ktietz at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 28 May 2014 17:28:31 -0400 (EDT)
- Subject: Re: [patch i386]: Expand sibling-tail-calls via accumulator register
- Authentication-results: sourceware.org; auth=none
- References: <356718653 dot 5712706 dot 1400794422397 dot JavaMail dot zimbra at redhat dot com> <20140526183208 dot GG10386 at tucnak dot redhat dot com> <1487116948 dot 8449887 dot 1401132170121 dot JavaMail dot zimbra at redhat dot com> <20140526193543 dot GH10386 at tucnak dot redhat dot com> <625132578 dot 8474723 dot 1401136339171 dot JavaMail dot zimbra at redhat dot com> <643791243 dot 10265346 dot 1401266636155 dot JavaMail dot zimbra at redhat dot com> <53861B5B dot 2060705 at redhat dot com> <53863559 dot 6080505 at redhat dot com>
----- Original Message -----
> On 05/28/14 11:22, Richard Henderson wrote:
> > On 05/28/2014 01:43 AM, Kai Tietz wrote:
> >> + if (GET_CODE (op) == CONST)
> >> + op = XEXP (op, 0);
> >> + return (GET_CODE (op) == SYMBOL_REF || CONSTANT_P (op));
> >
> > Surely all this boils down to just CONSTANT_P (op),
> > without having to look through the CONST at all.
> Something certainly seems odd there.
>
> Kai, is your intention to detect symbol_ref + const_int? Isn't the
> canonical form for that:
>
> (const (plus (symbol_ref) (const_int))?
>
> It appears to me the code above looks for
>
> (const (symbol_ref))
>
> or
>
> (const (const_int))
>
> ?!?
>
> Jeff
>
Yes, I missed the plus-part.
I am just running bootstrap with regression testing for altering predicate to:
(define_predicate "sibcall_memory_operand"
(match_operand 0 "memory_operand")
{
op = XEXP (op, 0);
if (GET_CODE (op) == CONST)
op = XEXP (op, 0);
if (GET_CODE (op) == PLUS && CONSTANT_P (XEXP (op, 0)))
op = XEXP (op, 1);
return CONSTANT_P (op);
})
Kai