[LLVMdev] volatiles (was comparison of correctness of llvm and gcc)
John Regehr
regehr at cs.utah.edu
Mon Jul 21 09:54:37 PDT 2008
Hi Duncan,
We currently check that every byte of a volatile is accessed the same
number of times, and that this number doesn't change across optimization
levels.
If LLVM wants to make stronger guarantees that's great, I suspect this is
not hard to all to check. Can you provide a list of types that should be
atomic for the x86 target? For example would we expect a struct of size 4
to be atomically accessed? How about pointers? Bitfields? Actually I
think the interaction of volatile and bitfields is murky so maybe we don't
want to go there.
Also, right now we don't check that the order in which volatiles are
accessed is the same across all optimization levels. Fixing this is on my
list. As long as we generate code with at most one volatile access
between any given pair of sequence points (which we do) the compiler is
not free to reorder.
John
More information about the llvm-dev
mailing list