From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20070 invoked by alias); 28 Jul 2010 17:38:54 -0000 Received: (qmail 20054 invoked by uid 22791); 28 Jul 2010 17:38:52 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Jul 2010 17:38:46 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6SHcb88030027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Jul 2010 13:38:37 -0400 Received: from anchor.twiddle.home (ovpn-113-67.phx2.redhat.com [10.3.113.67]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SHcaKG008148; Wed, 28 Jul 2010 13:38:36 -0400 Message-ID: <4C506B1C.40905@redhat.com> Date: Wed, 28 Jul 2010 17:40:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1 MIME-Version: 1.0 To: Kai Tietz CC: Andi Kleen , GCC Patches Subject: Re: [patch i386]: Add for win32 targets pre-prologue profiling feature References: <4C3C942D.3010101@redhat.com> <87630is1gi.fsf@basil.nowhere.org> <4C409173.8000303@redhat.com> <4C450967.9030801@redhat.com> <4C505199.6000609@redhat.com> <20100728160018.GA19334@basil.fritz.box> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg02205.txt.bz2 On 07/28/2010 10:23 AM, Kai Tietz wrote: > * config/i386/i386.h (MCOUNT_NAME_BEFORE_PROLOGUE): New. > * config/i386/i386.c (ix86_profile_before_prologue): New. > (override_options): Add special handling for -mfentry. > (ix86_function_regparm): Likewise. > (ix86_function_sseregparm): Likewise. > (ix86_frame_pointer_required): Likewise. > (ix86_expand_prologue): Check for ms_hook_prologue. > (x86_function_profiler): Adjust mcount output. > (TARGET_PROFILE_BEFORE_PROLOGUE): Define hook. > * config/i386/i386.opt (mfentry): New. > * doc/invoke.texi (mfentry): Add documentation. > * doc/tm.texi: Regenerated.. > * doc/tm.texi.in (TARGET_PROFILE_BEFORE_PROLOGUE): New. > * final.c (final_start_function): Replace macro > PROFILE_BEFORE_PROLOGUE by target hook. > * function.c (thread_prologue_and_epilogue_insns): Likewise. > * target.def (profile_before_prologue): New hook. > * targhooks.c (default_profile_before_prologue): New. > * targhooks.h (default_profile_before_prologue): New. > > Ok for apply? Nearly. > + if (flag_fentry == -1) > +#if defined(PROFILE_BEFORE_PROLOGUE) > + flag_fentry = ((!TARGET_64BIT && flag_pic) ? 0 : 1); > +#else > + flag_fentry = 0; > +#endif > + if (flag_fentry != 0 && !TARGET_64BIT && flag_pic) > + { > + sorry ("-mfentry isn't support for x86 in combination with -fpic"); > + flag_fentry = 0; > + } Better as if (!TARGET_64BIT && flag_pic) { if (flag_fentry > 0) sorry ("-mfentry isn't support for x86 in combination with -fpic"); flag_fentry = 0; } if (flag_fentry < 0) { #if defined(PROFILE_BEFORE_PROLOGUE) flag_fentry = 1; #else flag_fentry = 0; #endif } Ok with that change. r~