Bernd Jendrissek wrote:
On Tue, May 13, 2008 at 9:13 PM, Nick Spence <nick.spence@xxxxxxxxxxxxx> wrote:
addr = 0;
for (i = 0; i < 16; i++) *(addr++) = 0;
I got a conditional jump by replacing your initialization of addr with:
asm("" : "=g" (addr) : "0" (0));
That should make the NULL-ness of addr invisible to GCC.
Thanks - I ended up loading the value from a DRAM base address register,
which effectively hid it from the optimizer.
I still don't like the silent corruption of code by the optimizer, and
would like to see an optimizer warning message added.