Re: Help with SH2E -O2 instruction ordering with volatile

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

 



On 20/12/15 07:14, Alex Brown wrote:
> I know the code is somewhat weird ;-)
> 
> Basically peripheral.e wants the address of a null terminated string
> (not the char value).
> 
> My "platform/emulator" will use DMA to extract the string from RAM
> before the next instruction is executed.
> 
> The issue is that at the time the address is assigned to peripheral.e
> is seems the values of the text array have not yet been written to the
> stack (or that's what I thing I am seeing).
> 
> Making "text" volatile makes it output code that makes sense to me.

The cast to unsigned really isn't helping.  My suspicion is
that if t.e has the correct type -- char* -- GCC will do the
right thing.  If not, it's a bug in GCC.  I am assuming that
lock and unlock are volatile or effectively volatile.  If not,
they should be.

Andrew.




[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