This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [trans-mem] optimize exception object memory


On 07/29/2010 10:43 AM, Aldy Hernandez wrote:
> +	  /* If the address has been declared thread-local, believe it.  */
> +	  if (is_thread_local (TREE_TYPE (fn)))
> +	    {
> +	      /* If the thread-local call is inside the transaction,
> +		 the memory is transaction local.  */
> +	      if (dominated_by_p (CDI_DOMINATORS,
> +				  gimple_bb (stmt), entry_block))
> +		retval = mem_transaction_local;
> +	      else
> +		retval = mem_thread_local;

This does not follow in general.  It does if we're also told
that it's new storage (i.e. malloc attribute).

Now, the irritating part here is that we Know that begin_catch
must be returning transaction_local storage, but only because
we know it must be part of a properly nested try-catch block.

Unfortunately, begin_catch can't be marked malloc because the
constructor for the thrown data type can do anything at all,
including storing the value of "this" in some global storage.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]