[LLVMbugs] [Bug 10809] New: volatile read discarded

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 29 18:30:26 PDT 2011


           Summary: volatile read discarded
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu

Clang discards the volatile read in this testcase:

  extern int could_be_volatile;
  void foo() {
    *static_cast<volatile int*>(&could_be_volatile);

C++11 [expr]/5 describes this as a discarded-value-expression and explains that
they are to be evaluated. The volatile operation is whitelisted as undergoing
lvalue-to-rvalue conversion because it is an indirection of a volatile typed

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list