<html>
    <head>
      <base href="http://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang CodeGen fails on struct with atomic members"
   href="http://bugs.llvm.org/show_bug.cgi?id=31954">31954</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang CodeGen fails on struct with atomic members
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cnweaver@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17976" name="attach_17976" title="Reduced testcase created with CReduce and some manual reduction">attachment 17976</a> <a href="attachment.cgi?id=17976&action=edit" title="Reduced testcase created with CReduce and some manual reduction">[details]</a></span>
Reduced testcase created with CReduce and some manual reduction

Trunk clang hits the following assertion failure when compiling the attached,
reduced testcase:

Assertion failed: (Result.isUninit() && "temporary created multiple times"),
function createTemporary, file
/Users/c/ConstructionZone/llvm/tools/clang/lib/AST/ExprConstant.cpp, line 1094.
0  clang                    0x0000000101af5738
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang                    0x0000000101af5e06 SignalHandler(int) + 454
2  libsystem_platform.dylib 0x00000001054705aa _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 4206426736
4  libsystem_c.dylib        0x00000001052acb1a abort + 125
5  libsystem_c.dylib        0x00000001052769bf basename + 0
6  clang                    0x0000000103580ac0 (anonymous
namespace)::CallStackFrame::createTemporary(void const*, bool) + 352
7  clang                    0x000000010356bc20 Evaluate(clang::APValue&,
(anonymous namespace)::EvalInfo&, clang::Expr const*) + 2608
8  clang                    0x0000000103586592
clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::AtomicExprEvaluator, bool>::Visit(clang::Stmt const*) + 1234
9  clang                    0x000000010356c10f Evaluate(clang::APValue&,
(anonymous namespace)::EvalInfo&, clang::Expr const*) + 3871
10 clang                    0x00000001035682c0 EvaluateInPlace(clang::APValue&,
(anonymous namespace)::EvalInfo&, (anonymous namespace)::LValue const&,
clang::Expr const*, bool) + 208
11 clang                    0x00000001035b585d
HandleClassZeroInitialization((anonymous namespace)::EvalInfo&, clang::Expr
const*, clang::RecordDecl const*, (anonymous namespace)::LValue const&,
clang::APValue&) + 1693
12 clang                    0x00000001035b27bd (anonymous
namespace)::RecordExprEvaluator::ZeroInitialization(clang::Expr const*,
clang::QualType) + 589
13 clang                    0x00000001035b2cda
clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::RecordExprEvaluator, bool>::Visit(clang::Stmt const*) + 506
14 clang                    0x00000001035682b0 EvaluateInPlace(clang::APValue&,
(anonymous namespace)::EvalInfo&, (anonymous namespace)::LValue const&,
clang::Expr const*, bool) + 192
15 clang                    0x0000000103567de6
clang::Expr::EvaluateAsInitializer(clang::APValue&, clang::ASTContext const&,
clang::VarDecl const*,
llvm::SmallVectorImpl<std::__1::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 934
16 clang                    0x00000001035075aa
clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::__1::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 154
17 clang                    0x000000010350742e clang::VarDecl::evaluateValue()
const + 78
18 clang                    0x0000000101e4ab04
clang::CodeGen::CodeGenModule::EmitConstantInit(clang::VarDecl const&,
clang::CodeGen::CodeGenFunction*) + 260
19 clang                    0x0000000101f653dc
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool) + 428
20 clang                    0x0000000101f6061f
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 239
21 clang                    0x0000000101f67391
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 337
22 clang                    0x0000000101fee3df (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 143
23 clang                    0x0000000101f48faa
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 186
24 clang                    0x00000001028eb712 clang::ParseAST(clang::Sema&,
bool, bool) + 370
25 clang                    0x00000001021ba2fc clang::FrontendAction::Execute()
+ 76
26 clang                    0x00000001021765c1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1217
27 clang                    0x000000010221b252
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4898
28 clang                    0x00000001004828fc cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1388
29 clang                    0x00000001004810a3 main + 11891
30 libdyld.dylib            0x00000001051d45fd start + 1
Stack dump:
0.      Program arguments: /Users/c/ConstructionZone/llvm_build/bin/clang -cc1
-triple x86_64-apple-macosx10.9.0 -emit-obj -disable-free -mrelocation-model
pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose
-munwind-tables -target-linker-version 224.1 -dwarf-column-info
-debugger-tuning=lldb -stdlib=libc++ -O3 -std=c++11 -stack-protector 1
-fcxx-exceptions -fexceptions -fmax-type-align=16 -x c++ atomic_ICE.cpp 
1.      <eof> parser at end of file
2.      atomic_ICE.cpp:10:3: LLVM IR generation of declaration 'g'
3.      atomic_ICE.cpp:10:3: Generating code for declaration 'g'

This seems to stem from the change made in r291480, and so affects the 4.0
release branch as well. It is a regression from earlier versions, which
successfully compiled this testcase and the code from which it was derived.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>