[llvm-bugs] [Bug 36873] New: Regression in SVN r328252 ([DAGCombiner] Fold (zext (and/or/xor (shl/shr (load x), cst), cst)))

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 23 01:09:08 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36873

            Bug ID: 36873
           Summary: Regression in SVN r328252 ([DAGCombiner] Fold (zext
                    (and/or/xor (shl/shr (load x), cst), cst)))
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: martin at martin.st
                CC: llvm-bugs at lists.llvm.org

Created attachment 20109
  --> https://bugs.llvm.org/attachment.cgi?id=20109&action=edit
Preprocessed C++ source showing the issue

SVN r328252 ([DAGCombiner] Fold (zext (and/or/xor (shl/shr (load x), cst),
cst))) broke compilation of a lot of files for ARM and AArch64.

To reproduce the error, unpack the attached source file and run "clang++
-target aarch64-w64-mingw32 -c preproc-aarch64.cpp -O2 -std=c++17". Currently
this fails with the following backtrace:

clang-7.0: ../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1228: llvm::SDValue
llvm::SelectionDAG::getConstant(const llvm::ConstantInt&, const llvm::SDLoc&,
llvm::EVT, bool, bool): Assertion `Elt->getBitWidth() == EltVT.getSizeInBits()
&& "APInt size does not match type size!"' failed.
#0 0x00000000018b707a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(bin/clang-7.0+0x18b707a)
#1 0x00000000018b4e1e llvm::sys::RunSignalHandlers() (bin/clang-7.0+0x18b4e1e)
#2 0x00000000018b4f92 SignalHandler(int) (bin/clang-7.0+0x18b4f92)
#3 0x00007fb311a84390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007fb3107f6428 gsignal
/build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007fb3107f802a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007fb3107eebd7 __assert_fail_base
/build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0
#7 0x00007fb3107eec82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000002119a3e llvm::SelectionDAG::getConstant(llvm::ConstantInt const&,
llvm::SDLoc const&, llvm::EVT, bool, bool) (bin/clang-7.0+0x2119a3e)
#9 0x0000000002119a9c llvm::SelectionDAG::getConstant(llvm::APInt const&,
llvm::SDLoc const&, llvm::EVT, bool, bool) (bin/clang-7.0+0x2119a9c)
#10 0x000000000204b53b (anonymous
namespace)::DAGCombiner::visitZERO_EXTEND(llvm::SDNode*)
(bin/clang-7.0+0x204b53b)
#11 0x000000000206cded (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
(bin/clang-7.0+0x206cded)
#12 0x000000000206e9ef (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*) (bin/clang-7.0+0x206e9ef)
#13 0x0000000002070687 (anonymous
namespace)::DAGCombiner::Run(llvm::CombineLevel) (.constprop.678)
(bin/clang-7.0+0x2070687)
#14 0x00000000020726eb llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults*, llvm::CodeGenOpt::Level) (bin/clang-7.0+0x20726eb)
#15 0x000000000213f5f2 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(bin/clang-7.0+0x213f5f2)
#16 0x000000000214530a
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(bin/clang-7.0+0x214530a)
#17 0x000000000214751c
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(.part.875.constprop.898) (bin/clang-7.0+0x214751c)
#18 0x0000000001096f55
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(bin/clang-7.0+0x1096f55)
#19 0x0000000001427013 llvm::FPPassManager::runOnFunction(llvm::Function&)
(bin/clang-7.0+0x1427013)
#20 0x00000000014270dc llvm::FPPassManager::runOnModule(llvm::Module&)
(bin/clang-7.0+0x14270dc)
#21 0x0000000001426b7d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(bin/clang-7.0+0x1426b7d)
#22 0x0000000001a775ed (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (bin/clang-7.0+0x1a775ed)
#23 0x0000000001a78e65 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> >) (bin/clang-7.0+0x1a78e65)
#24 0x000000000220a987
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(bin/clang-7.0+0x220a987)
#25 0x000000000253d5d0 clang::ParseAST(clang::Sema&, bool, bool)
(bin/clang-7.0+0x253d5d0)
#26 0x0000000002209caf clang::CodeGenAction::ExecuteAction()
(bin/clang-7.0+0x2209caf)
#27 0x0000000001e8622e clang::FrontendAction::Execute()
(bin/clang-7.0+0x1e8622e)
#28 0x0000000001e51926
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(bin/clang-7.0+0x1e51926)
#29 0x0000000001f1c0dc
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(bin/clang-7.0+0x1f1c0dc)
#30 0x00000000008b4f88 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (bin/clang-7.0+0x8b4f88)
#31 0x0000000000859fe5 main (bin/clang-7.0+0x859fe5)
#32 0x00007fb3107e1830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#33 0x00000000008b1049 _start (bin/clang-7.0+0x8b1049)

-- 
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/20180323/bd8a39a4/attachment.html>


More information about the llvm-bugs mailing list