This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [C++] speedup cp_tree_chain_matters_p
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 30 Mar 2004 19:52:55 -0500
- Subject: Re: [PATCH] [C++] speedup cp_tree_chain_matters_p
- References: <9030818B-820A-11D8-99F1-000393A6D2F2@physics.uc.edu> <87oeqerbwy.fsf@codesourcery.com>
On Mar 30, 2004, at 03:12, Zack Weinberg wrote:
Andrew Pinski <pinskia@physics.uc.edu> writes:
This patch speeds up cp_tree_chain_matters_p by allowing the last call
be sibcalled.
Bootstrapped and tested on powerpc-apple-darwin with no regressions.
OK?
No. Find out why sibcall optimization doesn't trigger for the
original code and fix that instead.
The reason why it is not sibcalled is because c_tree_chain_matters_p
returns an int so the || statement becomes f()!=0||g()!=0 which becomes
if (f()!=0)
return true;
return g()!=0;
So one thing to do is change the return type c_tree_chain_matters_p to
return bool but that will still not fix it.
This example is not sibcalled at all:
_Bool f();
_Bool g();
_Bool h()
{
return f() || g();
}
Thanks,
Andrew Pinski