This is the mail archive of the
mailing list for the GCC project.
Re: [CHKP] Never expand instrumentation thunks
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jeff Law <law at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Ilya Enkovich <enkovich dot gnu at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 2 Apr 2015 23:13:42 +0200
- Subject: Re: [CHKP] Never expand instrumentation thunks
- Authentication-results: sourceware.org; auth=none
- References: <20150318121912 dot GB64546 at msticlxl57 dot ims dot intel dot com> <CAMbmDYbkqXzKT9iuchmnd5-GVbNvsBwDNLocKK1A100hHycSAQ at mail dot gmail dot com> <20150402201105 dot GF21276 at atrey dot karlin dot mff dot cuni dot cz> <551DA612 dot 3090901 at redhat dot com>
> On 04/02/2015 02:11 PM, Jan Hubicka wrote:
> >>>2015-03-18 Ilya Enkovich <email@example.com>
> >>> * cgraphunit.c (cgraph_node::expand_thunk): Don't expand
> >>> instrumentation thunks.
> >>>diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
> >>>index e640907..abc9cfe 100644
> >>>--- a/gcc/cgraphunit.c
> >>>+++ b/gcc/cgraphunit.c
> >>>@@ -1508,6 +1508,10 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
> >>> tree thunk_fndecl = decl;
> >>> tree a;
> >>>+ /* Instrumentation thunk is the same function with
> >>>+ a different signature. Never need to expand it. */
> >>>+ if (thunk.add_pointer_bounds_args)
> >>>+ return false;
> >Yeah, this is another case where we hit problem with transparent alias pretending
> >to be thunk :)
> >I guess the patch is OK for GCC-5 and for next stage1 we can clean this up.
> I was actually building a compiler so I could take a look at this
> one under a debugger ;-)
I think it is really the transparent alias issue. The comment seems pretty clear about it.
What is confusing is that instrumentation thunks are called thunks when they are
really not - thunk is a small hunk of code, while instrumentation thunk is a transparent
Too bad I did not notice we introduced transparent aliases, i would push out my
code for that. I will compare Ilya's changes with mine and hopefully we can
catch more bugs and unify the code next stage1.