From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 06:34:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A461C9B; Thu, 18 Sep 2014 06:34:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEF1B245; Thu, 18 Sep 2014 06:34:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6YRuv040480; Thu, 18 Sep 2014 06:34:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6YRvU040479; Thu, 18 Sep 2014 06:34:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180634.s8I6YRvU040479@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271739 - stable/10/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 06:34:28 -0000 Author: dim Date: Thu Sep 18 06:34:27 2014 New Revision: 271739 URL: http://svnweb.freebsd.org/changeset/base/271739 Log: MFC r271597: Pull in r217410 from upstream llvm trunk (by Bob Wilson): Set trunc store action to Expand for all X86 targets. When compiling without SSE2, isTruncStoreLegal(F64, F32) would return Legal, whereas with SSE2 it would return Expand. And since the Target doesn't seem to actually handle a truncstore for double -> float, it would just output a store of a full double in the space for a float hence overwriting other bits on the stack. Patch by Luqman Aden! This should fix clang -O0 on i386 assigning garbage to floats, in certain scenarios. PR: 187437 Submitted by: cebd@gmail.com Approved by: re (marius) Obtained from: http://llvm.org/viewvc/llvm-project?rev=217410&view=rev Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 05:43:19 2014 (r271738) +++ stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 06:34:27 2014 (r271739) @@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc setTruncStoreAction(MVT::i32, MVT::i8 , Expand); setTruncStoreAction(MVT::i16, MVT::i8, Expand); + setTruncStoreAction(MVT::f64, MVT::f32, Expand); + // SETOEQ and SETUNE require checking two conditions. setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand); setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand); @@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc AddPromotedToType (ISD::SELECT, VT, MVT::v2i64); } - setTruncStoreAction(MVT::f64, MVT::f32, Expand); - // Custom lower v2i64 and v2f64 selects. setOperationAction(ISD::LOAD, MVT::v2f64, Legal); setOperationAction(ISD::LOAD, MVT::v2i64, Legal);