This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: "cc" clobber
- From: Richard Henderson <rth at redhat dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>, David Wohlferd <dw at LimeGreenSocks dot com>
- Cc: Bernd Schmidt <bernds_cb1 at t-online dot de>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 2 Feb 2016 07:40:10 +1100
- Subject: Re: "cc" clobber
- Authentication-results: sourceware.org; auth=none
- References: <20160201145856 dot 61D4C529E at oc7340732750 dot ibm dot com>
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~