Can a C compiler rearrange stack variables?

前端 未结 11 2317
孤街浪徒
孤街浪徒 2020-12-09 11:07

I have worked on projects for embedded systems in the past where we have rearranged the order of declaration of stack variables to decrease the size of the resulting executa

11条回答
  •  被撕碎了的回忆
    2020-12-09 11:31

    The compiler is even free to remove the variable from the stack and make it register only if analysis shows that the address of the variable is never taken/used.

提交回复
热议问题