This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR target/39473: Typo in untyped_call in i386.md
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: ktietz70 at googlemail dot com, ubizjak at gmail dot com, jh at suse dot cz
- Date: Mon, 16 Mar 2009 12:20:42 -0700
- Subject: PATCH: PR target/39473: Typo in untyped_call in i386.md
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
SSE_REGPARM_MAX is defined as
#define SSE_REGPARM_MAX \
(TARGET_64BIT ? (TARGET_64BIT_MS_ABI ? X64_SSE_REGPARM_MAX \
: X86_64_SSE_REGPARM_MAX) \
: X86_32_SSE_REGPARM_MAX)
untyped_call shouldn't assume 64bit ABI. Also ix86_expand_call has
gcc_assert (!TARGET_64BIT || !pop);
That means pop should be NULL in 64bit. There is no need for
if (pop)
{
...
gcc_assert (ix86_cfun_abi () != MS_ABI || function_call_abi != SYSV_ABI);
}
since it will never happen and we only need to check ms->sysv ABI calls
in 64bit mode. OK for trunk if there are no regressions on Linux/ia32
and Linix/x86-64?
Thanks.
H.J.
---
2009-03-16 H.J. Lu <hongjiu.lu@intel.com>
PR target/39473
* config/i386/i386.c (ix86_expand_call): Check extra clobbers
for ms->sysv ABI calls only in 64bit mode.
* config/i386/i386.md (untyped_call): Use SSE_REGPARM_MAX.
--- gcc/config/i386/i386.c.pr39473 2009-03-15 08:13:44.000000000 -0700
+++ gcc/config/i386/i386.c 2009-03-16 12:07:41.000000000 -0700
@@ -18617,12 +18617,7 @@ ix86_expand_call (rtx retval, rtx fnaddr
rtx pop, int sibcall)
{
rtx use = NULL, call;
- enum calling_abi function_call_abi;
- if (callarg2 && INTVAL (callarg2) == -2)
- function_call_abi = MS_ABI;
- else
- function_call_abi = SYSV_ABI;
if (pop == const0_rtx)
pop = NULL;
gcc_assert (!TARGET_64BIT || !pop);
@@ -18678,12 +18673,13 @@ ix86_expand_call (rtx retval, rtx fnaddr
pop = gen_rtx_PLUS (Pmode, stack_pointer_rtx, pop);
pop = gen_rtx_SET (VOIDmode, stack_pointer_rtx, pop);
call = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, call, pop));
- gcc_assert (ix86_cfun_abi () != MS_ABI || function_call_abi != SYSV_ABI);
}
- /* We need to represent that SI and DI registers are clobbered
- by SYSV calls. */
- if (ix86_cfun_abi () == MS_ABI && function_call_abi == SYSV_ABI)
+ if (TARGET_64BIT
+ && ix86_cfun_abi () == MS_ABI
+ && (!callarg2 || INTVAL (callarg2) != -2))
{
+ /* We need to represent that SI and DI registers are clobbered
+ by SYSV calls. */
static int clobbered_registers[] = {
XMM6_REG, XMM7_REG, XMM8_REG,
XMM9_REG, XMM10_REG, XMM11_REG,
--- gcc/config/i386/i386.md.pr39473 2009-03-15 08:13:44.000000000 -0700
+++ gcc/config/i386/i386.md 2009-03-16 11:59:47.000000000 -0700
@@ -15164,9 +15164,7 @@
ix86_expand_call ((TARGET_FLOAT_RETURNS_IN_80387
? gen_rtx_REG (XCmode, FIRST_FLOAT_REG) : NULL),
operands[0], const0_rtx,
- GEN_INT ((DEFAULT_ABI == SYSV_ABI ? X86_64_SSE_REGPARM_MAX
- : X64_SSE_REGPARM_MAX)
- - 1),
+ GEN_INT (SSE_REGPARM_MAX - 1),
NULL, 0);
for (i = 0; i < XVECLEN (operands[2], 0); i++)