http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54893
Bug #: 54893
Summary: unable to access volatile variable within relaxed
transaction
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
Attempts to access a volatile variable in gcc or g++ fails.
Sample code:
#include <stdio.h>
volatile int test_var = 0;
int main()
{
__transaction_relaxed {
test_var++;
}
printf("Changed variable value to %d\n", test_var);
}
Compilation:
g++ test.c -o test -fgnu-tm
Error:
test.c:6:15: error: invalid volatile use of 'test_var' inside transaction
gcc version info:
g++ (GCC) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.