On Tue, May 15, 2012 at 11:23 AM, Torvald Riegel <[email protected]> wrote:
>
> On Tue, 2012-05-08 at 18:02 -0500, Dave Boutcher wrote:
> > Without this patch it is perfectly fine to assign non-transaction_safe
> > functions to function pointers marked as transaction_safe. Unpleasantness
> > happens at run time.
> >
> > e.g.
> >
> > __attribute__((transaction_safe)) long (*compare)(int, int);
> >
> > compare = my_funky_random_function;
> >
> >
> I don't think that assigning a tm_pure function to tm_safe works. There
> will be no instrumented version of it. I don't think we generate an
> alias or sth like that yet.
Torvald, we do create an alias... In trans-mem.c around 4789
/* ... marked tm_pure, record that fact for the runtime by
indicating that the pure function is its own tm_callable.
No need to do this if the function's address can't be taken. */
if (is_tm_pure (node->decl))
{
if (!node->local.local) {
record_tm_clone_pair (node->decl, node->decl);
creates an entry in the clone table that points to itself so its safe
to later call _ITM_getTMCloneSafe()
> When contributing patches, please submit testcases along with it. For
> example, regarding this particular problem, I would believe that there
> are more cases that we don't check properly yet.
Yeah, very likely. This one was biting me so I added the check.
> Also, did you do the FSF copyright assignment paperwork yet?
I sent off the form...
--
Dave B