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

chris chris-nospam at tridac.net
Sat Sep 25 09:00:09 EDT 2021


On 09/25/21 04:25, Simon Clubley wrote:
> On 2021-09-24, chris<chris-nospam at tridac.net>  wrote:
>> On 09/24/21 19:15, Simon Clubley wrote:
>>>
>>> No I am not. All I have said all along is that volatile inserts code
>>> into the generated code to _always_ re-read the variable before doing
>>> anything with it.
>>
>> Sorry, no it doesn't :-). All it's saying is that the section of code
>> should not be subject to any optimisations. Not the same thing at all.
>> Doesn't add code, just doesn't take any away, nor modify it,
>> but translates as written.
>>
>
> I may have phrased that a little loosely, but the end result is exactly
> the same - the generated object code has unconditional reads in it in
> places it might not have done had the optimiser been allowed to go to
> work on the variable.
>
> Simon.
>

We are probably in agreement, just different interpretations of
the same thing ?. One thing I always do when confronted with a new
compiler or tool chain is to look at the assembler source output
to make sure it's doing what I expect it to. Don't bother once
i'm happy with the compiler, but it does help to get to know what
the compiler is doing under various conditions. It's also useful
if you are trying to optimise performance. For example, trying to
decide which loop construct to use for / next, or do / while. Quite
important in the old 8 bit days, but moderm micros are so good
now, it's less of an issue. Quite often a single line of asm
per C statement, but you can fine tune the programming style to'
get the best results form the compiler....

Chris





More information about the Info-vax mailing list