[llvm-bugs] [Bug 48055] New: Crash in Global Variable Optimizer: "Invalid GetElementPtrInst indices for type!"
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Nov 2 17:01:01 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=48055
Bug ID: 48055
Summary: Crash in Global Variable Optimizer: "Invalid
GetElementPtrInst indices for type!"
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: rupprecht at google.com
CC: llvm-bugs at lists.llvm.org
Created attachment 24122
--> https://bugs.llvm.org/attachment.cgi?id=24122&action=edit
Reproducer
$ clang -O1 -c /tmp/repro.ll
clang:
/home/rupprecht/src/llvm-project/llvm/include/llvm/IR/Instructions.h:898:
llvm::Type *llvm::checkGEPType(llvm::Type *): Assertion `Ty && "Invalid
GetElementPtrInst indices for type!"' 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: clang -O1 -c /tmp/repro.ll
1. Per-module optimization passes
2. Running pass 'Global Variable Optimizer' on module '/tmp/repro.ll'.
...
#12 0x0000000005f2dfca llvm::checkGEPType(llvm::Type*)
/home/rupprecht/src/llvm-project/llvm/include/llvm/IR/Instructions.h:899:10
#13 0x0000000005f2de24 llvm::GetElementPtrInst::getGEPReturnType(llvm::Type*,
llvm::Value*, llvm::ArrayRef<llvm::Value*>)
/home/rupprecht/src/llvm-project/llvm/include/llvm/IR/Instructions.h:1076:36
#14 0x00000000083dd47c llvm::ConstantFoldGetElementPtr(llvm::Type*,
llvm::Constant*, bool, llvm::Optional<unsigned int>,
llvm::ArrayRef<llvm::Value*>)
/home/rupprecht/src/llvm-project/llvm/lib/IR/ConstantFold.cpp:2307:9
#15 0x00000000083fa6e4 llvm::ConstantExpr::getGetElementPtr(llvm::Type*,
llvm::Constant*, llvm::ArrayRef<llvm::Value*>, bool, llvm::Optional<unsigned
int>, llvm::Type*)
/home/rupprecht/src/llvm-project/llvm/lib/IR/Constants.cpp:2248:17
#16 0x00000000079c9a14 llvm::ConstantExpr::getGetElementPtr(llvm::Type*,
llvm::Constant*, llvm::ArrayRef<llvm::Constant*>, bool, llvm::Optional<unsigned
int>, llvm::Type*)
/home/rupprecht/src/llvm-project/llvm/include/llvm/IR/Constants.h:1177:5
#17 0x0000000009135793 evaluateBitcastFromPtr(llvm::Constant*, llvm::DataLayout
const&, llvm::TargetLibraryInfo const*, std::function<llvm::Constant*
(llvm::Constant*)>)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:197:9
#18 0x00000000091354a0 llvm::Evaluator::ComputeLoadResult(llvm::Constant*)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:243:11
#19 0x0000000009136bef
llvm::Evaluator::EvaluateBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
false, false, void>, false, false>, llvm::BasicBlock*&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:457:18
#20 0x0000000009138447 llvm::Evaluator::EvaluateFunction(llvm::Function*,
llvm::Constant*&, llvm::SmallVectorImpl<llvm::Constant*> const&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:698:9
#21 0x00000000091378ed
llvm::Evaluator::EvaluateBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
false, false, void>, false, false>, llvm::BasicBlock*&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:589:13
#22 0x0000000009138447 llvm::Evaluator::EvaluateFunction(llvm::Function*,
llvm::Constant*&, llvm::SmallVectorImpl<llvm::Constant*> const&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:698:9
#23 0x00000000091378ed
llvm::Evaluator::EvaluateBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
false, false, void>, false, false>, llvm::BasicBlock*&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:589:13
#24 0x0000000009138447 llvm::Evaluator::EvaluateFunction(llvm::Function*,
llvm::Constant*&, llvm::SmallVectorImpl<llvm::Constant*> const&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:698:9
#25 0x00000000091378ed
llvm::Evaluator::EvaluateBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
false, false, void>, false, false>, llvm::BasicBlock*&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:589:13
#26 0x0000000009138447 llvm::Evaluator::EvaluateFunction(llvm::Function*,
llvm::Constant*&, llvm::SmallVectorImpl<llvm::Constant*> const&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/Evaluator.cpp:698:9
#27 0x00000000087db316 EvaluateStaticConstructor(llvm::Function*,
llvm::DataLayout const&, llvm::TargetLibraryInfo*)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp:2734:22
#28 0x00000000087db296 optimizeGlobalsInModule(llvm::Module&, llvm::DataLayout
const&, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>,
llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>,
llvm::function_ref<llvm::BlockFrequencyInfo& (llvm::Function&)>,
llvm::function_ref<llvm::DominatorTree&
(llvm::Function&)>)::$_6::operator()(llvm::Function*) const
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp:3102:7
#29 0x00000000087db240 bool llvm::function_ref<bool
(llvm::Function*)>::callback_fn<optimizeGlobalsInModule(llvm::Module&,
llvm::DataLayout const&, llvm::function_ref<llvm::TargetLibraryInfo&
(llvm::Function&)>, llvm::function_ref<llvm::TargetTransformInfo&
(llvm::Function&)>, llvm::function_ref<llvm::BlockFrequencyInfo&
(llvm::Function&)>, llvm::function_ref<llvm::DominatorTree&
(llvm::Function&)>)::$_6>(long, llvm::Function*)
/home/rupprecht/src/llvm-project/llvm/include/llvm/ADT/STLExtras.h:185:5
#30 0x0000000009128b9c llvm::function_ref<bool
(llvm::Function*)>::operator()(llvm::Function*) const
/home/rupprecht/src/llvm-project/llvm/include/llvm/ADT/STLExtras.h:209:5
#31 0x000000000912839c llvm::optimizeGlobalCtorsList(llvm::Module&,
llvm::function_ref<bool (llvm::Function*)>)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/Utils/CtorUtils.cpp:145:9
#32 0x00000000087cee5e optimizeGlobalsInModule(llvm::Module&, llvm::DataLayout
const&, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>,
llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>,
llvm::function_ref<llvm::BlockFrequencyInfo& (llvm::Function&)>,
llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp:3101:20
#33 0x00000000087dd180 (anonymous
namespace)::GlobalOptLegacyPass::runOnModule(llvm::Module&)
/home/rupprecht/src/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp:3178:5
#34 0x000000000856fa76 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/rupprecht/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1634:23
--
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/20201103/a1f3e53d/attachment.html>
More information about the llvm-bugs
mailing list