[llvm-bugs] [Bug 50896] New: ICE on valid code: CodeGen::CodeGenFunction::EmitPointerWithAlignment(const clang::Expr*, clang::CodeGen::LValueBaseInfo*, clang::CodeGen::TBAAAccessInfo*): Assertion `E->getType()->isPointerType() || E->getType()->isObjCObjectPointerType()' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 26 14:25:30 PDT 2021


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

            Bug ID: 50896
           Summary: ICE on valid code:
                    CodeGen::CodeGenFunction::EmitPointerWithAlignment(con
                    st clang::Expr*, clang::CodeGen::LValueBaseInfo*,
                    clang::CodeGen::TBAAAccessInfo*): Assertion
                    `E->getType()->isPointerType() ||
                    E->getType()->isObjCObjectPointerType()' 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

Gcc can compile the test program.

$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
2e9c75daffddd65e37c3236708b5b133e6f5f2f5)
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
test_memcpy_inline_0(dst) { __builtin_memcpy_inline(dst, 7, 0); }

$ clang-trunk  mutant.c
mutant.c:1:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
test_memcpy_inline_0(dst) { __builtin_memcpy_inline(dst, 7, 0); }
^
mutant.c:1:65: warning: non-void function does not return a value
[-Wreturn-type]
test_memcpy_inline_0(dst) { __builtin_memcpy_inline(dst, 7, 0); }
                                                                ^
clang-13:
/tmp/tmp.xjN6dMkdrg-clang-builder/llvm-project/clang/lib/CodeGen/CGExpr.cpp:1076:
clang::CodeGen::Address
clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(const clang::Expr*,
clang::CodeGen::LValueBaseInfo*, clang::CodeGen::TBAAAccessInfo*): Assertion
`E->getType()->isPointerType() || E->getType()->isObjCObjectPointerType()'
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_20210623_212741_0691/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
-fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210623_212741_0691/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-f2fe6e.o -x c mutant.c
1.      <eof> parser at end of file
2.      mutant.c:1:1: LLVM IR generation of declaration 'test_memcpy_inline_0'
3.      mutant.c:1:1: Generating code for declaration 'test_memcpy_inline_0'
 #0 0x000055584851f184 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055584851c93e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f2876e2d3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007f28768cc18b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007f28768ab859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007f28768ab729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007f28768ab729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007f28768bcf36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x0000555848bc4c57
clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(clang::Expr const*,
clang::CodeGen::LValueBaseInfo*, clang::CodeGen::TBAAAccessInfo*)
(/scratch/software/clang-trunk/bin/clang-13+0x4000c57)
 #9 0x0000555848b14f25
clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::GlobalDecl, unsigned
int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot)
(/scratch/software/clang-trunk/bin/clang-13+0x3f50f25)
#10 0x0000555848bcc0b7
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot)
(/scratch/software/clang-trunk/bin/clang-13+0x40080b7)
#11 0x0000555848c052b2 (anonymous
namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*)
CGExprScalar.cpp:0:0
#12 0x0000555848c027a9 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#13 0x0000555848c0496a
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x404096a)
#14 0x0000555848babc57 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x3fe7c57)
#15 0x0000555848bca5ce
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/scratch/software/clang-trunk/bin/clang-13+0x40065ce)
#16 0x00005558488aed1a clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/scratch/software/clang-trunk/bin/clang-13+0x3cead1a)
#17 0x00005558488b50bc
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/scratch/software/clang-trunk/bin/clang-13+0x3cf10bc)
#18 0x000055584890c501
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(/scratch/software/clang-trunk/bin/clang-13+0x3d48501)
#19 0x000055584891dd5c
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/scratch/software/clang-trunk/bin/clang-13+0x3d59d5c)
#20 0x00005558489773f6
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/scratch/software/clang-trunk/bin/clang-13+0x3db33f6)
#21 0x0000555848972f45
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/scratch/software/clang-trunk/bin/clang-13+0x3daef45)
#22 0x00005558489733ab
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/scratch/software/clang-trunk/bin/clang-13+0x3daf3ab)
#23 0x000055584897be62
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0)
CodeGenModule.cpp:0:0
#24 0x000055584967e7e9 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
ModuleBuilder.cpp:0:0
#25 0x00005558496709d0
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/scratch/software/clang-trunk/bin/clang-13+0x4aac9d0)
#26 0x000055584a7342b4 clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5b702b4)
#27 0x000055584967b968 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-13+0x4ab7968)
#28 0x0000555848f2b599 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-13+0x4367599)
#29 0x0000555848ebe7e6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-13+0x42fa7e6)
#30 0x0000555849009480
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-13+0x4445480)
#31 0x0000555845e29696 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-13+0x1265696)
#32 0x0000555845e259d8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#33 0x0000555845d530e6 main
(/scratch/software/clang-trunk/bin/clang-13+0x118f0e6)
#34 0x00007f28768ad0b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#35 0x0000555845e2554e _start
(/scratch/software/clang-trunk/bin/clang-13+0x126154e)
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
2e9c75daffddd65e37c3236708b5b133e6f5f2f5)
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-132a11.c
clang-13: note: diagnostic msg: /tmp/mutant-132a11.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/20210626/0cde5e4d/attachment.html>


More information about the llvm-bugs mailing list