From patchwork Thu Jan 10 19:48:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 211137 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 5F9512C046C for ; Fri, 11 Jan 2013 06:49:29 +1100 (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=1358452170; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=sStcOwR 5t78E65Vjr2o1DsfVSsE=; b=Jme8/DegYdMO10gPq/BD5X5LFdQ8Wuz87YZBuGP Mqn2/EkqSKPWYCBA5boGOWPgKf/afgH3e4IyumSVMsmXhO/lrX+oZ6d8F+3PEaOT ueD35TwzehndrfkdmmyhYk4yTQbZTEuhNyIOwfMORsc2Q1MaO1qot24xIZwZvvLs mROI= 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:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=laYppH0qtoAaPxi29YAYYbu1kYhMSCiK7TdbxhLbXetUkMoxpq84rdGl6+CpbO PdiT7bX12Ciekp2OVP1kA8spmnovA2+wswOqrUOu0fOPHM6cB0S77zJh+1SmBFZf g2g4VReSv+PvaEFoqV7t3rPWNXxhppMnkLSqC4u2JCGZ0=; Received: (qmail 4629 invoked by alias); 10 Jan 2013 19:48:31 -0000 Received: (qmail 4559 invoked by uid 22791); 10 Jan 2013 19:48:28 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-ob0-f179.google.com (HELO mail-ob0-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jan 2013 19:48:21 +0000 Received: by mail-ob0-f179.google.com with SMTP id x4so981236obh.38 for ; Thu, 10 Jan 2013 11:48:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.162.69 with SMTP id xy5mr52186114obb.95.1357847299767; Thu, 10 Jan 2013 11:48:19 -0800 (PST) Received: by 10.182.153.201 with HTTP; Thu, 10 Jan 2013 11:48:19 -0800 (PST) Date: Thu, 10 Jan 2013 20:48:19 +0100 Message-ID: Subject: [PATCH, i386]: Fix PR55929, unable to generate reloads for xbegin insn From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! As mentioned by Andrew is PR, reload can't handle jump_insns. Expand with %eax hard register temporary to avoid this limitation. 2012-01-10 Uros Bizjak PR target/55929 * config/i386/i386.md (xbegin): Use %eax as a temporary register. Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32} and by compiling libitm/beginend.cc preprocessed source with -Os mrtm -std=gnu++0x. Committed to mainline SVN. Uros. Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 195091) +++ config/i386/i386.md (working copy) @@ -18013,19 +18013,22 @@ (define_expand "xbegin" [(set (match_operand:SI 0 "register_operand") - (unspec_volatile:SI [(match_dup 1)] UNSPECV_XBEGIN))] + (unspec_volatile:SI [(const_int 0)] UNSPECV_XBEGIN))] "TARGET_RTM" { rtx label = gen_label_rtx (); - operands[1] = force_reg (SImode, constm1_rtx); + /* xbegin is emitted as jump_insn, so reload won't be able + to reload its operand. Force the value into AX hard register. */ + rtx ax_reg = gen_rtx_REG (SImode, AX_REG); + emit_move_insn (ax_reg, constm1_rtx); - emit_jump_insn (gen_xbegin_1 (operands[1], label)); + emit_jump_insn (gen_xbegin_1 (ax_reg, label)); emit_label (label); LABEL_NUSES (label) = 1; - emit_move_insn (operands[0], operands[1]); + emit_move_insn (operands[0], ax_reg); DONE; })