[Bug c++/54893] New: unable to access volatile variable within relaxed transaction

spear at cse dot lehigh.edu gcc-bugzilla@gcc.gnu.org
Wed Oct 10 17:46:00 GMT 2012


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.



More information about the Gcc-bugs mailing list