Относительно оптимизации для «не statment» в c?
Изучая Оптимизацию компилятора, я пишу коды наC
подLinux
сGCC
версияgcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5.1)
Для постоянногоnot a statement
(нет) в C. Я сначала написал два кодаy.c
второйx.c
а такжеgenerate their compiled assembly code
с помощьюgcc -S
вариант.
Кулак кодy.c
desktop:~$ cat y.c
main()
{
int i=0;
}
desktop:~$ gcc -S y.c
desktop:~$
Второй кодx.c
desktop:~$ cat x.c
main()
{
int i=0;
/* Loops and if*/
while(0);
for(;0;);
if(0);
/* Arithmetic Operations */
i * i;
i / i;
i - i;
i + i;
i % i;
+i;
-i;
/* Comparison operators */
i == i;
i != i;
i < i;
i > i;
i >= i;
i