[llvm-bugs] [Bug 46211] New: Assertion `isSCEVable(Ty) && "Type is not SCEVable!"' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jun 4 15:30:25 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=46211
Bug ID: 46211
Summary: Assertion `isSCEVable(Ty) && "Type is not SCEVable!"'
failed.
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: release blocker
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: changochen1 at gmail.com
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
Assertion fail on the following program. Tested on trunk.
CMD:
---
clang -O3 -o poc poc.c
---
POC:
---
int a, c;
int main() {
short *e, b[0];
a = 0;
for (; a < 39; a++)
e = b;
switch (c)
do
do
case 7:
e--;
while (*e);
while (--a);
return 0;
}
---
Stack dump:
---
clang-11: /home/rxz226/llvm-project/llvm/lib/Analysis/ScalarEvolution.cpp:3821:
uint64_t llvm::ScalarEvolution::getTypeSizeInBits(llvm::Type*) const: Assertion
`isSCEVable(Ty) && "Type is not SCEVable!"' 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/rxz226/llvm-project/build/bin/clang-11 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name 2.c
-mrelocation-model static -mthread-model posix -mframe-pointer=none
-fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining
-debugger-tuning=gdb -resource-dir
/home/rxz226/llvm-project/build/lib/clang/11.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/rxz226/llvm-project/build/lib/clang/11.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdebug-compilation-dir /home/rxz226 -ferror-limit 19 -fgnuc-version=4.2.1
-fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o
/tmp/2-11281a.o -x c 2.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '2.c'.
4. Running pass 'Loop Pass Manager' on function '@main'
5. Running pass 'Loop Strength Reduction' on basic block '%sw.bb.31'
#0 0x00005625d8d7ff29 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:0
#1 0x00005625d8d7ffbc PrintStackTraceSignalHandler(void*)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:0
#2 0x00005625d8d7dd57 llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:68:0
#3 0x00005625d8d7f8a6 SignalHandler(int)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:406:0
#4 0x00007fc4bf1c1890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#5 0x00007fc4be09ce97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#6 0x00007fc4be09e801 abort
/build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
#7 0x00007fc4be08e39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
#8 0x00007fc4be08e412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#9 0x00005625d7b2bb7d llvm::ScalarEvolution::getTypeSizeInBits(llvm::Type*)
const /home/rxz226/llvm-project/llvm/lib/Analysis/ScalarEvolution.cpp:3821:0
#10 0x00005625d8ea2a50 llvm::SCEVExpander::expand(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1896:0
#11 0x00005625d8ea215e llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1780:0
#12 0x00005625d8ea2132 llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*, llvm::Instruction*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1776:0
#13 0x00005625d8e9f822
llvm::SCEVExpander::getAddRecExprPHILiterally(llvm::SCEVAddRecExpr const*,
llvm::Loop const*, llvm::Type*, llvm::Type*, llvm::Type*&, bool&)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1277:0
#14 0x00005625d8ea01fa
llvm::SCEVExpander::expandAddRecExprLiterally(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1406:0
#15 0x00005625d8ea0970
llvm::SCEVExpander::visitAddRecExpr(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1508:0
#16 0x00005625d8eaa5fd llvm::SCEVVisitor<llvm::SCEVExpander,
llvm::Value*>::visit(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:530:0
#17 0x00005625d8ea29c0 llvm::SCEVExpander::expand(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1891:0
#18 0x00005625d8ea215e llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1780:0
#19 0x00005625d8ea2132 llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*, llvm::Instruction*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1776:0
#20 0x00005625d8e9f822
llvm::SCEVExpander::getAddRecExprPHILiterally(llvm::SCEVAddRecExpr const*,
llvm::Loop const*, llvm::Type*, llvm::Type*, llvm::Type*&, bool&)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1277:0
#21 0x00005625d8ea01fa
llvm::SCEVExpander::expandAddRecExprLiterally(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1406:0
#22 0x00005625d8ea0970
llvm::SCEVExpander::visitAddRecExpr(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1508:0
#23 0x00005625d8eaa5fd llvm::SCEVVisitor<llvm::SCEVExpander,
llvm::Value*>::visit(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:530:0
#24 0x00005625d8ea29c0 llvm::SCEVExpander::expand(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1891:0
#25 0x00005625d8ea215e llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1780:0
#26 0x00005625d8ea2132 llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*, llvm::Instruction*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1776:0
#27 0x00005625d8e9f822
llvm::SCEVExpander::getAddRecExprPHILiterally(llvm::SCEVAddRecExpr const*,
llvm::Loop const*, llvm::Type*, llvm::Type*, llvm::Type*&, bool&)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1277:0
#28 0x00005625d8ea01fa
llvm::SCEVExpander::expandAddRecExprLiterally(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1406:0
#29 0x00005625d8ea0970
llvm::SCEVExpander::visitAddRecExpr(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1508:0
#30 0x00005625d8eaa5fd llvm::SCEVVisitor<llvm::SCEVExpander,
llvm::Value*>::visit(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:530:0
#31 0x00005625d8ea29c0 llvm::SCEVExpander::expand(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1891:0
#32 0x00005625d8ea215e llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1780:0
#33 0x00005625d8ea2132 llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*, llvm::Instruction*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1776:0
#34 0x00005625d8e9f822
llvm::SCEVExpander::getAddRecExprPHILiterally(llvm::SCEVAddRecExpr const*,
llvm::Loop const*, llvm::Type*, llvm::Type*, llvm::Type*&, bool&)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1277:0
#35 0x00005625d8ea01fa
llvm::SCEVExpander::expandAddRecExprLiterally(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1406:0
#36 0x00005625d8ea0970
llvm::SCEVExpander::visitAddRecExpr(llvm::SCEVAddRecExpr const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1508:0
#37 0x00005625d8eaa5fd llvm::SCEVVisitor<llvm::SCEVExpander,
llvm::Value*>::visit(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:530:0
#38 0x00005625d8ea29c0 llvm::SCEVExpander::expand(llvm::SCEV const*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1891:0
#39 0x00005625d8ea215e llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1780:0
#40 0x00005625d8ea2132 llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*, llvm::Instruction*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1776:0
#41 0x00005625d8e9f822
llvm::SCEVExpander::getAddRecExprPHILiterally(llvm::SCEVAddRecExpr const*,
llvm::Loop const*, llvm::Type*, llvm::Type*, llvm::Type*&, bool&)
/home/rxz226/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:1277:0
...
#240 0x00005625d8ab077a (anonymous
namespace)::LSRInstance::LSRInstance(llvm::Loop*, llvm::IVUsers&,
llvm::ScalarEvolution&, llvm::DominatorTree&, llvm::LoopInfo&,
llvm::TargetTransformInfo const&, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::MemorySSAUpdater*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5611:0
#241 0x00005625d8ab0ee2 ReduceLoopStrength(llvm::Loop*, llvm::IVUsers&,
llvm::ScalarEvolution&, llvm::DominatorTree&, llvm::LoopInfo&,
llvm::TargetTransformInfo const&, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::MemorySSA*)
/home/rxz226/llvm-project/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5725:0
#242 0x00005625d8ab1276 (anonymous
namespace)::LoopStrengthReduce::runOnLoop(llvm::Loop*, llvm::LPPassManager&)
/home/rxz226/llvm-project/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5765:0
#243 0x00005625d7a6db1a llvm::LPPassManager::runOnFunction(llvm::Function&)
/home/rxz226/llvm-project/llvm/lib/Analysis/LoopPass.cpp:194:0
#244 0x00005625d8354d46 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1482:0
#245 0x00005625d8354fe7 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1518:0
#246 0x00005625d835540f (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1583:0
#247 0x00005625d8355be9 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1695:0
#248 0x00005625d8355de1 llvm::legacy::PassManager::run(llvm::Module&)
/home/rxz226/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1727:0
#249 0x00005625d90f88c4 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/rxz226/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:959:0
#250 0x00005625d90fd9e0 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/rxz226/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1677:0
#251 0x00005625da25dcf6
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/rxz226/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:335:0
#252 0x00005625db940596 clang::ParseAST(clang::Sema&, bool, bool)
/home/rxz226/llvm-project/clang/lib/Parse/ParseAST.cpp:178:0
#253 0x00005625d993aa29 clang::ASTFrontendAction::ExecuteAction()
/home/rxz226/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1060:0
#254 0x00005625da25afca clang::CodeGenAction::ExecuteAction()
/home/rxz226/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1185:0
#255 0x00005625d993a38a clang::FrontendAction::Execute()
/home/rxz226/llvm-project/clang/lib/Frontend/FrontendAction.cpp:957:0
clang-11: error: unable to execute command: Aborted (core dumped)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
1657f0ebc2b4d3ec5b9e717119238e9198ad203c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/rxz226/./llvm-project/build/bin
clang-11: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-11: note: diagnostic msg: /tmp/2-1bbd22.c
clang-11: note: diagnostic msg: /tmp/2-1bbd22.sh
clang-11: note: diagnostic msg:
---
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200604/c21f21db/attachment-0001.html>
More information about the llvm-bugs
mailing list