<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 crashes when comparing an atomic_uint" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23687&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=QHhGOEm0Xj_O74GoxHDZjMAkiT98QpPva9Zft9r1UE0&s=D3VZ3foPAe4dngQAZ1QyVhHKSgEaALk96Wse5Mbq_Us&e=">23687</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes when comparing an atomic_uint
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>anthonin.bonnefoy@securactive.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code make clang crash:

#include <stdatomic.h>

atomic_uint count;

int main(int argc, char *argv[])
{
    return count > 1;
}


clang version 3.6.1 (<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_git_clang.git&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=QHhGOEm0Xj_O74GoxHDZjMAkiT98QpPva9Zft9r1UE0&s=FDzXkDRb8KOEKQ3WAxjFwlB-MMwqSuElnOPjN-sSEtw&e=">http://llvm.org/git/clang.git</a>
9fd69610a42900694945c75448efd04373359dff) (<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_git_llvm.git&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=QHhGOEm0Xj_O74GoxHDZjMAkiT98QpPva9Zft9r1UE0&s=aPWPmbWBlBEMrSOCsw4ccFtCr6DidbBTxjwzcBZPWbA&e=">http://llvm.org/git/llvm.git</a>
66ad281fb93b92858f443915f7811b16c131d3eb)

The backtrace:

/home/sora/git-repos/llvm/tools/clang/lib/Sema/SemaChecking.cpp:5852: void
{anonymous}::DiagnoseOutOfRangeComparison(clang::Sema&, clang::BinaryOperator*,
clang::Expr*, clang::Expr*, llvm::APSInt, bool): Assertion
`(OtherT->isIntegerType() && ConstantT->isIntegerType()) && "comparison with
non-integer type"' failed.
#0 0x23c9ed1 llvm::sys::PrintStackTrace(_IO_FILE*)
(/home/sora/local/bin/clang-3.6+0x23c9ed1)
#1 0x23ca167 PrintStackTraceSignalHandler(void*)
(/home/sora/local/bin/clang-3.6+0x23ca167)
#2 0x23c8e17 SignalHandler(int) (/home/sora/local/bin/clang-3.6+0x23c8e17)
#3 0x7f6e5fbdc8d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x7f6e5ee1c107 gsignal
/build/glibc-Ir_s5K/glibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7f6e5ee1d4e8 abort /build/glibc-Ir_s5K/glibc-2.19/stdlib/abort.c:91:0
#6 0x7f6e5ee15226 __assert_fail_base
/build/glibc-Ir_s5K/glibc-2.19/assert/assert.c:92:0
#7 0x7f6e5ee152d2 (/lib/x86_64-linux-gnu/libc.so.6+0x2e2d2)
#8 0x35c4b3c (anonymous namespace)::DiagnoseOutOfRangeComparison(clang::Sema&,
clang::BinaryOperator*, clang::Expr*, clang::Expr*, llvm::APSInt, bool)
(bin/clang-3.6+0x35c4b3c)
#9 0x35c550a (anonymous namespace)::AnalyzeComparison(clang::Sema&,
clang::BinaryOperator*) (/home/sora/local/bin/clang-3.6+0x35c550a)
#10 0x35c7f96 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&,
clang::Expr*, clang::SourceLocation) (/home/sora/local/bin/clang-3.6+0x35c7f96)
#11 0x35c92d4 clang::Sema::CheckImplicitConversions(clang::Expr*,
clang::SourceLocation) (/home/sora/local/bin/clang-3.6+0x35c92d4)
#12 0x35cae38 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool) (/home/sora/local/bin/clang-3.6+0x35cae38)
#13 0x38232c3 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool, bool)
(/home/sora/local/bin/clang-3.6+0x38232c3)
#14 0x397411b clang::Sema::BuildReturnStmt(clang::SourceLocation, clang::Expr*)
(/home/sora/local/bin/clang-3.6+0x397411b)
#15 0x3973248 clang::Sema::ActOnReturnStmt(clang::SourceLocation, clang::Expr*,
clang::Scope*) (/home/sora/local/bin/clang-3.6+0x3973248)
#16 0x33e9322 clang::Parser::ParseReturnStatement()
(/home/sora/local/bin/clang-3.6+0x33e9322)
#17 0x33e3ed1
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
(/home/sora/local/bin/clang-3.6+0x33e3ed1)
#18 0x33e35ee
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) (/home/sora/local/bin/clang-3.6+0x33e35ee)
#19 0x33e63e0 clang::Parser::ParseCompoundStatementBody(bool)
(/home/sora/local/bin/clang-3.6+0x33e63e0)
#20 0x33e962c clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) (/home/sora/local/bin/clang-3.6+0x33e962c)
#21 0x3377c1b clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/home/sora/local/bin/clang-3.6+0x3377c1b)
#22 0x33885f6 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned
int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/home/sora/local/bin/clang-3.6+0x33885f6)
#23 0x3376e66
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/home/sora/local/bin/clang-3.6+0x3376e66)
#24 0x3376f4a
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/home/sora/local/bin/clang-3.6+0x3376f4a)
#25 0x3376684
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/home/sora/local/bin/clang-3.6+0x3376684)
#26 0x3375c0c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/home/sora/local/bin/clang-3.6+0x3375c0c)
#27 0x336eda5 clang::ParseAST(clang::Sema&, bool, bool)
(/home/sora/local/bin/clang-3.6+0x336eda5)
#28 0x25ca3d6 clang::ASTFrontendAction::ExecuteAction()
(/home/sora/local/bin/clang-3.6+0x25ca3d6)
#29 0x29190e1 clang::CodeGenAction::ExecuteAction()
(/home/sora/local/bin/clang-3.6+0x29190e1)
#30 0x25c9e8d clang::FrontendAction::Execute()
(/home/sora/local/bin/clang-3.6+0x25c9e8d)
#31 0x2591b99 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/sora/local/bin/clang-3.6+0x2591b99)
#32 0x26e3d59 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/sora/local/bin/clang-3.6+0x26e3d59)
#33 0x12019e5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/home/sora/local/bin/clang-3.6+0x12019e5)
#34 0x11f9f8f ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef)
(/home/sora/local/bin/clang-3.6+0x11f9f8f)
#35 0x11fa54d main (/home/sora/local/bin/clang-3.6+0x11fa54d)
#36 0x7f6e5ee08b45 __libc_start_main
/build/glibc-Ir_s5K/glibc-2.19/csu/libc-start.c:321:0
#37 0x11f6ec9 _start (/home/sora/local/bin/clang-3.6+0x11f6ec9)</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>