[patch] Preparations for SYSV/MS ABI attributes in middle-backend may before stage 3 and implementation in i386

Jan Hubicka hubicka@ucw.cz
Thu Sep 27 03:03:00 GMT 2007


Hi,

-#define TARGET_64BIT_MS_ABI TARGET_64BIT
+#define TARGET_64BIT_MS_ABI (!cfun ? DEFAULT_ABI == MS_ABI : TARGET_64BIT && cfun->machine->call_abi == MS_ABI)

I am not quite ahppy about the TARGET_64BIT_MS_ABI changing behaviour on
cfun.  How many uses of TARGET_64BIT_MS_ABI are left where cfun is
always NULL?  I would preffer to replace them with DEFAULT_ABI==MS_ABI
and have TARGET_64BIT_MS_ABI renamed and ix86_cfun_abi or DEFAULT_ABI
used instead.

 /* Size of the register save area.  */
-#define X86_64_VARARGS_SIZE (REGPARM_MAX * UNITS_PER_WORD + SSE_REGPARM_MAX * 16)
+/* $$$$ X86_64_REGPARM_MAX 6 X86_64_SSE_REGPARM_MAX 8 */
+#define X86_64_VARARGS_SIZE (6 * UNITS_PER_WORD + 8 * 16)

Thinking about this a bit more, I don't think varargs function with
non-default ABI has chance to work - the stdarg type depends on ABI and
it is defined just once for compilation unit.
I guess we should just sorry in va_start emiting and have the default
x86_64_VARARGS_SIZE here.
+  int call_abi;			/* Set to SYSV_ABI for sysv abi. Otherwise

call_abi seems a bit misnamed here - it is abi of currently compiled
function, not currently compiled call, so perhaps just "abi" or
function_abi would work better.

Otherwise the patch seems fine (it will need compensation for changes
discussed for Mark). We also need to deal with caller saved register
changes.  What bits are missing from this preparation patch?

Honza



More information about the Gcc-patches mailing list