[PATCH] D71938: [SCCP] Use constant ranges for casts.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 08:54:03 PDT 2020


fhahn added a comment.

In D71938#1952589 <https://reviews.llvm.org/D71938#1952589>, @uweigand wrote:

> I'm now getting an assertion failure in the LNT test suite:
>  http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/17826/steps/test-suite/logs/stdio
>
> clang: /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/llvm/lib/IR/Constants.cpp:1661: static llvm::Constant* llvm::ConstantExpr::getCast(unsigned int, llvm::Constant*, llvm::Type*, bool): Assertion `CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"' failed.
>  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
>  Stack dump:
>  0.	Program arguments: /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1.install/bin/clang -DNDEBUG -O3 -DNDEBUG -w -Werror=date-time -w -o CMakeFiles/GCC-C-execute-scal-to-vec1.dir/scal-to-vec1.c.o -c /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/test/test-suite/SingleSource/Regression/C/gcc-c-torture/execute/scal-to-vec1.c
>
> 1. <eof> parser at end of file
> 2. Per-module optimization passes
> 3. Running pass 'CallGraph Pass Manager' on module '/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/test/test-suite/SingleSource/Regression/C/gcc-c-torture/execute/scal-to-vec1.c'.
> 4. Running pass 'Sparse Conditional Constant Propagation' on function '@main' [...] #9 0x000002aa1a5b6b70 llvm::ConstantExpr::getCast(unsigned int, llvm::Constant*, llvm::Type*, bool) (/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1.install/bin/clang+0x2ab6b70) #10 0x000002aa19ec233c llvm::ConstantFoldCastOperand(unsigned int, llvm::Constant*, llvm::Type*, llvm::DataLayout const&) (/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1.install/bin/clang+0x23c233c) #11 0x000002aa1ac69ab0 (anonymous namespace)::SCCPSolver::visitCastInst(llvm::CastInst&) (/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1.install/bin/clang+0x3169ab0) #12 0x000002aa1ac6ce72 llvm::InstVisitor<(anonymous namespace)::SCCPSolver, void>::visit(llvm::Instruction&) (/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1.install/bin/clang+0x316ce72) [...]
>
>   that appears to be directly related to this visitCastInst change.


Thanks for letting me know! I'll push a fix shortly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71938/new/

https://reviews.llvm.org/D71938





More information about the llvm-commits mailing list