[LLVMbugs] [Bug 22239] New: SROA, address space mishandling, Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 15 04:19:25 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22239

            Bug ID: 22239
           Summary: SROA, address space mishandling, Assertion
                    `isa<X>(Val) && "cast<Ty>() argument of incompatible
                    type!"' failed.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: patrik.h.hagglund at ericsson.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13691
  --> http://llvm.org/bugs/attachment.cgi?id=13691&action=edit
testcase

This regression was introduced by r225061, [SROA] Teach SROA how to much more
intelligently handle split loads and stores.

Testcase:

target datalayout = "p:16:16-p21:32:16"

%rec221 = type { i16 addrspace(21)*, i32 }

define void @foo() {
  %entry.80 = alloca %rec221
  %1 = bitcast %rec221* %entry.80 to i64*
  %2 = load i64 addrspace(21)* undef
  store i64 %2, i64* %1
  %entry.80.0._tmp337.sroa_idx = getelementptr inbounds %rec221* %entry.80, i16
0, i32 0
  %entry.80.0._tmp338 = load i16 addrspace(21)** %entry.80.0._tmp337.sroa_idx
  ret void
}


> opt sroa-addrsp.ll -sroa -S -o /dev/null
opt: ../include/llvm/Support/Casting.h:237: typename cast_retty<X, Y
*>::ret_type llvm::cast(Y *) [X = llvm::Instruction, Y = llvm::Value]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
0  opt             0x00000000013acf98 llvm::sys::PrintStackTrace(_IO_FILE*) +
40
1  opt             0x00000000013ae57b
2  libpthread.so.0 0x00007fde4192c810
3  libc.so.6       0x00007fde41147755 gsignal + 53
4  libc.so.6       0x00007fde41148d31 abort + 385
5  libc.so.6       0x00007fde41140610 __assert_fail + 240
6  opt             0x00000000013083ae
7  opt             0x00000000013010d0
8  opt             0x00000000012fd205
9  opt             0x00000000012fab49
10 opt             0x000000000106e63b
llvm::FPPassManager::runOnFunction(llvm::Function&) + 539
11 opt             0x000000000106e8ab
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
12 opt             0x000000000106ee27
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 967
13 opt             0x00000000005c12f3 main + 6419
14 libc.so.6       0x00007fde41133c16 __libc_start_main + 230
15 opt             0x00000000005aecd5
Stack dump:
0.      Program arguments: build-all/bin/opt sroa-addrsp.ll -sroa -S -o
/dev/null
1.      Running pass 'Function Pass Manager' on module 'sroa-addrsp.ll'.
2.      Running pass 'SROA' on function '@foo'
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/20150115/e35c377b/attachment.html>


More information about the llvm-bugs mailing list