This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Add for win32 targets pre-prologue profiling feature


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]