This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -fuse-caller-save - Enable for MIPS
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: "gcc-patches\ at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 28 Apr 2014 11:26:07 +0100
- Subject: Re: -fuse-caller-save - Enable for MIPS
- Authentication-results: sourceware.org; auth=none
- References: <534ED7BC dot 50300 at mentor dot com> <534FF0F9 dot 60404 at redhat dot com> <87lhv4ug7f dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <53500628 dot 2090802 at redhat dot com> <5356853D dot 8050905 at mentor dot com> <535A5A8F dot 30901 at mentor dot com> <8761lxr1ay dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <535BA119 dot 8090504 at mentor dot com> <8761lvcbjo dot fsf at talisman dot default> <535D94EE dot 6080704 at mentor dot com>
Tom de Vries <Tom_deVries@mentor.com> writes:
> On 27-04-14 12:27, Richard Sandiford wrote:
>> Tom de Vries <Tom_deVries@mentor.com> writes:
>>> mips_emit_call_insn (rtx pattern, rtx orig_addr, rtx addr, bool lazy_p)
>>> {
>>> rtx insn, reg;
>>>
>>> - insn = emit_call_insn (pattern);
>>> + emit_call_insn (pattern);
>>> + insn = last_call_insn ();
>>>
>>> if (TARGET_MIPS16 && mips_use_pic_fn_addr_reg_p (orig_addr))
>>> {
>>
>> This change isn't necessary; emit_call_insn is defined to return a CALL_INSN.
>>
>
> I dropped this change, as well as the change in the untyped_call expand, I
> realized it's unnecessary.
Why was the untyped_call part unnecessary?
>> I'm a bit surprised that it doesn't work at -O1 for a simple test
>> like this though. What goes wrong?
>>
>
> AFAIU now the problem is that the optimization doesn't trigger for -O0
> and -01, because the register allocator behaves more conservatively.
Hmm, is that just because -fcaller-saves is -O2 and above? If so,
should -fuse-caller-save imply -fcaller-saves?
Thanks,
Richard