[LLVMbugs] [Bug 4299] New: clang doesn' t apply __weak consistently to pointer dereferences

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jun 2 13:05:47 PDT 2009


           Summary: clang doesn't apply __weak consistently to pointer
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu

Testcase (compile with "clang-cc -triple i686-apple-darwin -x objective-c
-fobjc-gc -emit-llvm"):
__weak id* g1;
id* __weak g2;
id f1() { return *g1; }
id f2() { return *g2; }

Per the documentation, the compiled versions of both functions should contain
two calls to objc_read_weak, but that isn't true in clang: f2 only contains one
call to objc_read_weak.  (I haven't checked against a Darwin gcc myself, but
Fariborz says that gcc generates the right thing here.)

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