From patchwork Thu Jun 7 19:51:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 163664 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 8D258B6FA3 for ; Fri, 8 Jun 2012 05:54:30 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1339703670; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=25UA9ic hjg9lgAlhlehRO+McUAQ=; b=mJwJNFRhFXWu6cKQXqjNQbLpo06DuWM7BBmCnbb IYeL1nRl5nlV00y7O9Pn1DQjTqdzdUm8Htfk5KpR/fNMrif2wkb/dyJt3U44fv+R +P4kYsNsUUJTVaXJQriY7TInFaeZ6oWQ2of45J95QfVqCxBMt6Uu0ZwvdBW+HXX8 kB3A= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Ef2tN+EN/u0Bw6D2Wz7BrNMkROWgO1Lut20Z1Jcanm2FSWX/hPbphoxgTyXjd4 eDeMGVFD6Ana+NNEhtLofzGVHbScr1xT2ee64Oyp0p55WXGvxp7JNeFGFuxoAvND myn5fUdsaoPR2BF+Y0YEsZ0bXd6OARdxBcBpk9OU1b6u8=; Received: (qmail 17048 invoked by alias); 7 Jun 2012 19:54:26 -0000 Received: (qmail 17039 invoked by uid 22791); 7 Jun 2012 19:54:25 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, MAY_BE_FORGED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jun 2012 19:54:09 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q57Js8lW006068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Jun 2012 15:54:08 -0400 Received: from toll.usersys.redhat.com (unused [10.15.16.165] (may be forged)) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q57Js8Pv007745 for ; Thu, 7 Jun 2012 15:54:08 -0400 Message-ID: <4FD1064F.4050201@redhat.com> Date: Thu, 07 Jun 2012 15:51:43 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: gcc-patches Subject: [lra] patch fixing spec2000 mesa code generation failure X-IsSubscribed: yes 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 The following patch mostly fixes spec2000 mesa code generation failure on x86 triggered by committing hard reg splitting patch. The patch was successfully bootstrapped on x86-64. Committed as rev. 188316. 2012-06-07 Vladimir Makarov * lra-constraints.c (split_reg): Fix comments and printing debug titles. (inherit_in_ebb): Check barrier too. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 188212) +++ lra-constraints.c (working copy) @@ -3954,9 +3954,10 @@ choose_split_class (enum reg_class alloc ... p <- s (new insn -- restore) <- ... p ... <- ... p ... - where p is an original pseudo got a hard register and s is a new - split pseudo. The save is put before INSN if BEFORE_P is true. - Return true if we succeed in such transformation. */ + where p is an original pseudo got a hard register or a hard + register and s is a new split pseudo. The save is put before INSN + if BEFORE_P is true. Return true if we succeed in such + transformation. */ static bool split_reg (bool before_p, int original_regno, rtx insn, rtx next_usage_insns) { @@ -4097,11 +4098,11 @@ split_reg (bool before_p, int original_r lra_process_new_insns (usage_insn, after_p ? NULL_RTX : restore, after_p ? restore : NULL_RTX, call_save_p - ? "Add pseudo<-save" : "Add pseudo<-split"); + ? "Add reg<-save" : "Add reg<-split"); lra_process_new_insns (insn, before_p ? save : NULL_RTX, before_p ? NULL_RTX : save, call_save_p - ? "Add save<-pseudo" : "Add split<-pseudo"); + ? "Add save<-reg" : "Add split<-reg"); if (lra_dump_file != NULL) fprintf (lra_dump_file, " ))))))))))))))))))))))))))))))))))))))))))))))))\n"); @@ -4337,7 +4338,7 @@ inherit_in_ebb (rtx head, rtx tail) { int i, src_regno, dst_regno; bool change_p, succ_p; - rtx prev_insn, next_usage_insns, set, first_insn, last_insn; + rtx prev_insn, next_usage_insns, set, first_insn, last_insn, next_insn; enum reg_class cl; struct lra_insn_reg *reg; basic_block last_processed_bb, curr_bb = NULL; @@ -4377,8 +4378,12 @@ inherit_in_ebb (rtx head, rtx tail) last_insn = get_non_debug_insn (false, curr_bb); after_p = (last_insn != NULL_RTX && ! JUMP_P (last_insn) && (! CALL_P (last_insn) - || find_reg_note (last_insn, - REG_NORETURN, NULL) == NULL_RTX)); + || (find_reg_note (last_insn, + REG_NORETURN, NULL) == NULL_RTX + && ((next_insn + = next_nonnote_nondebug_insn (last_insn)) + == NULL_RTX + || GET_CODE (next_insn) != BARRIER)))); REG_SET_TO_HARD_REG_SET (live_hard_regs, DF_LR_OUT (curr_bb)); IOR_HARD_REG_SET (live_hard_regs, eliminable_regset); IOR_HARD_REG_SET (live_hard_regs, lra_no_alloc_regs);