[Info-vax] LLVM, volatile and async VMS I/O and system calls

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Sep 22 16:25:59 EDT 2021


On 2021-09-22, Bob Gezelter <gezelter at rlgsc.com> wrote:
> Simon,
>
> Good technical question.
>
> In general, optimizers work within basic blocks. The example of concern is not a single basic block.
>
> A basic block is a section of code with one entry and one exit. Simple IF statements fall within that category. However, any out-of-line code invocation does not. 
>
> The presence of the SYS$QIO system service, which one way or another involves a CALL, ends the basic block, as the optimizer cannot know what is modified by the out-of-line call or its descendants.
>

But VMS writes directly into your process space at some random time
X later _after_ you have returned from sys$qio() and are potentially
busy doing something else.

>From the viewpoint of the application, it's exactly the same as hardware
choosing to write an updated value into a register while your bare-metal
code is busy doing something else.

How does the compiler know VMS has done that or are there enough
sequence points even in the VMS asynchronous I/O model for this
to still work fine without having to use the volatile attribute,
even in the presence of an highly aggressive optimising compiler ?

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list