This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trans-mem] optimize exception object memory
- From: Richard Henderson <rth at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Jul 2010 15:25:24 -0700
- Subject: Re: [trans-mem] optimize exception object memory
- References: <20100719212255.GA12644@redhat.com>
On 07/19/2010 02:22 PM, Aldy Hernandez wrote:
> + /* If the address escapes the function, it also escapes the thread. */
> + retval = mem_non_local;
> +
> + /* Unlesss... it's one of our special thread private calls. */
> + if (stmt && is_gimple_call (stmt)
> + && (fndecl = gimple_call_fndecl (stmt)))
> + {
> + const char *name = IDENTIFIER_POINTER (DECL_NAME (fndecl));
> + if (!strcmp (name, "_ITM_cxa_allocate_exception")
> + || !strcmp (name, "_ITM_cxa_begin_catch"))
Wouldn't it be better to invent a new attribute that users could put
on their own functions as well? I'm not sure what the best name might
be, but perhaps just "thread_local"?
The commentary would then be
/* If the address has been declared to be thread-local, believe it. */
...
/* Otherwise, we have to assume that any address that escapes the
function also escapes the thread. */
Bonus points if we can figure out a way to apply this idea to
function arguments, as opposed to just function returns as above.
r~