From owner-svn-src-all@FreeBSD.ORG Mon Oct 13 12:45:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35AE9106568E; Mon, 13 Oct 2008 12:45:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7BF48FC1E; Mon, 13 Oct 2008 12:45:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DCjI40076491; Mon, 13 Oct 2008 12:45:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DCjIsR076490; Mon, 13 Oct 2008 12:45:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810131245.m9DCjIsR076490@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 13 Oct 2008 12:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183818 - in stable/7/sys: . i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 13 Oct 2008 12:45:19 -0000 Author: kib Date: Mon Oct 13 12:45:18 2008 New Revision: 183818 URL: http://svn.freebsd.org/changeset/base/183818 Log: MFC r180756 (by luoqi): Unbreak cc -pg support on i386 by changing mcount() to always preserve %ecx. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/i386/include/profile.h Modified: stable/7/sys/i386/include/profile.h ============================================================================== --- stable/7/sys/i386/include/profile.h Mon Oct 13 12:28:33 2008 (r183817) +++ stable/7/sys/i386/include/profile.h Mon Oct 13 12:45:18 2008 (r183818) @@ -115,7 +115,15 @@ void user(void); void \ mcount() \ { \ - uintfptr_t selfpc, frompc; \ + uintfptr_t selfpc, frompc, ecx; \ + /* \ + * In gcc 4.2, ecx might be used in the caller as the arg \ + * pointer if the stack realignment option is set (-mstackrealign) \ + * or if the caller has the force_align_arg_pointer attribute \ + * (stack realignment is ALWAYS on for main). Preserve ecx \ + * here. \ + */ \ + __asm("" : "=c" (ecx)); \ /* \ * Find the return address for mcount, \ * and the return address for mcount's caller. \ @@ -132,6 +140,7 @@ mcount() \ __asm("movl (%%ebp),%0" : "=r" (frompc)); \ frompc = ((uintfptr_t *)frompc)[1]; \ _mcount(frompc, selfpc); \ + __asm("" : : "c" (ecx)); \ } #else /* !__GNUCLIKE_ASM */ #define MCOUNT