http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56439
Georg-Johann Lay <gjl at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gjl at gcc dot gnu.org --- Comment #8 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2013-03-07 23:26:01 UTC --- (In reply to comment #3) > (In reply to comment #2) >> Any specific sections you can point me to? I'd be interested to hear a >> justification for this behavior. > > Simple answer, an interrupt can happen any time after the access/assignment of > the global register variable so it needs to be set to the value and treated as > a volatile variable. Is this really the case? There is not even a means to tag a REG as volatile. The /v flag is set but for REGs it means "user variable", see rtl.h and the docs for volatil. http://gcc.gnu.org/viewcvs/trunk/gcc/rtl.h?view=markup#l286 And qualifying foo as volatile diagnoses as expected: <stdin>:1:1: warning: optimization may eliminate reads and/or writes to register variables [-Wvolatile-register-var] This issue looks rather like a fallout of reload that for some reasons spills for the shift insn. See also PR49491 Or are global registers spacial for reload? I still don't see why a spilling is needed for the shift insn...