From patchwork Sat Jun 29 00:37:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 255700 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 780672C008F for ; Sat, 29 Jun 2013 10:37:49 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=UUkpL6SoneZop9qvq LXpT4w7uhAJ034xayGfYZJ5fd2xwY8hvSkShh5/Vaq7/8PzTgGob8fCm7FiEFh9X DhKyXT2nj0MgpBOOB/6y+G5ihId6qbFlcFxygK6FX8vHpR8L3Vqdj5SxQCQaOCsj 8rjMsWoskHrvuV+WEo6NcAuhMo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=LUlEKdgLEWka+LAxWIaoyok Apdc=; b=uYGwfr9bG0IoKVBdoSAEP0ui90EWVnldE0X4k/WqXG81WRQmpvYMtKp sbYNm1OAX/Nv5cy4iRojXipa7SPLy8bQm81RwXtzH6rIJm5VFBKJhxaqRkexV/WA Wn5IDUQQme1mUvnhkUUt6MDMQgVHAyPOvm+XoABVfyaEmR0NjhXY= Received: (qmail 5749 invoked by alias); 29 Jun 2013 00:37:42 -0000 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 Received: (qmail 5720 invoked by uid 89); 29 Jun 2013 00:37:36 -0000 X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 29 Jun 2013 00:37:35 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5T0bXUu003602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 Jun 2013 20:37:33 -0400 Received: from Mair.local (vpn-55-218.rdu2.redhat.com [10.10.55.218]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5T0bWT4005188 for ; Fri, 28 Jun 2013 20:37:32 -0400 Message-ID: <51CE2C4C.8060700@redhat.com> Date: Fri, 28 Jun 2013 20:37:32 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: gcc-patches Subject: Re: patch to fix a bug in LRA hard reg splitting References: <51CC66D6.5060606@redhat.com> <51CDE86C.5090505@redhat.com> In-Reply-To: <51CDE86C.5090505@redhat.com> X-Virus-Found: No On 13-06-28 3:47 PM, Vladimir Makarov wrote: > On 13-06-27 12:22 PM, Vladimir Makarov wrote: >> The following patch fixes a LRA bug for some experimental target. >> Sorry, there is no a test case and the bug can not be reproduced by >> other people until the target is made public. >> >> > Here is one more fix for another hard reg splitting bug. > > The patch was successfully bootstrapped and tested on x86/x86-64. > > Committed as rev. 200553. > > 2013-06-28 Vladimir Makarov > > * lra-constraints.c (need_for_split_p): Check call used hard regs > living through calls. > > Sorry, I realized that the previous patch solves the problem in wrong way. Here is the patch with the right solution. The patch was successfully bootstrapped and tested on x86/x86-64. Committed as rev. 200558. 2013-06-28 Vladimir Makarov Revert: 2013-06-28 Vladimir Makarov * lra-constraints.c (need_for_split_p): Check call used hard regs living through calls. * lra-constraints.c (inherit_in_ebb): Reset live_hard_regs for call used regs for call insn. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 200553) +++ lra-constraints.c (working copy) @@ -4201,15 +4201,6 @@ need_for_split_p (HARD_REG_SET potential && (regno >= FIRST_PSEUDO_REGISTER || ! TEST_HARD_REG_BIT (eliminable_regset, hard_regno)) && ! TEST_HARD_REG_BIT (lra_no_alloc_regs, hard_regno) - /* Don't split call clobbered hard regs living through - calls, otherwise we might have a check problem in the - assign sub-pass as in the most cases (exception is a - situation when lra_risky_transformations_p value is - true) the assign pass assumes that all pseudos living - through calls are assigned to call saved hard regs. */ - && (regno >= FIRST_PSEUDO_REGISTER - || ! TEST_HARD_REG_BIT (call_used_reg_set, regno) - || usage_insns[regno].calls_num == calls_num) /* We need at least 2 reloads to make pseudo splitting profitable. We should provide hard regno splitting in any case to solve 1st insn scheduling problem when @@ -4887,6 +4878,7 @@ inherit_in_ebb (rtx head, rtx tail) usage_insns[regno].calls_num = calls_num; bitmap_set_bit (&check_only_regs, regno); } + AND_COMPL_HARD_REG_SET (live_hard_regs, call_used_reg_set); } to_inherit_num = 0; /* Process insn usages. */