Assembled c++ appears to contain superfluous instructions

前端 未结 2 661
庸人自扰
庸人自扰 2021-01-18 02:26

I have a cpp file containing only the following:

void f(int* const x)
{
  (*x)*= 2;
}

I compile with:

g++ -S -masm=intel -O         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-18 02:37

    Those instructions are used to access the stack in function bodies. It is a generalization and used for debugging purposes.

提交回复
热议问题