[llvm-bugs] [Bug 51546] New: ICE on compilable code: llvm::TargetLoweringBase::getRegClassFor(llvm::MVT, bool) const: Assertion `RC && "This value type is not natively supported!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 19 11:34:46 PDT 2021


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

            Bug ID: 51546
           Summary: ICE on compilable code:
                    llvm::TargetLoweringBase::getRegClassFor(llvm::MVT,
                    bool) const: Assertion `RC && "This value type is not
                    natively supported!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cnsun at uwaterloo.ca
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

$ clang-trunk -v
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
f5d5f17d3ad455de2fbb9448acea66cbc09561c5)
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
__attribute__((target("general-regs-only"))) foo1() {
  union {
    long double d;
  } e;
  a(e.d);
}

$ clang-trunk  mutant.c
mutant.c:1:46: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
__attribute__((target("general-regs-only"))) foo1() {
                                             ^
mutant.c:5:3: warning: implicit declaration of function 'a' is invalid in C99
[-Wimplicit-function-declaration]
  a(e.d);
  ^
mutant.c:6:1: warning: non-void function does not return a value
[-Wreturn-type]
}
^
clang-14:
/tmp/tmp.juz6ZsGfL6-clang-builder/llvm-project/llvm/include/llvm/CodeGen/TargetLowering.h:855:
virtual const llvm::TargetRegisterClass*
llvm::TargetLoweringBase::getRegClassFor(llvm::MVT, bool) const: Assertion `RC
&& "This value type is not natively supported!"' 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-14 -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/temp_testing_campaigns/default_finding_folder_c/crash_20210819_073934_02e6/delta/perses_result
-resource-dir /scratch/software/clang-trunk/lib/clang/14.0.0 -c-isystem .
-c-isystem /usr/local/include/cmsith -internal-isystem
/scratch/software/clang-trunk/lib/clang/14.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
-fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/temp_testing_campaigns/default_finding_folder_c/crash_20210819_073934_02e6/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-c04690.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 DAG->DAG Instruction Selection' on function '@foo1'
 #0 0x0000556194a9f9a4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000556194a9d0be SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fcce9f843c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007fcce9a2318b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007fcce9a02859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007fcce9a02729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007fcce9a02729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007fcce9a13f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x0000556195a189ee llvm::FunctionLoweringInfo::CreateRegs(llvm::Type*,
bool) (/scratch/software/clang-trunk/bin/clang-14+0x4b249ee)
 #9 0x0000556195a0adaf
llvm::FunctionLoweringInfo::InitializeRegForValue(llvm::Value const*)
(/scratch/software/clang-trunk/bin/clang-14+0x4b16daf)
#10 0x0000556195a763f9 llvm::SelectionDAGBuilder::getValueImpl(llvm::Value
const*) (/scratch/software/clang-trunk/bin/clang-14+0x4b823f9)
#11 0x0000556195a7c0f5 llvm::SelectionDAGBuilder::getValue(llvm::Value const*)
(/scratch/software/clang-trunk/bin/clang-14+0x4b880f5)
#12 0x0000556195a89475 llvm::SelectionDAGBuilder::LowerCallTo(llvm::CallBase
const&, llvm::SDValue, bool, bool, llvm::BasicBlock const*)
(/scratch/software/clang-trunk/bin/clang-14+0x4b95475)
#13 0x0000556195a75859 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst
const&) (/scratch/software/clang-trunk/bin/clang-14+0x4b81859)
#14 0x0000556195aa34ed llvm::SelectionDAGBuilder::visit(llvm::Instruction
const&) (/scratch/software/clang-trunk/bin/clang-14+0x4baf4ed)
#15 0x0000556195b0ff70
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
true, false, void>, false, true>,
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true,
false, void>, false, true>, bool&)
(/scratch/software/clang-trunk/bin/clang-14+0x4c1bf70)
#16 0x0000556195b11bc4
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/scratch/software/clang-trunk/bin/clang-14+0x4c1dbc4)
#17 0x0000556195b12e41
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0)
SelectionDAGISel.cpp:0:0
#18 0x0000556193520f70 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
X86ISelDAGToDAG.cpp:0:0
#19 0x0000556193c5e4a8
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/scratch/software/clang-trunk/bin/clang-14+0x2d6a4a8)
#20 0x0000556194150225 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/scratch/software/clang-trunk/bin/clang-14+0x325c225)
#21 0x0000556194150469 llvm::FPPassManager::runOnModule(llvm::Module&)
(/scratch/software/clang-trunk/bin/clang-14+0x325c469)
#22 0x0000556194151552 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/scratch/software/clang-trunk/bin/clang-14+0x325d552)
#23 0x0000556194de3cfa (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#24 0x0000556194de57cd 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-14+0x3ef17cd)
#25 0x0000556195c487ef
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/scratch/software/clang-trunk/bin/clang-14+0x4d547ef)
#26 0x0000556196d22e49 clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-14+0x5e2ee49)
#27 0x0000556195c47338 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-14+0x4d53338)
#28 0x00005561954dbd39 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-14+0x45e7d39)
#29 0x000055619547144e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-14+0x457d44e)
#30 0x00005561955baea0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-14+0x46c6ea0)
#31 0x00005561922b778d cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-14+0x13c378d)
#32 0x00005561922b3ad8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#33 0x00005561921ddf49 main
(/scratch/software/clang-trunk/bin/clang-14+0x12e9f49)
#34 0x00007fcce9a040b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#35 0x00005561922b364e _start
(/scratch/software/clang-trunk/bin/clang-14+0x13bf64e)
clang-14: error: unable to execute command: Aborted (core dumped)
clang-14: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
f5d5f17d3ad455de2fbb9448acea66cbc09561c5)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
clang-14: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-14: note: diagnostic msg: /tmp/mutant-4bd8ae.c
clang-14: note: diagnostic msg: /tmp/mutant-4bd8ae.sh
clang-14: 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/20210819/c67b3b1e/attachment-0001.html>


More information about the llvm-bugs mailing list