Retourner au contenu associé (journal : Informatique : Optimisation, minimisation, projet)
Posté par daggett le 13 juin 2003 à 15:47. En réponse au journal Informatique : Optimisation, minimisation, projet. Évalué à 1.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: Informatique : Optimisation, minimisation, projet
Posté par daggett . En réponse au journal Informatique : Optimisation, minimisation, projet. Évalué à 1.
$ cat postinc.c
#include <stdio.h>
int main(int argc, char **argv){
int a,i;
a = 0;
for (i=0; i<100000; i++)
a+=i;
printf(" a = %d\n", a);
return 0;
}
$ diff postinc.c preinc.c
6c6
< for (i=0; i<100000; i++)
---
> for (i=0; i<100000; ++i)
$ gcc -Wall -O0 -S postinc.c preinc.c
$ diff postinc.s preinc.s
1c1
< .file "postinc.c"
---
> .file "preinc.c"
Voila, meme en optimisation 0, aucune différence dans le code assembleur généré.