This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [PR rtl-optimization/65618] Fix MIPS ADA bootstrap failure
- From: James Cowgill <James dot Cowgill at imgtec dot com>
- To: Jeff Law <law at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 3 Jan 2017 11:04:30 +0000
- Subject: Re: [PATCH] [PR rtl-optimization/65618] Fix MIPS ADA bootstrap failure
- Authentication-results: sourceware.org; auth=none
- References: <a65ced8f-b0f0-69fb-2fdc-17124296386a@imgtec.com> <c053968f-fd0d-ac24-bb86-01f58646c0d3@redhat.com> <c79f44f2-3006-b878-9c1c-4a406f50bb99@imgtec.com> <0e65e936-dbd9-5fb4-5a8d-fa885c585a09@redhat.com>
On 01/01/17 22:27, Jeff Law wrote:
> On 12/20/2016 07:38 AM, James Cowgill wrote:
>> Hi,
>>
>> On 19/12/16 21:43, Jeff Law wrote:
>>> On 12/19/2016 08:44 AM, James Cowgill wrote:
>>>> 2016-12-16 James Cowgill <James.Cowgill@imgtec.com>
>>>>
>>>> PR rtl-optimization/65618
>>>> * emit-rtl.c (try_split): Update "after" when moving a
>>>> NOTE_INSN_CALL_ARG_LOCATION.
>>>>
>>>> diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
>>>> index 7de17454037..6be124ac038 100644
>>>> --- a/gcc/emit-rtl.c
>>>> +++ b/gcc/emit-rtl.c
>>>> @@ -3742,6 +3742,11 @@ try_split (rtx pat, rtx_insn *trial, int last)
>>>> next = NEXT_INSN (next))
>>>> if (NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
>>>> {
>>>> + /* Advance after to the next instruction if it is about to
>>>> + be removed. */
>>>> + if (after == next)
>>>> + after = NEXT_INSN (after);
>>>> +
>>>> remove_insn (next);
>>>> add_insn_after (next, insn, NULL);
>>>> break;
>>>>
>>> So the thing I don't like when looking at this code is we set AFTER
>>> immediately upon entry to try_split. But we don't use it until near the
>>> very end of try_split. That's just asking for trouble.
>>>
>>> Can we reasonably initialize AFTER just before it's used?
>>
>> I wasn't sure but looking closer I think that would be fine. This patch
>> also works and does what Richard Sandiford suggested in the PR.
>>
>> 2016-12-20 James Cowgill <James.Cowgill@imgtec.com>
>>
>> PR rtl-optimization/65618
>> * emit-rtl.c (try_split): Move initialization of "before" and
>> "after" to just before the call to emit_insn_after_setloc.
> OK.
Great. Can you commit this for me, since I don't have commit access?
Thanks,
James