[llvm-bugs] [Bug 50852] New: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::MCTargetExpr; Y = const llvm::MCExpr; typename llvm::cast_retty<X, Y*>::ret_type = const llvm::MCTargetExpr*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"'
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jun 24 16:29:17 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50852
Bug ID: 50852
Summary: typename llvm::cast_retty<X, Y*>::ret_type
llvm::cast(Y*) [with X = llvm::MCTargetExpr; Y = const
llvm::MCExpr; typename llvm::cast_retty<X,
Y*>::ret_type = const llvm::MCTargetExpr*]: Assertion
`isa<X>(Val) && "cast<Ty>() argument of incompatible
type!"'
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C
Assignee: unassignedclangbugs at nondot.org
Reporter: cnsun at uwaterloo.ca
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
24d48d45cc302a6abeab139d87ba87f7a2335323)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ cat mutant.c
sad16_sse2(stride) {
int ret;
asm volatile("set %0 %1" : "=r"(ret) : "r"(stride));
}
$ clang-trunk -O0 mutant.c
mutant.c:1:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
sad16_sse2(stride) {
^
mutant.c:4:1: warning: non-void function does not return a value
[-Wreturn-type]
}
^
clang-13:
/tmp/tmp.nPuVKAIgXI-clang-builder/llvm-project/llvm/include/llvm/Support/Casting.h:269:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
llvm::MCTargetExpr; Y = const llvm::MCExpr; typename llvm::cast_retty<X,
Y*>::ret_type = const llvm::MCTargetExpr*]: 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, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /scratch/software/clang-trunk/bin/clang-13 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations
-disable-free -main-file-name mutant.c -mrelocation-model static
-mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb
-fcoverage-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210624_174256_0722/delta/perses_result
-resource-dir /scratch/software/clang-trunk/lib/clang/13.0.0 -c-isystem .
-c-isystem /usr/local/include/cmsith -internal-isystem
/scratch/software/clang-trunk/lib/clang/13.0.0/include -internal-isystem
/usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O0
-fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210624_174256_0722/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-8edd0e.o -x c mutant.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'mutant.c'.
4. Running pass 'X86 Assembly Printer' on function '@sad16_sse2'
#0 0x0000562b7f067274 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x0000562b7f064a2e SignalHandler(int) Signals.cpp:0:0
#2 0x00007fd4404e53c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#3 0x00007fd43ff8418b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#4 0x00007fd43ff63859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
#5 0x00007fd43ff63729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
#6 0x00007fd43ff63729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
#7 0x00007fd43ff74f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#8 0x0000562b7ebd2ddb llvm::MCExpr::evaluateAsRelocatableImpl(llvm::MCValue&,
llvm::MCAssembler const*, llvm::MCAsmLayout const*, llvm::MCFixup const*,
llvm::DenseMap<llvm::MCSection const*, unsigned long,
llvm::DenseMapInfo<llvm::MCSection const*>,
llvm::detail::DenseMapPair<llvm::MCSection const*, unsigned long> > const*,
bool) const (/scratch/software/clang-trunk/bin/clang-13+0x34bbddb)
#9 0x0000562b7ebd3142 llvm::MCExpr::evaluateAsAbsolute(long&) const
(/scratch/software/clang-trunk/bin/clang-13+0x34bc142)
#10 0x0000562b7ec560c8 (anonymous
namespace)::AsmParser::parseExpression(llvm::MCExpr const*&, llvm::SMLoc&)
AsmParser.cpp:0:0
#11 0x0000562b7dd94f59 (anonymous
namespace)::X86AsmParser::ParseATTOperand(llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand,
std::default_delete<llvm::MCParsedAsmOperand> > >&) X86AsmParser.cpp:0:0
#12 0x0000562b7dda567b (anonymous
namespace)::X86AsmParser::ParseInstruction(llvm::ParseInstructionInfo&,
llvm::StringRef, llvm::SMLoc,
llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand,
std::default_delete<llvm::MCParsedAsmOperand> > >&) X86AsmParser.cpp:0:0
#13 0x0000562b7ec4ca25 (anonymous
namespace)::AsmParser::parseAndMatchAndEmitTargetInstruction((anonymous
namespace)::ParseStatementInfo&, llvm::StringRef, llvm::AsmToken, llvm::SMLoc)
AsmParser.cpp:0:0
#14 0x0000562b7ec65692 (anonymous
namespace)::AsmParser::parseStatement((anonymous
namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) (.part.0)
AsmParser.cpp:0:0
#15 0x0000562b7ec5a435 (anonymous namespace)::AsmParser::Run(bool, bool)
AsmParser.cpp:0:0
#16 0x0000562b7fdbc029 llvm::AsmPrinter::emitInlineAsm(llvm::StringRef,
llvm::MCSubtargetInfo const&, llvm::MCTargetOptions const&, llvm::MDNode
const*, llvm::InlineAsm::AsmDialect) const
(/scratch/software/clang-trunk/bin/clang-13+0x46a5029)
#17 0x0000562b7fdbd712 llvm::AsmPrinter::emitInlineAsm(llvm::MachineInstr
const*) const (/scratch/software/clang-trunk/bin/clang-13+0x46a6712)
#18 0x0000562b7fdb80a3 llvm::AsmPrinter::emitFunctionBody()
(/scratch/software/clang-trunk/bin/clang-13+0x46a10a3)
#19 0x0000562b7da8e386
llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
(/scratch/software/clang-trunk/bin/clang-13+0x2377386)
#20 0x0000562b7e287d98
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/scratch/software/clang-trunk/bin/clang-13+0x2b70d98)
#21 0x0000562b7e75f0c5 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/scratch/software/clang-trunk/bin/clang-13+0x30480c5)
#22 0x0000562b7e75f309 llvm::FPPassManager::runOnModule(llvm::Module&)
(/scratch/software/clang-trunk/bin/clang-13+0x3048309)
#23 0x0000562b7e760402 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/scratch/software/clang-trunk/bin/clang-13+0x3049402)
#24 0x0000562b7f3993c2 (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#25 0x0000562b7f39ae7d clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef,
llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/scratch/software/clang-trunk/bin/clang-13+0x3c83e7d)
#26 0x0000562b801c544f
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/scratch/software/clang-trunk/bin/clang-13+0x4aae44f)
#27 0x0000562b8127ce49 clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5b65e49)
#28 0x0000562b801c3f98 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-13+0x4aacf98)
#29 0x0000562b7fa72e79 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-13+0x435be79)
#30 0x0000562b7fa060c6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-13+0x42ef0c6)
#31 0x0000562b7fb50d00
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-13+0x4439d00)
#32 0x0000562b7c977b06 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-13+0x1260b06)
#33 0x0000562b7c973e48 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#34 0x0000562b7c8a10c6 main
(/scratch/software/clang-trunk/bin/clang-13+0x118a0c6)
#35 0x00007fd43ff650b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#36 0x0000562b7c9739be _start
(/scratch/software/clang-trunk/bin/clang-13+0x125c9be)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
24d48d45cc302a6abeab139d87ba87f7a2335323)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
clang-13: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/mutant-b7c077.c
clang-13: note: diagnostic msg: /tmp/mutant-b7c077.sh
clang-13: 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/20210624/908f28ec/attachment.html>
More information about the llvm-bugs
mailing list