"PRC" <panruochen@xxxxxxxxx> 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