From patchwork Thu Dec 12 21:18:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 300762 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 120CD2C00A2 for ; Fri, 13 Dec 2013 08:18:58 +1100 (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:content-type; q= dns; s=default; b=Fm5sFbeMjnJEj8iy3ih/ivHMTV0/7d3IPIJMFR9X3XHlHK RqnsgDC3UrMgwxBcmFs6mD+kOJssCrplEogd1jt4ZE0Pze/EQtpL4349Nm9QlAmz so4NWFiKfs8m111LbZgcK8VUDfRyS1MJ957Pbeq6xuJAJ7yCjT20pndCGwKM0= 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:content-type; s= default; bh=45cr6fQvZTMiq82EfvCiqRLoyqk=; b=DL9pO62KN99L+Av20uq3 bIPS6rDWMGRntUX9bA2+uV6I+BO8o80FeN2jYqT54fD7UgqiSfj85ofwcgxH/gB4 l7+PfSIl9MfehjtBjtk3B1V+NTyK5eLQagQK3e8bHbJpnhJBio/xkuzAzhO8kyHN J0HOD672NtxdUZF1kPUorow= Received: (qmail 18987 invoked by alias); 12 Dec 2013 21:18:52 -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 18971 invoked by uid 89); 12 Dec 2013 21:18:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 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; Thu, 12 Dec 2013 21:18:49 +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 rBCLIlSt009638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 12 Dec 2013 16:18:48 -0500 Received: from stumpy.slc.redhat.com (ovpn-113-90.phx2.redhat.com [10.3.113.90]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBCLIlYw008028 for ; Thu, 12 Dec 2013 16:18:47 -0500 Message-ID: <52AA2837.60609@redhat.com> Date: Thu, 12 Dec 2013 14:18:47 -0700 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: gcc-patches Subject: [PATCH] Obvious bugfix to x86 machine description X-IsSubscribed: yes I stumbled over this while trying to fix one of the regressions for 4.9. This peep2 pattern in the x86 backend is obviously broken as it does not have a mode on the zero_extend in the resulting insn. As a result, if/when this peep2 matches we get an unrecognized insn. (define_peephole2 [(set (match_operand:DI 0 "register_operand") (zero_extend:DI (mult:SI (match_operand:SI 1 "register_operand") (match_operand:SI 2 "const_int_operand"))))] "TARGET_64BIT && exact_log2 (INTVAL (operands[2])) >= 0 && REGNO (operands[0]) == REGNO (operands[1]) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (zero_extend (ashift:SI (match_dup 1) (match_dup 2)))) (clobber (reg:CC FLAGS_REG))])] "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[2])));") It's obvious the zero_extend should have been DImode. I searched i386.md for other occurrences but didn't find any (remaining modeless extensions were on the peep2 and define_split input side patterns). Bootstrapped and regression tested on x86_64-unknown-linux-gnu. Installed as obvious. No testcase as triggering requires local hackery. * i386.md (simple LEA peephole2): Add missing mode to zero_extend for zero-extended MULT simple LEA pattern. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 6ac2802..ab5b33f 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -17464,7 +17464,7 @@ && REGNO (operands[0]) == REGNO (operands[1]) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) - (zero_extend (ashift:SI (match_dup 1) (match_dup 2)))) + (zero_extend:DI (ashift:SI (match_dup 1) (match_dup 2)))) (clobber (reg:CC FLAGS_REG))])] "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[2])));")