[llvm-bugs] [Bug 50926] New: ICE: clang::CodeGen::RValue::getScalarVal() const: Assertion `isScalar() && "Not a scalar!"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 28 06:33:13 PDT 2021


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

            Bug ID: 50926
           Summary: ICE: clang::CodeGen::RValue::getScalarVal() const:
                    Assertion `isScalar() && "Not a scalar!"' failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            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 13.0.0 (https://github.com/llvm/llvm-project.git
8f43407a07f015ca9a7543c6a0b5bde3918f9a0e)
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
typedef int int32x8_t __attribute__((vector_size(32)));
f2() {
  union {
    int32x8_t pair[2];
  } u;
  u.pair[1] + __builtin_complex(0.0, 0.0);
}

$ clang-trunk -w mutant.c
clang-13:
/tmp/tmp.k3xdeQJNgd-clang-builder/llvm-project/clang/lib/CodeGen/CGValue.h:60:
llvm::Value* clang::CodeGen::RValue::getScalarVal() const: Assertion
`isScalar() && "Not a scalar!"' 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_20210628_075247_1cb1/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 -w
-fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210628_075247_1cb1/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-fa52fd.o -x c mutant.c
1.      <eof> parser at end of file
2.      mutant.c:2:1: LLVM IR generation of declaration 'f2'
3.      mutant.c:2:1: Generating code for declaration 'f2'
 #0 0x00005614935eaab4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005614935e826e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007faedf9763c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007faedf41518b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007faedf3f4859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007faedf3f4729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007faedf3f4729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007faedf405f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x0000561493cd0a13 (anonymous
namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*)
CGExprScalar.cpp:0:0
 #9 0x0000561493ccdea9 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#10 0x0000561493cd6ef4 (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*)
CGExprScalar.cpp:0:0
#11 0x0000561493cce02e (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#12 0x0000561493cd3059 (anonymous
namespace)::ScalarExprEmitter::EmitBinOps(clang::BinaryOperator const*)
CGExprScalar.cpp:0:0
#13 0x0000561493ccf156 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#14 0x0000561493cd006a
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x404306a)
#15 0x0000561493c77357 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x3fea357)
#16 0x0000561493c95cce
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/scratch/software/clang-trunk/bin/clang-13+0x4008cce)
#17 0x000056149397a41a clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/scratch/software/clang-trunk/bin/clang-13+0x3ced41a)
#18 0x00005614939807bc
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/scratch/software/clang-trunk/bin/clang-13+0x3cf37bc)
#19 0x00005614939d7c01
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(/scratch/software/clang-trunk/bin/clang-13+0x3d4ac01)
#20 0x00005614939e945c
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/scratch/software/clang-trunk/bin/clang-13+0x3d5c45c)
#21 0x0000561493a42af6
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/scratch/software/clang-trunk/bin/clang-13+0x3db5af6)
#22 0x0000561493a3e645
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/scratch/software/clang-trunk/bin/clang-13+0x3db1645)
#23 0x0000561493a3eaab
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/scratch/software/clang-trunk/bin/clang-13+0x3db1aab)
#24 0x0000561493a47562
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0)
CodeGenModule.cpp:0:0
#25 0x000056149474ba39 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
ModuleBuilder.cpp:0:0
#26 0x000056149473dc20
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/scratch/software/clang-trunk/bin/clang-13+0x4ab0c20)
#27 0x0000561495801504 clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5b74504)
#28 0x0000561494748bb8 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-13+0x4abbbb8)
#29 0x0000561493ff6bb9 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-13+0x4369bb9)
#30 0x0000561493f89e06
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-13+0x42fce06)
#31 0x00005614940d4b00
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-13+0x4447b00)
#32 0x0000561490ef26a6 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-13+0x12656a6)
#33 0x0000561490eee9e8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#34 0x0000561490e1c0f6 main
(/scratch/software/clang-trunk/bin/clang-13+0x118f0f6)
#35 0x00007faedf3f60b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#36 0x0000561490eee55e _start
(/scratch/software/clang-trunk/bin/clang-13+0x126155e)
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
8f43407a07f015ca9a7543c6a0b5bde3918f9a0e)
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-11e1cb.c
clang-13: note: diagnostic msg: /tmp/mutant-11e1cb.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/20210628/460f6ded/attachment.html>


More information about the llvm-bugs mailing list