This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] instrument clones
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Nov 2012 15:28:01 -0600
- Subject: [patch] instrument clones
The included small change to g++.dg/tm/pr51516.C fixes the remaining TM
regression. With two code paths, there are two instances of the
constructor (a clone and an uninstrumented version), so that part of the
test is no longer relevant.
However... in fixing this, I noticed that for some odd reason we are not
instrumenting clones at all. I have no idea, how we missed this, but if
you look at the (currently) generated code for:
__attribute__((transaction_callable))
void cloneme()
{
foo = 666;
}
...you will notice that the clone version has no instrumentation.
This is because the iteration with get_bb_regions_uninstrumented() exits
if there are no exit_blocks, which is always the case for TM clones. I
added a new parameter so we can force traversal of the clone if we are
looking at a clone.
But then this is problematic if the clone has inline assembly because
collect_bb2reg() does not stop at irrevocable blocks. So if we
indiscriminately scan clones, we plow right through irrevocable blocks
and try to incorrectly instrument them. Fixed with yet another parameter.
With this patch we have no TM regressions whatsoever, and as a bonus we
are instrumenting clones :-).
OK?
Attachment:
curr
Description: Text document