This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Ping, IRA] Segfault in ira_costs.c:find_costs_and_classes for AVR target
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 14 Jan 2014 12:07:32 -0500
- Subject: Re: [Ping, IRA] Segfault in ira_costs.c:find_costs_and_classes for AVR target
- Authentication-results: sourceware.org; auth=none
- References: <20131226094124 dot GA28905 at atmel dot com> <20140113085409 dot GA11422 at atmel dot com>
On 01/13/2014 03:54 AM, Senthil Kumar Selvaraj wrote:
> Ping !
>
> Regards
> Senthil
>
> On Thu, Dec 26, 2013 at 03:11:25PM +0530, Senthil Kumar Selvaraj wrote:
>> Hi,
>>
>> gcc.c-torture/compile/pr34856.c and a couple of other tests segfault
>> for the AVR target. Looking at the code, I found that the
>> x_ira_register_move_cost array[TImode] is NULL, while the code goes on
>> to dereference it (ira_register_move_cost
>> [ALLOCNO_MODE (a)][best][aclass] at line 1832).
>>
>> I looked at the code that populates the array, and found that it does
>> explicitly allow the array to have NULL entries for certain modes,
>> atleast during initialization.
>>
>> I'm not really sure how this should be fixed - is NULL valid or is the
>> AVR target violating some invariant?
>>
>> Regards
>> Senthil
>>
>>
>>
Sorry for the delay with the answer. NULL is not valid. IRA calculates
many internal data structures. So some people implemented a lazy
approach in such data structure calculation (NULL means that the data
were not calculated yet). Probably, one place was missed or added
lately without checking that data were calculated.
I'll look at this and fix the problem this week.
Thanks for pointing this out, Senthil.