http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56419
Bug #: 56419
Summary: [4.8 regression] transactions in for-loops disappear
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Transaction statements in for-loops don't show up in Gimple. For example:
int x = 0;
int inc_func(int i) {
for (int j = 0; j < i; ++j)
{
__transaction_atomic { x+=1; }
}
return 0;
}
g++ -v -O0 test.cc -c -fgnu-tm -fdump-tree-all -Wall
leads to the following test.cc.004t.gimple:
int inc_func(int) (int i)
{
int D.2360;
{
int j;
j = 0;
goto <D.2358>;
<D.2357>:
j = j + 1;
<D.2358>:
if (j < i) goto <D.2357>; else goto <D.2355>;
<D.2355>:
}
D.2360 = 0;
return D.2360;
}
This does work when using the C frontend. Seems to also work when the
transaction is in while loops or on an if-branch. Doesn't seem to be sensitive
to which C++ standard is requested.
Originally reported by Mike Spear. Mike says this works with 4.7.2, but
doesn't with g++ (GCC) 4.8.0 20130221 (experimental) (revision
196192). I've confirmed with an early-December build.