[Info-vax] LLVM, volatile and async VMS I/O and system calls
chris
chris-nospam at tridac.net
Mon Sep 27 19:30:04 EDT 2021
On 09/27/21 23:57, Dave Froble wrote:
> On 9/27/2021 5:39 PM, chris wrote:
>> On 09/27/21 19:49, Simon Clubley wrote:
>>
>>
>> Yes,. it does, but the compiler has no knowledge of that at all, as it's
>> a run time thing, not compile time. Unless the compiler has a crystal
>> ball :-). Can have no idea of what underlying code might modify the
>> buffer.
>
> Obviously true.
>
> This whole discussion isn't, or at least should not be, about compilers.
> Perhaps interpreters, but let's not add more confusion.
>
>> No, volatile does no such thing. It's merely a hint to the complier to
>> apply no optimisation to it.
>
> Correct.
>
>> Quite common in interrupt handlers, but again, the compiler can't
>> predict the future as to when it will be modified, or by whom,
>> so how can it add code to mitigate what it can't understand ?.
>
> I don't think that it does.
>
>> That's how this started, right, VMS sys$qio having bugs internally ?.
>
> Not that I recall. The original issue was optimization on x86, if I
> remember correctly. No guarantee of that.
>
>
Losing marbles :-). Anyway, if the code is written right, it shouldn't
matter what optimisation, if any, is applied. That's before we even get
into such niceties such as out of order execution, reordering etc, all
of which might need to be disabled for any code where strict execution
order is required.
Thankfully, never had to deal with that, but all kinds of possible
googlies with modern processors. Perhaps that's what Simon was hinting
at ?...
Chris
More information about the Info-vax
mailing list