[cfe-dev] volatile store/load

Chris Lattner clattner at apple.com
Sat Jun 7 12:38:33 PDT 2008

On Jun 7, 2008, at 11:29 AM, Eli Friedman wrote:
>> simple scalar value type. Afterward, I saw that there was a fixme  
>> in LValue.
>> Would it be best to add a volatility flag to LValue, or is my way  
>> of doing
>> it okay?
> Hmm, I'm not completely sure... on the one hand, we are basically
> guaranteed to have type information along with any LValue.  On the
> other hand, it affects how the load should be constructed, and should
> therefore be associated with the LValue along with other properties
> which can't be derived from the type, like alignment.  I'm leaning
> towards putting volatility into the LValue, but I could be convinced
> that the other approach is superior.

We've hit this sort of problem in spades in llvm-gcc.  The "right" fix  
we converged on (but haven't yet implemented) is to add a volatile  
flag and alignment field to the LValue structure.  IIRC, the  
'volatility' of a load or store follows the destination being stored  
into (e.g. a bitfield, horrors!) not the expression being stored into  


More information about the cfe-dev mailing list