Quoting Ian Lance Taylor <i...@google.com>:
Offhand I don't know of any way to get the compiler to save CC for you around your instruction. That's a stiff requirement.
It's easy to do under explicit control of the pattern, using (a) match_scratch clobber(s) of (a) register(s) of the required class(es) - or if memory is needed, the stack top can be set aside by the prologue/epilogue code.