From patchwork Thu Jul 22 18:24:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 59623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B3F46B70E1 for ; Fri, 23 Jul 2010 04:25:53 +1000 (EST) Received: (qmail 20269 invoked by alias); 22 Jul 2010 18:25:52 -0000 Received: (qmail 20255 invoked by uid 22791); 22 Jul 2010 18:25:51 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Jul 2010 18:25:46 +0000 Received: (qmail 13932 invoked from network); 22 Jul 2010 18:25:44 -0000 Received: from unknown (HELO ?84.152.207.158?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Jul 2010 18:25:44 -0000 Message-ID: <4C488CE9.1080504@codesourcery.com> Date: Thu, 22 Jul 2010 20:24:41 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100625 Thunderbird/3.0.5 MIME-Version: 1.0 To: Nathan Froyd CC: Vladimir Makarov , Jeff Law , GCC Patches Subject: Re: Patch 10/9: track subwords of DImode allocnos References: <4C1B7BC0.7010803@codesourcery.com> <4C1F9B96.4030007@codesourcery.com> <4C3CCFE4.3030203@redhat.com> <4C3CD626.3050600@codesourcery.com> <4C3CE28D.3050103@redhat.com> <4C3D1A37.40300@codesourcery.com> <20100722180035.GE26037@codesourcery.com> In-Reply-To: <20100722180035.GE26037@codesourcery.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 07/22/2010 08:00 PM, Nathan Froyd wrote: > http://gcc.gnu.org/ml/gcc-patches/2010-06/msg02056.html > > causes ICEs with powerpc-eabispe when compiling -msoft-float's libgcc: > > ../../.././gcc/dp-bit.c: In function '_fpadd_parts': > ../../.././gcc/dp-bit.c:731:1: internal compiler error: in check_allocation, at ira.c:1629 > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > > I am way out of my depth debugging this code; I tried loading everything > into gdb to provide a little more useful information, but of course the > compilation succeeds when cc1 is being run under gdb. :( At least this seems at first glance only to be a bug in the verification. Can you test the attached patch? Bernd Index: ira.c =================================================================== --- ira.c (revision 162421) +++ ira.c (working copy) @@ -1624,11 +1624,14 @@ check_allocation (void) || (hard_regno = ALLOCNO_HARD_REGNO (a)) < 0) continue; nregs = hard_regno_nregs[hard_regno][ALLOCNO_MODE (a)]; - if (n > 1) - { - gcc_assert (n == nregs); - nregs = 1; - } + if (nregs == 1) + /* We allocated a single hard register. */ + n = 1; + else if (n > 1) + /* We allocated multiple hard registers, and we will test + conflicts in a granularity of single hard regs. */ + nregs = 1; + for (i = 0; i < n; i++) { ira_object_t obj = ALLOCNO_OBJECT (a, i); @@ -1648,7 +1651,13 @@ check_allocation (void) int conflict_hard_regno = ALLOCNO_HARD_REGNO (conflict_a); if (conflict_hard_regno < 0) continue; - if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1) + + conflict_nregs + = (hard_regno_nregs + [conflict_hard_regno][ALLOCNO_MODE (conflict_a)]); + + if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1 + && conflict_nregs == ALLOCNO_NUM_OBJECTS (conflict_a)) { if (WORDS_BIG_ENDIAN) conflict_hard_regno += (ALLOCNO_NUM_OBJECTS (conflict_a) @@ -1657,10 +1666,6 @@ check_allocation (void) conflict_hard_regno += OBJECT_SUBWORD (conflict_obj); conflict_nregs = 1; } - else - conflict_nregs - = (hard_regno_nregs - [conflict_hard_regno][ALLOCNO_MODE (conflict_a)]); if ((conflict_hard_regno <= this_regno && this_regno < conflict_hard_regno + conflict_nregs)