On Fri, Sep 03, 2010, Mariano Alvira wrote:
For the problem to appear you must use -Os -march=armv4t and the volatile assignment. E.g.:
bad: arm-linux-gnueabi-gcc -Os -march=armv4t -c -o tests.o tests.c
ok: arm-linux-gnueabi-gcc -march=armv4t -c -o tests.o tests.c arm-linux-gnueabi-gcc -Os -c -o tests.o tests.c arm-linux-gnueabi-gcc -c -o tests.o tests.c
Ok; this goes up to -march=armv6, but not -march=armv6t2; it also goes away in ARM mode.
I filed LP #629671 to track this after reproducing with the latest native toolchain which has the latest Linaro released patches.
One thing which would help is reduring the test case from -Os to a set of -f flags; you can find which flags are turned on by -Os with: arm-linux-gnueabi-gcc -c -Q -Os --help=optimizers