Optimiser and memory mapped I/O

Grant Edwards grante@visi.com
Thu Sep 25 19:27:00 GMT 2003


On Thu, Sep 25, 2003 at 06:53:40PM +0200, Toralf Lund wrote:

> OK, this time I think I've found a genuine problem with the
> optimiser.

No, you've found a problem with your source code. :)

> Consider the following code:

[...]

> Simply put, the optimizer seems to think this is equivalent to

[...]

Assuming that's C code, the two _are_ equivalent -- it says
that in the language definition.  IOW, your source code is
incorrect for what you're trying to do.

> Any ways around this (besides not optimising at all)?

You need to use the "volatile" qualifier.

-- 
Grant Edwards
grante@visi.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list