From Sterling@xxxxxxxxxxxxx Tue Apr 17 08:18:39 2001
It is supposed to force all memory accesses through pointers to be
treated as volatile.
Here is a simple testcase:
int foo;
int main()
{
int * foo_p = &foo;
* foo_p = 1;
* foo_p = 2;
}
if you compile the above with egcs 2.95.2 at -O3, the first indirection
off foo_p is optimized away. But if you compile the above at -03 and
-fvolatile, then it remains.
If you use gcc version 2.96-ia64-000717 snap 001117
which is the latest approved ia64 compiler, -fvolatile does nothing.
I'm not sure if 3.0 fixes this, but if not, then this should be
reported to gcc. Once gcc supports this, passing -fvolatile to the
sgicc front end may still not do anything, depending on how gcc
implements this. It might require back-end work.
-- Mike Murphy
-- mpm@xxxxxxx
-- quote of the day:
-- "To laugh often and much; to win the respect of intelligent people and
-- the affection of children; to earn the appreciation of honest critics
-- and endure the betrayal of false friends; to appreciate beauty;
-- to find the best in others; to leave the world a bit better,
-- whether by a healthy child, a garden patch or a redeemed social condition;
-- to know even one life has breathed easier because you have lived.
-- This is to have succeeded." (Ralph Waldo Emerson)
|