[Info-vax] LLVM, volatile and async VMS I/O and system calls
Dave Froble
davef at tsoft-inc.com
Thu Sep 23 11:25:29 EDT 2021
On 9/23/2021 10:10 AM, chris wrote:
> So what is the issue here ?. Keywords like volatile would not normally
> ever be used at app level, being reserved for low level kernel and
> driver code where it touches real hardware registers. or perhaps
> memory locations reserved for a specific purpose. The 4th edition of
> Harbison & Steele C reference manual has 2 or 3 pages devoted to the
> volatile keyword and might be worth looking at; Section 4.4.5. The
> whole point of a black box kernel is to isolate the internal workings
> from an application. Thinking layers, of course.
>
> If systems and code are designed and written properly, then it should
> compile to usable code irrespective of compiler, including
> optimisation level, so long as the compiler is standards compliant.
> Anything else is s system design issue...
If your code was executed as you intended, then there should not be any
issue, as you mention.
But what if your code is NOT executed as you intended. An optimizer
just might figure that it doesn't need to execute some instructions,
that they are redundant. They do that. However, if they are not
redundant, then results may not be as expected.
So, one might consider "volatile" (or whatever else is used) as an edict
to "don't optimize".
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list