From patchwork Sun May 20 17:04:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 160273 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 47C63B6FAB for ; Mon, 21 May 2012 03:04:46 +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=1338138287; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version: Content-Type:Content-Disposition:User-Agent:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=dqrjKKz077BYz6Uq/xcfKkDiIMk=; b=SMurzr1thsiR/cLWJfmqdCQi7i5DOiL+Gs9z6AFi9uKsmCqGxyo/OQNZRY/M/N wX4TPP+uvGdcRT54KRDmO+ZL206t+A6YSn0U8+h2SdhLV34AuQUfKReu87f7I0vB QaLp5nyAh6MBZAA7kxTRZcpZbDMcfjBWAeeU2M2fnmznA= 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:X-ExtLoop1:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=SBiiMRvh42ALm13RxGl6kGl1wqV6IqOiFUGAAVX7ZME3HL7cCQ6M4OHNBCwx5f 2WjOHlnOdxrDUKlk1GA5SlKtQLz0zot++MPrAIdu45yBn/z3XdUHxF12nR3SEvgi WKRXYlCYYeF/wAy+cwOFyZI0X8W5U7lwH05p55djxt8tA=; Received: (qmail 5219 invoked by alias); 20 May 2012 17:04:41 -0000 Received: (qmail 5206 invoked by uid 22791); 20 May 2012 17:04:40 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 May 2012 17:04:27 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 20 May 2012 10:04:27 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 20 May 2012 10:04:26 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id C3A31C1DEA; Sun, 20 May 2012 10:04:26 -0700 (PDT) Date: Sun, 20 May 2012 10:04:26 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org, Uros Bizjak Subject: PATCH: PR target/53416: Wrong code when optimising loop involving _rdrand32_step Message-ID: <20120520170426.GA7774@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, rdrand_1 must be marked with unspec_volatile since it returns a different value every time. OK for trunk, 4.7 and 4.6? Thanks. H.J. ---- PR target/53416 * config/i386/i386.md (UNSPEC_RDRAND): Renamed to ... (UNSPECV_RDRAND): This. (rdrand_1): Updated. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index cce78b5..9327acf 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -176,9 +176,6 @@ ;; For CRC32 support UNSPEC_CRC32 - ;; For RDRAND support - UNSPEC_RDRAND - ;; For BMI support UNSPEC_BEXTR @@ -208,6 +205,9 @@ UNSPECV_WRFSBASE UNSPECV_WRGSBASE + ;; For RDRAND support + UNSPECV_RDRAND + ;; For RTM support UNSPECV_XBEGIN UNSPECV_XEND @@ -18399,9 +18399,9 @@ (define_insn "rdrand_1" [(set (match_operand:SWI248 0 "register_operand" "=r") - (unspec:SWI248 [(const_int 0)] UNSPEC_RDRAND)) + (unspec_volatile:SWI248 [(const_int 0)] UNSPECV_RDRAND)) (set (reg:CCC FLAGS_REG) - (unspec:CCC [(const_int 0)] UNSPEC_RDRAND))] + (unspec_volatile:CCC [(const_int 0)] UNSPECV_RDRAND))] "TARGET_RDRND" "rdrand\t%0" [(set_attr "type" "other")