Discussion: What is unspec_volatile?

Paul Brook paul@codesourcery.com
Fri Nov 12 11:28:00 GMT 2010


> What about liveness? No hard reg, pseudo, mem will live avross the
> unspec volatile. Right?

Wrong. A volatile unspec may use/change machine state not directly accessible 
by gcc.  Any use of or changes to the machine state modelled by gcc should be 
explicit in the pattern.

i.e. if your pattern clobbers a hard register, you should include a clobber of 
that register in parallel with the unspec.  Likewise if you set a hard 
register to a useful value, you should include an explicit set, typically 
something like "(set (reg) (unspec_volatile ...))"

Paul



More information about the Gcc mailing list