<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 --- - crash due to -value-tracking-dom-conditions: &quot;Bits known to be one AND zero?&quot;" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24241&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=bV5FsBk62wntajFHwnvY9Y1VZSAsShFwU48OK2GNHAU&s=1q4nbDB2BdI1SfZYCkn9aERSEij5U05YsBJB8wbz1Uk&e=">24241</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash due to -value-tracking-dom-conditions: "Bits known to be one AND zero?"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>regehr@cs.utah.edu
          </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>regehr@higgs:~/test/reduce_crash_83860$ clang -c -O3 small.c -w

regehr@higgs:~/test/reduce_crash_83860$ clang -c -O3 -mllvm
-value-tracking-dom-conditions=true small.c -w
clang-3.8: ../lib/Analysis/ValueTracking.cpp:1541: void
computeKnownBits(llvm::Value *, llvm::APInt &, llvm::APInt &, const
llvm::DataLayout &, unsigned int, const (anonymous namespace)::Query &):
Assertion `(KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"'
failed.
#0 0x15de86a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/regehr/llvm/build/../lib/Support/Unix/Signals.inc:404:15
#1 0x15ddd86 llvm::sys::RunSignalHandlers()
/home/regehr/llvm/build/../lib/Support/Signals.cpp:35:5
#2 0x15dffb3 SignalHandler(int)
/home/regehr/llvm/build/../lib/Support/Unix/Signals.inc:201:3
#3 0x7f546acf7340 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x7f5469eaacc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7f5469eae0d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#6 0x7f5469ea3b86 __assert_fail_base
/build/buildd/eglibc-2.19/assert/assert.c:92:0
#7 0x7f5469ea3c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0xfe7b06 llvm::cast_retty<llvm::Constant, llvm::Value*>::ret_type
llvm::cast_or_null<llvm::Constant, llvm::Value>(llvm::Value*)
/home/regehr/llvm/build/../include/llvm/Support/Casting.h:269:3
#9 0xfe7b06 llvm::GlobalAlias::getOperand(unsigned int) const
/home/regehr/llvm/build/../include/llvm/IR/GlobalAlias.h:119:0
#10 0xfe7b06 llvm::GlobalAlias::getAliasee()
/home/regehr/llvm/build/../include/llvm/IR/GlobalAlias.h:85:0
#11 0xfe7b06 computeKnownBits(llvm::Value*, llvm::APInt&, llvm::APInt&,
llvm::DataLayout const&, unsigned int, (anonymous namespace)::Query const&)
/home/regehr/llvm/build/../lib/Analysis/ValueTracking.cpp:1522:0
#12 0xfe701d (anonymous namespace)::Query::~Query()
/home/regehr/llvm/build/../lib/Analysis/ValueTracking.cpp:96:8
#13 0xfe701d llvm::computeKnownBits(llvm::Value*, llvm::APInt&, llvm::APInt&,
llvm::DataLayout const&, unsigned int, llvm::AssumptionCache*,
llvm::Instruction const*, llvm::DominatorTree const*)
/home/regehr/llvm/build/../lib/Analysis/ValueTracking.cpp:137:0
#14 0x13dfb0f llvm::InstCombiner::computeKnownBits(llvm::Value*, llvm::APInt&,
llvm::APInt&, unsigned int, llvm::Instruction*) const
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstCombineInternal.h:466:12
#15 0x13dfb0f llvm::InstCombiner::SimplifyDemandedUseBits(llvm::Value*,
llvm::APInt, llvm::APInt&, llvm::APInt&, unsigned int, llvm::Instruction*)
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:226:0
#16 0x13e8ab8 llvm::InstCombiner::SimplifyDemandedBits(llvm::Use&, llvm::APInt,
llvm::APInt&, llvm::APInt&, unsigned int)
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:75:19
#17 0x13e2415 llvm::InstCombiner::SimplifyDemandedUseBits(llvm::Value*,
llvm::APInt, llvm::APInt&, llvm::APInt&, unsigned int, llvm::Instruction*)
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:503:9
#18 0x13df6b5
llvm::InstCombiner::SimplifyDemandedInstructionBits(llvm::Instruction&)
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:60:14
#19 0x13ab4bf llvm::InstCombiner::visitSExt(llvm::SExtInst&)
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstCombineCasts.cpp:1064:7
#20 0x137ec5b llvm::InstCombiner::run()
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstructionCombining.cpp:2777:31
#21 0x13806d6 combineInstructionsOverFunction(llvm::Function&,
llvm::InstCombineWorklist&, llvm::AliasAnalysis*, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::DominatorTree&, llvm::LoopInfo*)
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstructionCombining.cpp:3024:9
#22 0x1383029 (anonymous
namespace)::InstructionCombiningPass::runOnFunction(llvm::Function&)
/home/regehr/llvm/build/../lib/Transforms/InstCombine/InstructionCombining.cpp:3098:1
#23 0x12db862 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/regehr/llvm/build/../lib/IR/LegacyPassManager.cpp:1520:23
#24 0x1cc5768 (anonymous namespace)::CGPassManager::RunPassOnSCC(llvm::Pass*,
llvm::CallGraphSCC&, llvm::CallGraph&, bool&, bool&)
/home/regehr/llvm/build/../lib/Analysis/IPA/CallGraphSCCPass.cpp:150:20
#25 0x1cc5768 (anonymous
namespace)::CGPassManager::RunAllPassesOnSCC(llvm::CallGraphSCC&,
llvm::CallGraph&, bool&)
/home/regehr/llvm/build/../lib/Analysis/IPA/CallGraphSCCPass.cpp:418:0
#26 0x1cc5768 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&)
/home/regehr/llvm/build/../lib/Analysis/IPA/CallGraphSCCPass.cpp:474:0
#27 0x12dbea5 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/regehr/llvm/build/../lib/IR/LegacyPassManager.cpp:1596:23
#28 0x12dbea5 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/regehr/llvm/build/../lib/IR/LegacyPassManager.cpp:1698:0
#29 0x16cc0c3 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
llvm::raw_pwrite_stream*)
/home/regehr/llvm/build/../tools/clang/lib/CodeGen/BackendUtil.cpp:652:3
#30 0x16cc0c3 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::StringRef, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*)
/home/regehr/llvm/build/../tools/clang/lib/CodeGen/BackendUtil.cpp:668:0
#31 0x1bf1785 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/regehr/llvm/build/../tools/clang/lib/CodeGen/CodeGenAction.cpp:186:7
#32 0x1ee95c3 void std::swap<bool>(bool&, bool&)
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/move.h:177:7
#33 0x1ee95c3 clang::ParseAST(clang::Sema&, bool, bool)
/home/regehr/llvm/build/../tools/clang/lib/Parse/ParseAST.cpp:153:0
#34 0x197a94e clang::FrontendAction::Execute()
/home/regehr/llvm/build/../tools/clang/lib/Frontend/FrontendAction.cpp:443:7
#35 0x194b02c clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/regehr/llvm/build/../tools/clang/lib/Frontend/CompilerInstance.cpp:820:7
#36 0x19ee5dd clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/regehr/llvm/build/../tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:222:18
#37 0x715b44 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
/home/regehr/llvm/build/../tools/clang/tools/driver/cc1_main.cpp:116:13
#38 0x7146f7 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef)
/home/regehr/llvm/build/../tools/clang/tools/driver/driver.cpp:367:12
#39 0x7146f7 main
/home/regehr/llvm/build/../tools/clang/tools/driver/driver.cpp:430:0
#40 0x7f5469e95ec5 __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:321:0
#41 0x711836 _start (/home/regehr/llvm-install/bin/clang-3.8+0x711836)
Stack dump:
0.    Program arguments: /home/regehr/llvm-install/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -coverage-file
/home/regehr/test/reduce_crash_83860/small.c -resource-dir
/home/regehr/llvm-install/bin/../lib/clang/3.8.0 -internal-isystem
/usr/local/include -internal-isystem
/home/regehr/llvm-install/bin/../lib/clang/3.8.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-w -fdebug-compilation-dir /home/regehr/test/reduce_crash_83860 -ferror-limit
19 -fmessage-length 109 -mstackrealign -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-mllvm -value-tracking-dom-conditions=true -o small.o -x c small.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.    Running pass 'Combine redundant instructions' on function '@fn3'
clang-3.8: error: unable to execute command: Aborted (core dumped)
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (trunk 243039)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.8: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_bugs_&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=bV5FsBk62wntajFHwnvY9Y1VZSAsShFwU48OK2GNHAU&s=ud895Nr2qBKcXdEdIe7R-3bxmYzDTfp5KGWLSe4twEU&e=">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.8: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.8: note: diagnostic msg: /tmp/small-debc8a.c
clang-3.8: note: diagnostic msg: /tmp/small-debc8a.sh
clang-3.8: note: diagnostic msg: 

********************

regehr@higgs:~/test/reduce_crash_83860$ cat small.c
long a;
char fn1();
short fn2();
void fn3() {
  short b = 0;
  for (; b == -1; b--)
    if (a)
      ;
    else
      fn2(&b == 0) != fn1(b);
}

regehr@higgs:~/test/reduce_crash_83860$ clang -v
clang version 3.8.0 (trunk 243039)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64</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>