lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, Sep 26, 2020 at 12:57 AM John W <jwdevel@gmail.com> wrote:

> Are there any other concerns in this code that require 'volatile'? Or
> maybe it's a workaround for some old compilers, such as mentioned in
> the comments for 'aux_close' ?

This is possible, but probably not the same bug.

The precision of floating point computations per the C standard is not
fully specified . For example, extended precision 80-bit registers may
be used when they are available even though the float and double types
might be 32 and 64 bit wide, respectively. Overly zealous optimizers
may optimize away memory stores (spills) and end up copying part of
the register, i.e., garbage, or just random garbage to begin with. The
volatile forces a memory store with a valid bit width and format.

Just guessing.

Cheers,
V..