This is the mail archive of the
mailing list for the GCC project.
Re: -fuse-caller-save - Collect register usage information
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>, Mike Stump <mikestump at comcast dot net>
- Cc: <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>
- Date: Thu, 16 Oct 2014 23:28:28 +0200
- Subject: Re: -fuse-caller-save - Collect register usage information
- Authentication-results: sourceware.org; auth=none
- References: <534ED7BC dot 50300 at mentor dot com> <535798F0 dot 7070809 at mentor dot com> <344F2F85-3D3A-4D50-8D95-B3E820581EF3 at comcast dot net> <1934759 dot KususQOCne at polaris>
On 11-10-14 12:46, Eric Botcazou wrote:
So, I hate the name of the option, and the documentation seems wrong to me.
It doesnât use the caller saved registers for allocation, it uses the call
clobbered registers for allocation. Or, one could say it uses the callee
saved registers for allocation.
thanks for the comments.
I know the following definition of caller-vs-callee saved registers:
- at function entry, a caller-save register can be used immediately, without
needing to save it first. However, in order to store a value in it that is
live across calls, it needs to be saved and restored around each call (hence
the term caller-save).
- at function entry, a callee-save register first needs to be saved before it
can be used (hence the name callee-save). However, that means that it can be
used to store a value that is live across calls, without further need for
So, AFAIU, call clobbered corresponds with caller-save, not with callee saved.
So I'd say the documentation is in fact correct.
Having said that, in my mind, what is confusing about the name
-fuse-caller-save, is that in fact the caller-save registers are already used in
register allocation. It's just that they're used across calls without the need
to save them, but -fuse-caller-save-across-calls-without-saving-if-possible is
not such a good option name.
Another thing that - in my mind - is confusing is that there's an option
fcaller-saves which controls behaviour for caller-save registers:
- for -fno-caller-saves, caller-save registers are not used across calls
- for -fcaller-saves, caller-save registers are used across calls
The name is similar to -fuse-caller-save, and it won't be clear from just the
names what the difference is.
Seconded, the description is a bit confusing and "caller saved"/"callee saved"
should be avoided IMO, "call clobbered"/"call saved" is much clearer.
I have no objection to go with another terminology in the documentation. But
before going into a patch, let's settle on the option name.
As for the name, I'm not sure just changing terminology will make things
clearer, in other words, I'm not sure fuse-call-clobbered is any clearer than
I've pondered the name -fipa-ira, but I rejected that earlier because that might
suggest actual register allocation at the interprocedural scope, while this is
only register allocation at the scope of a single procedure, taking some
interprocedural information into account. Furthermore, it's not only ira that
uses the interprocedural information.
So, let's a generate a list of option names.
Any preferences, alternatives?