Thank you for the bug report. I've confirmed this with gcc-linaro-4.6+bzr106903 on x86_64:
michaelh@crucis:~/linaro/bugs$ ~/linaro/gcc/build/native-4.6/install/bin/gcc -O3 testcase3.c michaelh@crucis:~/linaro/bugs$ ./a.out m = 1
The fault is probably introduced by r106733 which added condtional store sinking support.
I've set it to high priority as bad code is generated. Likely trunk fixes include r113242, r111593, r110,443, and r114986 of lp:gcc-linaro/4.7.
Thank you for the bug report. I've confirmed this with gcc-linaro- 4.6+bzr106903 on x86_64:
michaelh@ crucis: ~/linaro/ bugs$ ~/linaro/ gcc/build/ native- 4.6/install/ bin/gcc -O3 testcase3.c crucis: ~/linaro/ bugs$ ./a.out
michaelh@
m = 1
The fault is probably introduced by r106733 which added condtional store sinking support.
I've set it to high priority as bad code is generated. Likely trunk fixes include r113242, r111593, r110,443, and r114986 of lp:gcc-linaro/4.7.