[Info-vax] yet another sys$qiow question
Jan-Erik Soderholm
jan-erik.soderholm at telia.com
Wed Aug 19 17:02:10 EDT 2015
Den 2015-08-19 kl. 21:41, skrev JF Mezei:
> On 15-08-19 15:28, John Reagan wrote:
>> The early VAX compilers didn't do lots of caching fields of structs. COBOL wasn't optimized at all. Given the few registers available, it didn't make much sense to cache a piece of the IOSB over a long sequence of code. You almost always got a refetch. VAX BLISS is probably the most aggressive about such things. I don't think VAX FORTRAN even added VOLATILE until later in its history for example. Architectures like Alpha and Itanium with more registers started making such "fetch-once/use-many" optimizations valuable. On x86 with fewer registers, it may not be viewed as profitable. I haven't dug all that deep into LLVM's heuristics to see. If we need to adjust some things to help paper over older code, we'll figure it out.
>
>
> So on DEC-C, if I have a variable that need to be "volatile", how do I
> declare it ?
https://en.wikipedia.org/wiki/Volatile_%28computer_programming%29
http://www.barrgroup.com/Embedded-Systems/How-To/C-Volatile-Keyword
>
> I assume other platforms (like OS-X with GCC) would have similar need to
Yes, of course.
> declare a variable as residing in memory and not optimized away ?
>
"Residing in memory" is not the point.
"Always read the source of the value" is.
More information about the Info-vax
mailing list