This is the mail archive of the
mailing list for the GCC project.
Re: [patch i386]: Add for win32 targets pre-prologue profiling feature
- From: Richard Henderson <rth at redhat dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 13 Jul 2010 09:28:29 -0700
- Subject: Re: [patch i386]: Add for win32 targets pre-prologue profiling feature
- References: <AANLkTimkEGrAkpdvwlTFV-Ad1wBUIQ02PV_8VG5BBRM9@mail.gmail.com>
On 07/13/2010 05:47 AM, Kai Tietz wrote:
> This patch adds for i386/x86_64 win32 targets the feature of
> pre-prologue profiling call. It additional takes care that for enabled
> top-profiler call, the frame-pointer gets omitted, if possible.
> One side-note here about "hotfix" and profiling. The top-profiler call
> gets emitted in the ix86_asm_output_function_label. This is caused by
> the fact, that for ix86 the call needs to be placed before the
> code-pattern, and for x86_64 it can be placed after. Otherwise the x86
> pattern for patchable region would be corrupted, as this pattern
> contains frame-register setup. So I think that the use of the macro
> PROFILE_BEFORE_PROLOGUE isn't usable here.
Huh? This is exactly the opposite of what we discussed yesterday on IRC.
For hotfix we have
mov.s edi, edi
mov.s esp, ebp
If *any* of the above is not exactly so, then the runtime pattern match
fails and the hotfix fails. If we were to write the profiler first,
then we might as well not bother with the hotfix pieces, because they
will never match.
... of course it doesn't help that we emit the last two insns above
within the prologue, so if we simply place the profile before the
prologue, we'll *still* be splitting the hotfix sequence for 32-bit.
I think the best thing to do is to diagnose hotfix+profile and generate
an error. I don't think there's anything reasonable we can do.
In the end I don't think there's anything your AT_TOP macro does that
PROFILE_BEFORE_PROLOGUE doesn't do just as well.