This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54893] New: unable to access volatile variable within relaxed transaction
- From: "spear at cse dot lehigh.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Oct 2012 17:45:56 +0000
- Subject: [Bug c++/54893] New: unable to access volatile variable within relaxed transaction
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: spear@cse.lehigh.edu
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.