sysv/ms_abi attribute fix, part 5, proper call clobbered registers for ms->sysv calls

Ian Lance Taylor iant@google.com
Wed Dec 17 02:09:00 GMT 2008


Jan Hubicka <hubicka@ucw.cz> writes:

> This patch handles it by adding extra patterns that do have SI/DI clobbers that
> should force reload to do proper thing (I hope).

Using unspec_volatile will disable various optimizations.  I don't see
any reason to use it, as this instruction is not volatile.  Just use a
plain unspec.


> There is one important and
> ugly hack in the code concerning static variable last_function_call_abi that is
> used to hold information about ABI to ix86_expand_call form
> init_cumulative_args.  There is currently no way to figure out function
> type/declaration from ix86_expand_call so there is no way to pass around the
> ABI information.  This is very ugly (and I think it can break when libcalls are
> needed for argument setup) and any ideas to make this cleaner are welcome.

You only need one bit of information.  Encode it into the callarg2
parameter to ix86_expand_call, which is the value returned by
function_arg when called with mode == VOIDmode.  Currently the value
encodes the number of registers used for varargs functions.  There is
plenty of room for another bit (actually this is an rtx so you can do
whatever you like, but sticking to integer encodings seems
reasonable).  While you're at it please clean up the incomprehensible
nest of ?: operators in function_arg_64.

Ian



More information about the Gcc-patches mailing list