[LLVMbugs] [Bug 17357] New: Miscompilation with __attribute__(( const ))

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 25 05:03:21 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17357

            Bug ID: 17357
           Summary: Miscompilation with __attribute__(( const ))
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dsaritz at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Code that calls a function like:

template <int ID>
__attribute__(( const ))
SomeClass const & someFunction()
{
    static SomeClass const someObject( ID );
    return someObject;
}

miscompiles with all versions of Clang shipped with Xcode after version 4.2.
Removing the const function attribute makes the bug disappear. Is this a Clang
bug or am I misunderstanding the semantics and requirements of the const
function attribute?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130925/4f631ed0/attachment.html>


More information about the llvm-bugs mailing list