Re: Optimizer problem with repeated loops over memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux