This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Non-working jit patch for debug-early (was Re: [patch 0/10] debug-early merge)
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, jason merrill <jason at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Fri, 08 May 2015 12:14:27 -0700
- Subject: Re: [PATCH] Non-working jit patch for debug-early (was Re: [patch 0/10] debug-early merge)
- Authentication-results: sourceware.org; auth=none
- References: <554C03B5 dot 9050705 at redhat dot com> <1431096076 dot 15215 dot 12 dot camel at surprise> <554CCFF2 dot 6000709 at redhat dot com> <1431106701 dot 15215 dot 25 dot camel at surprise>
On 05/08/2015 10:38 AM, David Malcolm wrote:
I tested your branch (at 09263eae7c260c305fa19ffa186afd1d89654fb8) with
the jit configuration from the docs:
../src/configure \
--enable-host-shared \
--enable-languages=jit,c++ \
--disable-bootstrap \
--enable-checking=release \
--prefix=$PREFIX
Sadly, the jit "frontend" fails to compile:
Whoops. My bad. I was unaware `jit' needed to be added to
--enable-languages. I thought it was tested automatically.
../../src/gcc/jit/jit-playback.c: In member function âvoid
gcc::jit::playback::context::write_global_decls_2()â:
../../src/gcc/jit/jit-playback.c:710:20: error: âconst struct
gcc_debug_hooksâ has no member named âglobal_declâ
debug_hooks->global_decl (decl);
The basic idea is that if your globals do NOT make it to
rest_of_decl_compilation(), you need to call
debug_hooks->early_global_decl() on them manually after parsing.
On the other hand, if your functions do NOT make it to the symbol table
then you also need to call debug_hooks->early_global_decl() on them
after parsing (see finalize_compilation_unit()).
The call to debug_hooks->late_global_decl() should be handled
automagically. I mean, I assume your symbols (functions and globals,
etc) make it to the symbol table, in which case they'll be picked up by
either compile_file() or by analyze_functions(). The latter in case the
symbol was optimized away and is about to be removed from the symbol table.
Does this help? If it doesn't, I can gladly take over this on Monday.
^
since the "global_decl" debug hook has gone away. I see that
LANG_HOOKS_WRITE_GLOBALS
also is no more, and this leads to various code in the jit becoming
dead:
../../src/gcc/jit/dummy-frontend.c:225:1: warning: âvoid
jit_langhook_write_globals()â defined but not used [-Wunused-function]
The attached patch gets it to compile, and eliminates the now-dead code,
but it's not clear to me how global variables are meant to be created in
the debug-early world.
Thanks for working on this.
Aldy