トップ «前の日記(2013-06-24) 最新 次の日記(2013-06-26)» 編集

ヨタの日々

2001|08|09|10|11|12|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|12|
2024|01|02|03|04|

2013-06-25 :-(

_ 午前

0520 起床

0900 ガジェット

_ 午後

1300 ガジェット

_

1800 ガジェット

2320 退勤

2430 飯

_ [C]C

#include <stdio.h>

int main(int ac, char** av)
{
    int a = 10;
    while(a != 10)
    {
        a = 10;
    }
    return 0;
}

普通に見てみる。

% gcc -S while0.c
    .file    "while0.c"
    .def    ___main;    .scl    2;    .type    32;    .endef
    .text
.globl _main
    .def    _main;    .scl    2;    .type    32;    .endef
_main:
    pushl    %ebp
    movl    %esp, %ebp
    andl    $-16, %esp
    subl    $16, %esp
    call    ___main
    movl    $10, 12(%esp)
    jmp    L2
L3:
    movl    $10, 12(%esp)
L2:
    cmpl    $10, 12(%esp)
    jne    L3
    movl    $0, %eax
    leave
    ret

最適化してみる。

% gcc -O3 -S while0.c
    .file    "while0.c"
    .def    ___main;    .scl    2;    .type    32;    .endef
    .text
    .p2align 4,,15
.globl _main
    .def    _main;    .scl    2;    .type    32;    .endef
_main:
    pushl    %ebp
    movl    %esp, %ebp
    andl    $-16, %esp
    call    ___main
    xorl    %eax, %eax
    movl    %ebp, %esp
    popl    %ebp
    ret

まあたしかに「代入」されてないような。