Are externs automatically volatile?

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Jun 12 21:52:05 AEST 1990


In article <2213 at atari.UUCP> apratt at atari.UUCP (Allan Pratt) writes:
>Are all externs volatile?

No, of course not.

>I had hoped, especially with -fstrength-reduce, that this_is_extern
>would be read into a register once, rather than having the  memory
>reference at the bottom of every loop, but that's not what happened.

Most compilers do not perform such global optimization over externs;
since under many circumstances the optimization would be incorrect,
the compiler writer finds it simpler to not worry about it.



More information about the Comp.std.c mailing list