調べたこと、作ったことをメモしています。
こちらに移行中: https://blog.shimazu.me/

gcc

Valgrind with gcc

Link: Valgrind with gcc <blockquote class="link_og_blockquote">Official Home Page for valgrind, a suite of tools for debugging and profiling. Automatically detect memory management and threading bugs, and perform detailed profiling. The current stable version is valgrind-3.8.1.</blockquote><p></p>

2の乗数での剰余使った分岐

結論としてはいい感じに最適化してくれた。 環境はgcc 4.7.3で最適化レベルは3でやった。 while( 1 ) { if ( counter % 2 ) { 8048308: 8b 44 24 08 mov 0x8(%esp),%eax 804830c: a8 01 test $0x1,%al 804830e: 74 0b je 804831b <main+0x2b> flag++; 8048310: 8b 44 24</main+0x2b>…