This is the mail archive of the gcc-help@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: Can I force gcc not to optimize calling to leaf functions with `-O2' option?


"PRC" <panruochen@gmail.com> writes:

> I wonder if I can inform gcc not to optimize calling to leaf functions.

What you describe is not an optimization of calling leaf functions,
it's an optimization when the last action a function takes is to call
another function.  There are a couple of names for this optimization.
gcc calls it a sibling call.  The option to turn it off is
-fno-optimize-sibling-calls.

Ian


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