This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: FIX_REGISTER_CHECK
Jim Wilson writes:
> The patch seems incomplete, in two different ways.
> 1) You are adding an error message for invalid -fcall* options, but you
> only do so for two registers. You don't give errors for all invalid
> options.
> 2) You are adding an error message for invalid -fcall* options, but you
> only do so for one target. You don't give errors for all targets.
> Both of these problems seem undesirable to me.
>
> If it is really only the stack pointer and frame pointer that you
> are worried about at this time, then why make the patch MIPS specific?
I didn't write versions of FIX_REGISTER_CHECK for all the other
ports because I don't know the list of invalid registers for
each port. I only added fp and sp to the mips version of
FIX_REGISTER_CHECK because they were the only ones I was sure
of. My intent was to provide a place maintainers who knew
the list for a particular port could encode it.
It was not obvious to me that fp and sp were invalid for -fcall*
for all ports. If they are, then yes, this error message
could be added in a machine independant way, but I think the
ability for a port to list the invalid registers is worth the
cost of the new target macro.
I considard using CONDITIONAL_REGISTER_USAGE for this as Jeff
suggests, but at that point we no longer have the name for the
register that the user specified in the -fcall* option. There
does not seem to be a way to generate the name of a register
suitable for use in error messages, and no way to ensure that
the generated name clearly points back to the erronious -fcall*
option. These problems are solveable, but adding a new target
macro still seems to be a better solution.
After rethinking all this, I still believe my patch is the
best solution, but I don't feel strongly about this, and
if the above comments don't change your mind, I'll rewrite
the patch whatever way you think is best.
-gavin...