According to the manual, yes - cc
is clobbered. RDRAND
also sets OF, SF, ZF, AF, PF <- 0.
In practice, gcc assumes that an __asm__
block always clobbers the [E|R]FLAGS
condition code register for x86. I don't have the reference, but you can see this assumption in places like the longlong.h
header used in various GNU packages.
It is, as you say, harmless if not used. For that reason, you might as well include it, since it still provides semantic intent, or commentary at worst. Also consider that Clang and ICC implement GCC asm syntax, and they would be conforming to the documentation if they honoured the "cc"
clobber, rather than presume it - even though this is unlikely.