This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix regrename pass to ensure renamings produce valid insns
- From: Chung-Lin Tang <cltang at codesourcery dot com>
- To: Sandra Loosemore <sandra at codesourcery dot com>, Kito Cheng <kito dot cheng at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, "Schmidt, Bernd - Code Sourcery" <bernds at codesourcery dot com>
- Date: Tue, 30 Jun 2015 13:13:21 +0800
- Subject: Re: [patch] fix regrename pass to ensure renamings produce valid insns
- Authentication-results: sourceware.org; auth=none
- References: <5581AA41 dot 7010201 at codesourcery dot com> <1919634 dot FPIRa5rfyH at polaris> <558A0130 dot 9010202 at codesourcery dot com> <558B7998 dot 80201 at redhat dot com> <5590624E dot 8090409 at codesourcery dot com> <CA+yXCZBiSOs8AxOAs93K65kvJBpewUjiYmy5UtcSAawB1Suzmg at mail dot gmail dot com> <55921988 dot 8060106 at codesourcery dot com>
On 2015/6/30 12:22 PM, Sandra Loosemore wrote:
> On 06/29/2015 09:07 PM, Kito Cheng wrote:
>> Hi all:
>>
>> This patch seem will broken when disable assert checking for c6x....
>>
>> Index: gcc/config/c6x/c6x.c
>> ===================================================================
>> --- gcc/config/c6x/c6x.c (revision 225104)
>> +++ gcc/config/c6x/c6x.c (working copy)
>> @@ -3516,7 +3516,7 @@ try_rename_operands (rtx_insn *head, rtx
>> best_reg =
>> find_rename_reg (this_head, super_class, &unavailable, old_reg, true);
>>
>> - regrename_do_replace (this_head, best_reg);
>> + gcc_assert (regrename_do_replace (this_head, best_reg));
>>
>> count_unit_reqs (new_reqs, head, PREV_INSN (tail));
>> merge_unit_reqs (new_reqs);
>> @@ -3529,7 +3529,7 @@ try_rename_operands (rtx_insn *head, rtx
>> unit_req_imbalance (reqs), unit_req_imbalance (new_reqs));
>> }
>> if (unit_req_imbalance (new_reqs) > unit_req_imbalance (reqs))
>> - regrename_do_replace (this_head, old_reg);
>> + gcc_assert (regrename_do_replace (this_head, old_reg));
>> else
>> memcpy (reqs, new_reqs, sizeof (unit_req_table));
>>
>
> I'm sorry; do you have a suggestion for a fix? I thought this was the change I was asked to make, and as I noted previously, I'm not set up to test (or even build) for this target.
>
> -Sandra the obviously confused :-(
You probably have to separate out the regrename_do_replace() bool result into a variable,
placing the whole call into the gcc_assert() might make it disappear when assertions are turned off.
Chung-Lin