This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Fix PR/38227 gcc fails to correctly pass arguments with ms_abi function pointers
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Uros Bizjak" <ubizjak at gmail dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Kai Tietz" <ktietz70 at googlemail dot com>
- Date: Sun, 23 Nov 2008 23:00:09 +0100
- Subject: Re: [patch i386]: Fix PR/38227 gcc fails to correctly pass arguments with ms_abi function pointers
- References: <4929CEAE.3090004@gmail.com> <4929D1CE.1020208@gmail.com>
On Sun, Nov 23, 2008 at 10:57 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Uros Bizjak wrote:
>>
>> Hello!
>>
>>> This bug is related to the fact, that get_callee_fndecl() can't
>>> resolve in some cases the original FUNCTION_DECL type. For this
>>> problem it is reasoned that the call expression points to a VAR_DECL,
>>> which can be resolved by get_callee_fndecl.
>>> I changed the macro REG_PARM_STACK_SPACE, so that it accepts also
>>> directly the TREE_TYPE to resolve the attributes correctly.
>>> I think we should change in general the macro argument of
>>> REG_PARM_STACK_SPACE to accept the type instead of the decl. The other
>>> way would be to teach get_callee_fndecl to resolve by type the decl,
>>> but AFAIK there isn't at the moment a facility to resolve this.
>>>
>>> ChangeLog
>>>
>>> 2008-11-23 Kai Tietz <kai.tietz@onevision.com>
>>>
>>> PR/38227
>>> * calls.c (expand_call): Add fntype case to REG_PARM_STACK_SPACE use,
>>> if fndecl isn't available.
>>> * config/i386/i386.c (ix86_reg_parm_stack_space): Support direct type
>>> argument for abi check.
>>>
>>> Is this patch ok to be applied on trunk?
>>>
>>
>> OK with a testcase from the PR.
>
> Uh, the approval is only for i386 part, you still need the approval for
> calls.c part.
You need to look into other targets implementation of REG_PARM_STACK_SPACE
to see if they will be confused by a type parameter.
Richard.