This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "cc" clobber


On 02/02/2016 01:58 AM, Ulrich Weigand wrote:
I think on many targets a clobber "cc" works because the backend
actually defines a register named "cc" to correspond to the flags.
Therefore the normal handling of clobbering named hard registers
catches this case as well.

Yes.  C.f. Sparc ADDITIONAL_REGISTER_NAMES.

This doesn't work on i386 because there the flags register is called
"flags" in the back end.

Once upon a time i386 used cc0. A survey of existing asm showed that almost no one clobbered "cc", and that in the process of changing i386 from cc0 to an explicit flags register we would break almost everything that used asm.

The only solution that scaled was to force a clobber of the flags register.

That was 1999.  I think you'll buy nothing but pain in trying to change this now.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]