[llvm-bugs] [Bug 45371] New: opt -separate-const-offset-from-gep fails with Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 31 04:02:54 PDT 2020


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

            Bug ID: 45371
           Summary: opt -separate-const-offset-from-gep fails with
                    Assertion `isa<X>(Val) && "cast<Ty>() argument of
                    incompatible type!"' failed.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23296
  --> https://bugs.llvm.org/attachment.cgi?id=23296&action=edit
bbi-40415_aarch64.ll reproducer

Reproduce with:
 opt -mtriple aarch64-unknown-linux-gnu -separate-const-offset-from-gep -S -o -
bbi-40415_aarch64.ll

Result:

opt: ../include/llvm/Support/Casting.h:263: typename cast_retty<X, Y
*>::ret_type llvm::cast(Y *) [X = llvm::BinaryOperator, Y = llvm::User]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: ../../master/llvm/build-all-builtins/bin/opt
-mtriple aarch64-unknown-linux-gnu -separate-const-offset-from-gep -S -o -
bbi-40415_aarch64.ll 
1.      Running pass 'Function Pass Manager' on module 'bbi-40415_aarch64.ll'.
2.      Running pass 'Split GEPs to a variadic base and a constant offset for
better CSE' on function '@g'
 #0 0x000000000429aa64 PrintStackTraceSignalHandler(void*)
(../../master/llvm/build-all-builtins/bin/opt+0x429aa64)
 #1 0x000000000429862e llvm::sys::RunSignalHandlers()
(../../master/llvm/build-all-builtins/bin/opt+0x429862e)
 #2 0x000000000429ae6c SignalHandler(int)
(../../master/llvm/build-all-builtins/bin/opt+0x429ae6c)
 #3 0x00007f06058ce890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007f0604377e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007f0604379801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007f060436939a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007f0604369412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x000000000418c322 (anonymous
namespace)::ConstantOffsetExtractor::distributeExtsAndCloneChain(unsigned int)
(../../master/llvm/build-all-builtins/bin/opt+0x418c322)
 #9 0x000000000418c1dc (anonymous
namespace)::ConstantOffsetExtractor::distributeExtsAndCloneChain(unsigned int)
(../../master/llvm/build-all-builtins/bin/opt+0x418c1dc)
#10 0x0000000004189ae8 (anonymous
namespace)::SeparateConstOffsetFromGEP::splitGEP(llvm::GetElementPtrInst*)
(../../master/llvm/build-all-builtins/bin/opt+0x4189ae8)
#11 0x0000000004188638 (anonymous
namespace)::SeparateConstOffsetFromGEP::runOnFunction(llvm::Function&)
(../../master/llvm/build-all-builtins/bin/opt+0x4188638)
#12 0x0000000003af5374 llvm::FPPassManager::runOnFunction(llvm::Function&)
(../../master/llvm/build-all-builtins/bin/opt+0x3af5374)
#13 0x0000000003af5628 llvm::FPPassManager::runOnModule(llvm::Module&)
(../../master/llvm/build-all-builtins/bin/opt+0x3af5628)
#14 0x0000000003af5c7d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(../../master/llvm/build-all-builtins/bin/opt+0x3af5c7d)
#15 0x0000000002370d9f main
(../../master/llvm/build-all-builtins/bin/opt+0x2370d9f)
#16 0x00007f060435ab97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#17 0x000000000235b02a _start
(../../master/llvm/build-all-builtins/bin/opt+0x235b02a)
Abort (core dumped)

-- 
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/20200331/50fdae1f/attachment-0001.html>


More information about the llvm-bugs mailing list