volatile and R/M/W operations

Robert Dewar dewar@adacore.com
Mon Dec 3 17:28:00 GMT 2007


Richard Kenner wrote:
>> Right, but it would seem this is a good canididate for combination. This
>> is especially true since often Volatile is used with the sense of Atomic
>> in Ada, and it is not a bad idea to combine these in practice, giving an
>> atomic update (right, nothing in the language requires it, but it is
>> definitely useful!)
> 
> I don't disagree that "this" is a good candidate for combination, but
> one problem is that by the time you're at that level, you don't easily have
> the source correspondance you want.
> 
> E.g.,
> 
> 	y |= 2;
> 
> and
> 
> 	t1 = y | 2;
> 	y = t1;
> 
> are very hard to tell apart at the RTL level.  Though it's clear that
> a single instruction might best match the expect semantics of the former,
> it's a lot less clear that it would for the latter.

I think it would still be OK for the latter, why not?



More information about the Gcc mailing list