This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, middle-end] Fix PR 44878, IA64 build failure, partial inlining


Richard Guenther <richard.guenther@gmail.com> writes:

> On Wed, Jul 21, 2010 at 11:00 PM, Steve Ellcey <sje@cup.hp.com> wrote:
>>
>> Here is my latest patch to fix this problem. ÂI think the issue involves
>> the for_return argument to promote_function_mode. ÂThe comments for
>> promote_function_mode simply say that this argument is non-zero if we
>> are promoting a return value (and not an argument).
>>
>> But the routine calls targetm.calls.promote_function_mode and if that
>> is set to default_promote_function_mode, the code checks for
>> (for_return == 2) and calls promote_mode if it is. ÂThis behaviour
>> is documented in tm.texi:
>>
>> Â Â Â Â@var{for_return} allows to distinguish the promotion of
>> Â Â Â Âarguments and return values. ÂIf it is @code{1}, a return value
>> Â Â Â Âis being promoted and @code{TARGET_FUNCTION_VALUE} must perform
>> Â Â Â Âthe same promotions done here. ÂIf it is @code{2}, the returned
>> Â Â Â Âmode should be that of the register in which an incoming
>> Â Â Â Âparameter is copied, or the outgoing result is computed; then
>> Â Â Â Âthe hook should return the same mode as @code{promote_mode},
>> Â Â Â Âthough the signedness may be different.
>>
>> Given this, it seems that expand_value_return should check for a
>> reference return and call promote_function_mode with 2 instead of 1
>> for that case. ÂThis patch allows me to bootstrap on IA64 and the
>> testing seems to be going OK. ÂAssuming it works, is this patch OK to
>> checkin?
>
> Hm, it sounds reasonable.  But I'd like someone more familiar with
> the code review the patch.

This looks OK to me.

Thanks.

Ian

>> ===================================================================
>> --- stmt.c   Â(revision 162360)
>> +++ stmt.c   Â(working copy)
>> @@ -1595,8 +1595,11 @@ expand_value_return (rtx val)
>> Â Â Â tree type = TREE_TYPE (decl);
>> Â Â Â int unsignedp = TYPE_UNSIGNED (type);
>> Â Â Â enum machine_mode old_mode = DECL_MODE (decl);
>> - Â Â Âenum machine_mode mode = promote_function_mode (type, old_mode,
>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &unsignedp, funtype, 1);
>> + Â Â Âenum machine_mode mode;
>> + Â Â Âif (DECL_BY_REFERENCE (decl))
>> + Â Â Â Âmode = promote_function_mode (type, old_mode, &unsignedp, funtype, 2);
>> + Â Â Âelse
>> + Â Â Â Âmode = promote_function_mode (type, old_mode, &unsignedp, funtype, 1);
>>
>> Â Â Â if (mode != old_mode)
>> Â Â Â Âval = convert_modes (mode, old_mode, val, unsignedp);
>>
>>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]