<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63715>63715</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `clang-17`: Assertion `false && "Unexpected unary operator!"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          wierton
      </td>
    </tr>
</table>

<pre>
    When attempting to compile below program using option `clang-17 -O0 small.c`, clang triggers an assertion failure:
```
void f(int a) {
  __real__ 0 != 1.0 <= a;
 (0);
}
```

This behavior can be verified at https://gcc.godbolt.org/z/fexTn4rEn

`clang`'s output is pasted below:
```
<source>:2:14: warning: inequality comparison result unused [-Wunused-comparison]
    2 |   __real__ 0 != 1.0 <= a;
      | ~~~~~~~~~~~^~~~~~~~~~~
clang: /root/llvm-project/clang/lib/Analysis/CFG.cpp:1047: std::optional<llvm::APInt> {anonymous}::CFGBuilder::getIntegerLiteralSubexpressionValue(const clang::Expr*): Assertion `false && "Unexpected unary operator!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics -O0 <source>
1.      <eof> parser at end of file
2.      <source>:1:15: parsing function body 'f'
 #0 0x0000561ceac7a81f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c3381f)
 #1 0x0000561ceac7858c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c3158c)
 #2 0x0000561ceabc2b98 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f28df508420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f28defd500b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #5 0x00007f28defb4859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #6 0x00007f28defb4729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #7 0x00007f28defc5fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #8 0x0000561cee19f8d0 (anonymous namespace)::CFGBuilder::getIntegerLiteralSubexpressionValue(clang::Expr const*) (.isra.0) CFG.cpp:0:0
 #9 0x0000561cee1a12bb (anonymous namespace)::CFGBuilder::evaluateAsBooleanConditionNoCache(clang::Expr*) CFG.cpp:0:0
#10 0x0000561cee1a0c45 (anonymous namespace)::CFGBuilder::tryEvaluateBool(clang::Expr*) CFG.cpp:0:0
#11 0x0000561cee1b7034 (anonymous namespace)::CFGBuilder::VisitBinaryOperator(clang::BinaryOperator*, (anonymous namespace)::AddStmtChoice) CFG.cpp:0:0
#12 0x0000561cee1b739d (anonymous namespace)::CFGBuilder::VisitCompoundStmt(clang::CompoundStmt*, bool) CFG.cpp:0:0
#13 0x0000561cee1b92bc (anonymous namespace)::CFGBuilder::buildCFG(clang::Decl const*, clang::Stmt*) CFG.cpp:0:0
#14 0x0000561cee1baa05 clang::CFG::buildCFG(clang::Decl const*, clang::Stmt*, clang::ASTContext*, clang::CFG::BuildOptions const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x7173a05)
#15 0x0000561cee15ebb0 clang::AnalysisDeclContext::getCFG() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x7117bb0)
#16 0x0000561cee0ba2a9 clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy, clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x70732a9)
#17 0x0000561ced598526 clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy const*, clang::Decl const*, clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6551526)
#18 0x0000561ced79dfcc clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6756fcc)
#19 0x0000561ced511c1d clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x64cac1d)
#20 0x0000561ced43c871 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63f5871)
#21 0x0000561ced463750 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x641c750)
#22 0x0000561ced430111 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63e9111)
#23 0x0000561ced4309cf clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#24 0x0000561ced437371 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63f0371)
#25 0x0000561ced437ce6 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63f0ce6)
#26 0x0000561ced438184 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63f1184)
#27 0x0000561ced42ba5a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63e4a5a)
#28 0x0000561cebf00a68 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4eb9a68)
#29 0x0000561ceb743a69 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x46fca69)
#30 0x0000561ceb6c89f6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x46819f6)
#31 0x0000561ceb828b16 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x47e1b16)
#32 0x0000561ce8157d94 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1110d94)
#33 0x0000561ce8153aba ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#34 0x0000561ceb52289d void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#35 0x0000561ceabc30a0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b7c0a0)
#36 0x0000561ceb522ebf clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#37 0x0000561ceb4e9a9c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44a2a9c)
#38 0x0000561ceb4ea52d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44a352d)
#39 0x0000561ceb4f260d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x44ab60d)
#40 0x0000561ce815600a clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x110f00a)
#41 0x0000561ce805b5f5 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10145f5)
#42 0x00007f28defb6083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#43 0x0000561ce814e89e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x110789e)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
```

The version of testing compiler is (associated with commit 7cd9084c694caa9a0d7694a11bcb54d101d0abc7)
```
clang version 17.0.0 (https://github.com/llvm/llvm-project.git 7cd9084c694caa9a0d7694a11bcb54d101d0abc7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-assertions-trunk/bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWl9z46iy_zTKC2UXQv8f8uA48dxszb3JneTuPrpaCNnckUELKH_Ow_nsp0CyIxzbk8x4t-rUmdpsyQKaX_-66W4EoDVfCcYug-QqSK4voDNrqS6fOVNGiotSVq-Xf6yZQGAM27SGixUyElG5aXnDUMka-YxaJVcKNqjTtlm2hkuBghTTBsRqEmZocoeR3kDTTGmQ4oDMkWtCRvHViimNQCDQmik3sgbedIoF0SzA1wGe2SH9f-7nk-QVqgOS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