/* * Compile with: * arm-none-linux-gnueabi-gcc -Os -c mytest.c * to get the "optimized" version * * Compile with: * arm-none-linux-gnueabi-gcc -save-temps -Os -c mytest.c * to get the "unoptimized" version */ extern unsigned long flags; #define dummy(flags) \ if (flags & 1) \ asm volatile ("mov r0, r0\n"); \ else \ asm volatile ("mov r0, r0\n"); void optimized(void) { dummy(flags); } void not_optimized(void) { if (flags & 1) asm volatile ("mov r0, r0\n"); else asm volatile ("mov r0, r0\n"); }