This is the mail archive of the
mailing list for the GCC project.
Re: [i386, AVX-512F, pr58269] Partial fix for PR58269: properly initialize last EXT REX SSE register.
- From: Iain Sandoe <iain at codesourcery dot com>
- To: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>
- Date: Fri, 6 Sep 2013 11:04:45 +0100
- Subject: Re: [i386, AVX-512F, pr58269] Partial fix for PR58269: properly initialize last EXT REX SSE register.
- Authentication-results: sourceware.org; auth=none
- References: <20130906083457 dot GA31758 at msticlxl57 dot ims dot intel dot com> <CAFULd4bVPiwim=qw7ZOSKmsFTVVGtSnN2C=F_iZ0BPsrWb2fDQ at mail dot gmail dot com> <20130906092944 dot GP23437 at tucnak dot redhat dot com>
Thanks for Ilya's input on the PR thread.
We've done some testing/checking across the Darwin versions last night and I've bootstrapped all langs including Ada, and tested the patch below (together with the fragment you posted earlier) on Darwin12.
>> On Fri, Sep 6, 2013 at 10:34 AM, Kirill Yukhin <email@example.com> wrote:
>>> Here is a patch to fix pr58269.
>>> Actually this is not a full fix, but an obvious part.
Here's what I propose for the remainder of the fix (FAOD, I cannot approve the Darwin changes).
Darwin is supposed to follow the System V psABI for x86_64 and, AFAICT for Darwin9, 10, 11 and 12 it is complying for function calls involving xmm0-7 (additional float args are, indeed, placed on the stack). Ergo, saving xmm8-15 in __builtin_apply_args() only consumes time and stack space - the content is not part of the call.
As a fall-back; if I've missed a subtlety and, for some reason, we need to adjust the xmm set saved for compatibility with an older (gcc-4.2 based) system compiler, then we can override SSE_REGPARM_MAX in i386/darwin*.h for the relevant system version.
Losing TARGET_MACHO conditional code is always nice :)
Mike: Actually, since this seems to have uncovered a pre-existing wrong code bug, perhaps (this part of the) fix should also be applied to open branches?
config/i386/i386.c (ix86_function_arg_regno_p): Make Darwin use the
xmm register set described in the psABI.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a8d70bc..e68b3f9 100644
@@ -5706,17 +5706,9 @@ ix86_function_arg_regno_p (int regno)
&& (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)));
- if (TARGET_MACHO)
- if (SSE_REGNO_P (regno) && TARGET_SSE)
- return true;
- if (TARGET_SSE && SSE_REGNO_P (regno)
- && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX))
- return true;
+ if (TARGET_SSE && SSE_REGNO_P (regno)
+ && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX))
+ return true;
/* TODO: The function should depend on current function ABI but
builtins.c would need updating then. Therefore we use the