I think you should make this change unconditionally - and flush the
entire frame cache. I'm not sure whether it should be in the generic
code that writes a register or the user-level code triggered by set
$reg = val, though.
I've been meaning to do this for a long time. For instance, there is a
writeable register on PowerPC targets which has some read-only bits.
Right now, if you set it to an arbitrary value and then print it you'll
get the value GDB wrote - not the value that was actually accepted into
the register.
Andrew convinced me that the performance cost associated with this
would be small in practice.