From owner-svn-src-stable@FreeBSD.ORG Fri Feb 22 18:33:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 06149B9; Fri, 22 Feb 2013 18:33:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3B27194; Fri, 22 Feb 2013 18:33:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1MIXgYl068129; Fri, 22 Feb 2013 18:33:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1MIXgqM068128; Fri, 22 Feb 2013 18:33:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302221833.r1MIXgqM068128@svn.freebsd.org> From: Dimitry Andric Date: Fri, 22 Feb 2013 18:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247156 - stable/9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2013 18:33:43 -0000 Author: dim Date: Fri Feb 22 18:33:42 2013 New Revision: 247156 URL: http://svnweb.freebsd.org/changeset/base/247156 Log: MFC r246858: Pull in r175057 from upstream llvm trunk: X86: Disable generation of rep;movsl when %esi is used as a base pointer. This happens when there is both stack realignment and a dynamic alloca in the function. If we overwrite %esi (rep;movsl uses fixed registers) we'll lose the base pointer and the next register spill will write into oblivion. Fixes PR15249 and unbreaks firefox on i386/freebsd. Mozilla uses dynamic allocas and freebsd a 4 byte stack alignment. Modified: stable/9/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp Fri Feb 22 18:30:41 2013 (r247155) +++ stable/9/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp Fri Feb 22 18:33:42 2013 (r247156) @@ -202,6 +202,14 @@ X86SelectionDAGInfo::EmitTargetCodeForMe SrcPtrInfo.getAddrSpace() >= 256) return SDValue(); + // ESI might be used as a base pointer, in that case we can't simply overwrite + // the register. Fall back to generic code. + const X86RegisterInfo *TRI = + static_cast(DAG.getTarget().getRegisterInfo()); + if (TRI->hasBasePointer(DAG.getMachineFunction()) && + TRI->getBaseRegister() == X86::ESI) + return SDValue(); + MVT AVT; if (Align & 1) AVT = MVT::i8;