From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4802 invoked by alias); 14 Jan 2014 17:07:36 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 4790 invoked by uid 89); 14 Jan 2014 17:07:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Jan 2014 17:07:35 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0EH7Xqv010278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Jan 2014 12:07:33 -0500 Received: from topor.usersys.redhat.com ([10.15.16.142]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0EH7W6L027109; Tue, 14 Jan 2014 12:07:32 -0500 Message-ID: <52D56ED4.6070600@redhat.com> Date: Tue, 14 Jan 2014 19:10:00 -0000 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Senthil Kumar Selvaraj , gcc@gcc.gnu.org Subject: Re: [Ping, IRA] Segfault in ira_costs.c:find_costs_and_classes for AVR target References: <20131226094124.GA28905@atmel.com> <20140113085409.GA11422@atmel.com> In-Reply-To: <20140113085409.GA11422@atmel.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00124.txt.bz2 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.