This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for PR target/38056, IA64 sibcall optimization fix.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: sje at cup dot hp dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 13 Feb 2009 12:53:10 -0800
- Subject: Re: Patch for PR target/38056, IA64 sibcall optimization fix.
- References: <200902132043.n1DKha702659@lucas.cup.hp.com>
On Fri, Feb 13, 2009 at 12:43 PM, Steve Ellcey <sje@cup.hp.com> wrote:
> This patch fixes PR target/38056 and allows IA64 to do sibcall
> optimizations across object file boundries if -mconstant-gp is used.
>
> Tested on IA64 HP-UX and Linux with no regressions, I will check it in
> later today.
>
> Steve Ellcey
> sje@cup.hp.com
>
>
> 2009-02-13 Steve Ellcey <sje@cup.hp.com>
>
> PR target/38056
> * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Check
> TARGET_CONST_GP.
>
>
> Index: config/ia64/ia64.c
> ===================================================================
> --- config/ia64/ia64.c (revision 144149)
> +++ config/ia64/ia64.c (working copy)
> @@ -4365,8 +4365,9 @@ ia64_function_ok_for_sibcall (tree decl,
> return false;
>
> /* We must always return with our current GP. This means we can
> - only sibcall to functions defined in the current module. */
> - return decl && (*targetm.binds_local_p) (decl);
> + only sibcall to functions defined in the current module unless
> + TARGET_CONST_GP is set to true. */
> + return (decl && (*targetm.binds_local_p) (decl)) || TARGET_CONST_GP;
> }
>
A couple testcases will be nice.
Thanks.
--
H.J.