This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [C++] speedup cp_tree_chain_matters_p



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]