mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-23 01:30:29 +08:00
re PR middle-end/47530 ([trans-mem] tail call optimization problem with _ITM_commitTransaction)
PR middle-end/47530 * trans-mem.c (expand_block_edges): Do not skip the first statement when resetting the BB. From-SVN: r188190
This commit is contained in:
parent
be6b029b8c
commit
764ce4f20a
@ -1,3 +1,9 @@
|
||||
2012-06-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
PR middle-end/47530
|
||||
* trans-mem.c (expand_block_edges): Do not skip the first
|
||||
statement when resetting the BB.
|
||||
|
||||
2012-06-04 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* tree-data-ref.c (stores_from_loop): Remove.
|
||||
|
35
gcc/testsuite/g++.dg/tm/pr47530-2.C
Normal file
35
gcc/testsuite/g++.dg/tm/pr47530-2.C
Normal file
@ -0,0 +1,35 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fgnu-tm -O2 -fno-inline -fdump-tree-tmedge" }
|
||||
|
||||
class RBTree
|
||||
{
|
||||
struct RBNode
|
||||
{
|
||||
RBNode* next;
|
||||
};
|
||||
|
||||
public:
|
||||
RBNode* sentinel;
|
||||
__attribute__((transaction_safe)) bool lookup();
|
||||
};
|
||||
|
||||
bool RBTree::lookup()
|
||||
{
|
||||
RBNode* x = sentinel;
|
||||
while (x)
|
||||
x = x->next;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
RBTree* SET;
|
||||
|
||||
void bench_test()
|
||||
{
|
||||
__transaction_atomic {
|
||||
SET->lookup();
|
||||
}
|
||||
}
|
||||
|
||||
// { dg-final { scan-tree-dump-times "ITM_commitTransaction.*tail call" 0 "tmedge" } }
|
||||
// { dg-final { cleanup-tree-dump "tmedge" } }
|
@ -2591,6 +2591,7 @@ expand_block_edges (struct tm_region *region, basic_block bb)
|
||||
|
||||
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
|
||||
{
|
||||
bool do_next = true;
|
||||
gimple stmt = gsi_stmt (gsi);
|
||||
|
||||
/* ??? TM_COMMIT (and any other tm builtin function) in a nested
|
||||
@ -2612,6 +2613,7 @@ expand_block_edges (struct tm_region *region, basic_block bb)
|
||||
make_tm_edge (stmt, bb, region);
|
||||
bb = e->dest;
|
||||
gsi = gsi_start_bb (bb);
|
||||
do_next = false;
|
||||
}
|
||||
|
||||
/* Delete any tail-call annotation that may have been added.
|
||||
@ -2620,7 +2622,8 @@ expand_block_edges (struct tm_region *region, basic_block bb)
|
||||
gimple_call_set_tail (stmt, false);
|
||||
}
|
||||
|
||||
gsi_next (&gsi);
|
||||
if (do_next)
|
||||
gsi_next (&gsi);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user