This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]