[Info-vax] Ada x86 (was Rdb/x86)

Arne Vajhøj arne at vajhoej.dk
Tue Dec 1 10:33:21 EST 2020


On 12/1/2020 8:07 AM, Simon Clubley wrote:
> On 2020-11-30, John Dallman <jgd at cix.co.uk> wrote:
>> Bringing back the GCC toolchain might be a good idea anyway. I've
>> remembered an LLVM feature that caused me trouble a few years back, which
>> may surprise people used to the DEC compilers.
>>
>> With GCC, and AFAIK with the DEC compilers, one can enable floating-point
>> traps, and get sensible results, trapping when you divide by zero,
>> overflow or try an invalid operation, such as sqrt(-1.0).
>>
>> GCC is well aware that floating-point operations may cause traps, and its
>> optimiser limits the rearrangement of code so that you don't get spurious
>> ones. For example if you have:
>>
>>          double a, b;
>>          ...
>>          if ( b < really-small-number)
>>                  a = 0.0;
>>          else
>>                  a = 1.0 / b;
>>
>> GCC won't move the divide out from under the test that guards against
>> divide-by-zero.
> 
> Would declaring the variables volatile have avoided this reordering ?
> 
> And talking of volatile, I wonder if John has encountered any cases
> with LLVM where variables now need to be declared volatile where they
> did not need to be with the DEC compilers.

I am not a memory model expert, but everybody is saying that
the x86-64 memory model is easier to work with than the
Alpha and Itanium memory models.

Arne



More information about the Info-vax mailing list