This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [CFT, try 8] Emulated tls rewrite
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: IainS <developer at sandoe-acoustics dot co dot uk>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Jul 2010 17:53:35 +0200
- Subject: Re: [CFT, try 8] Emulated tls rewrite
- References: <4C3E4D3C.1030205@redhat.com> <4C44AA95.9000505@redhat.com>
On Mon, Jul 19, 2010 at 9:42 PM, Richard Henderson <rth@redhat.com> wrote:
> This should be really close to the final version.
>
> I've eliminated a couple of the hacks that remained in v7. ?In particular, all of the
> GC'd data from v7 is now localized to the IPA pass. ?Which means that I no longer have
> to have a hack in varpool.c to avoid a ggc_free call. ?There are almost no references
> to emulated tls remaining outside tree-emutls.c.
>
> The one remaining hack is localized to one line in dwarf2out.c. ?If a target arranges
> with gdb the meaning of DW_OP_form_tls_address, as vxworks apparently does, then we
> need some way to associate the original TLS variable with its control variable. ?I
> accomplish this by storing the control variable in DECL_VALUE_EXPR.
>
> At first this sounds gross, but I had already been storing a non-null value in
> DECL_VALUE_EXPR as a way to indicate to generic verify code that TLS variables should
> no longer appear in gimple code. ?To a greater or lesser extent DECL_VALUE_EXPR is
> also a way to communicate a complicated storage location for a DECL with the debug
> output routines. ?The only difference here is that I don't store the entire call
> expression and dereference as well. ?Given that we're already special-casing TLS
> variables, this doesn't seem so bad after all.
Some functions in the new pass lack function comments.
+ /* For normal statements, we let update_stmt do its job. But for phi
+ nodes, we have to manipulate the immediate use list by hand. */
+ if (wi.changed)
+ {
+ gcc_assert (TREE_CODE (pd->def) == SSA_NAME);
+ link_imm_use_stmt (&pd->imm_use, pd->def, phi);
+ }
if you can use SET_USE here it will do the immediate-use handling
for you. Might not be very convenient here, so probably the above
is ok.
+ /* If the block is empty, of course we use it. */
+ gsi = gsi_last_bb (src);
+ if (gsi_end_p (gsi))
+ goto return_pred;
it looks like this might cause -g vs. -g0 issues, so better use
gsi_last_nondebug_bb here.
Which makes me wonder how we lower emultls accesses inside
debug stmts?
Otherwise the patch looks good to me.
Thanks,
Richard.
>
> r~
>