Re: [Sdcc-user] Code optimisation conundrum...

2009-04-03 Thread Richard Gray
Yes, declaring the pointer volatile seems to have fixed the problem. I did actually try this before posing the question, but because of another stupid mistake I mistook the result for something else entirely. :-$ On Friday 03 April 2009 19:32:23 Raphael Neider wrote: > > Address=&MemoryBlock; >

Re: [Sdcc-user] Code optimisation conundrum...

2009-04-03 Thread Raphael Neider
> > Address=&MemoryBlock; > (*Address)=0xAA; > if ( (*Address) != 0xAA ) > { /* We never get here because the (*Address) location is not re-read > */ } > > I can declare the MemoryBlock variable as volatile [I have done], but > that > doesn't mean that the compiler knows that (*Addr

[Sdcc-user] Code optimisation conundrum...

2009-04-03 Thread Richard Gray
I have a bit of a problem with a memory test routine I'm writing. Consider this piece of code [fragment]:- Address=&MemoryBlock; (*Address)=0xAA; if ( (*Address) != 0xAA ) { /* We never get here because the (*Address) location is not re-read */ } I can declare the MemoryBlock va