This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, RQ Review] convert emulated TLS so that it works with LTO and WHOPR.
On 09/06/2010 21:22, Jakub Jelinek wrote:
> On Wed, Jun 09, 2010 at 09:09:03PM +0100, IainS wrote:
>> void
>> __emutls_register_common (struct __emutls_object *obj,
>> word size, word align, void *templ)
>> {
>> + if (!obj)
>> + abort ();
>
> Why? obj->size will crash too, and gcc shouldn't be calling
> __emutls_register_common with NULL anyway.
Should be a gcc_assert then, shouldn't it?
> +/*
> + DECL_PRESERVE_P (to) = 1;*/
> +
Commented-out or #if-0'd code should be removed before committing.
> + TREE_USED (to) = TREE_USED (decl);
> +
> TREE_STATIC (to) = TREE_STATIC (decl);
> - TREE_USED (to) = TREE_USED (decl);
> - TREE_PUBLIC (to) = TREE_PUBLIC (decl);
> DECL_EXTERNAL (to) = DECL_EXTERNAL (decl);
> DECL_COMMON (to) = DECL_COMMON (decl);
> +
> + TREE_PUBLIC (to) = TREE_PUBLIC (decl);
Should avoid non-functional shuffling of existing code.
> + if (!targetm.have_tls
> + && (TREE_CODE (decl) == VAR_DECL)
> + && DECL_THREAD_LOCAL_P (decl))
> + /* We should never get here. */
> + return ;
If you really should never get there, abort or ICE, don't return.
cheers,
DaveK