[flang-commits] [clang-tools-extra] [libc] [libcxx] [llvm] [compiler-rt] [flang] [clang] [Clang] Generate the GEP instead of adding AST nodes (PR #73730)

Nathan Chancellor via flang-commits flang-commits at lists.llvm.org
Mon Dec 18 11:27:42 PST 2023


nathanchance wrote:

The latest version of this change causes test failures for me:

```
$ cmake \
	-B build \
	-G Ninja \
	-S llvm \
	--log-level=NOTICE \
	-Wno-dev \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_C_COMPILER=clang \
	-DCMAKE_CXX_COMPILER=clang++ \
	-DLLVM_ENABLE_ASSERTIONS=true \
	-DLLVM_ENABLE_PROJECTS=clang \
	-DLLVM_USE_LINKER=lld

$ ninja -C build check-clang
...
FAIL: Clang :: OpenMP/distribute_parallel_for_simd_misc_messages.c (12637 of 20466)
******************** TEST 'Clang :: OpenMP/distribute_parallel_for_simd_misc_messages.c' FAILED ********************
Exit Code: 139

Command Output (stderr):
--
RUN: at line 1: /mnt/nvme/tmp/build/llvm-bisect/bin/clang -cc1 -internal-isystem /mnt/nvme/tmp/build/llvm-bisect/lib/clang/18/include -nostdsysteminc -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 /home/nathan/cbl/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c -Wuninitialized
+ /mnt/nvme/tmp/build/llvm-bisect/bin/clang -cc1 -internal-isystem /mnt/nvme/tmp/build/llvm-bisect/lib/clang/18/include -nostdsysteminc -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 /home/nathan/cbl/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c -Wuninitialized
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /mnt/nvme/tmp/build/llvm-bisect/bin/clang -cc1 -internal-isystem /mnt/nvme/tmp/build/llvm-bisect/lib/clang/18/include -nostdsysteminc -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 /home/nathan/cbl/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c -Wuninitialized
1.      /home/nathan/cbl/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c:359:1: at annotation token
2.      /home/nathan/cbl/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c:350:33: parsing function body 'test_safelen_simdlen'
3.      /home/nathan/cbl/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c:350:33: in compound statement ('{}')
 #0 0x0000564839563fb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x7787fb8)
 #1 0x0000564839561b7e llvm::sys::RunSignalHandlers() (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x7785b7e)
 #2 0x0000564839564668 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f1976577710 (/usr/lib/libc.so.6+0x3e710)
 #4 0x000056483bd312a1 clang::Sema::ActOnFields(clang::Scope*, clang::SourceLocation, clang::Decl*, llvm::ArrayRef<clang::Decl*>, clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributesView const&) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9f552a1)
 #5 0x000056483c304887 clang::Sema::ActOnCapturedRegionError() (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0xa528887)
 #6 0x000056483c1cdb48 clang::Sema::ActOnOpenMPRegionEnd(clang::ActionResult<clang::Stmt*, true>, llvm::ArrayRef<clang::OMPClause*>) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0xa3f1b48)
 #7 0x000056483bac79ec clang::Parser::ParseOpenMPDeclarativeOrExecutableDirective(clang::Parser::ParsedStmtContext, bool) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9ceb9ec)
 #8 0x000056483ba955ba clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9cb95ba)
 #9 0x000056483ba93972 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9cb7972)
#10 0x000056483ba93810 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9cb7810)
#11 0x000056483bac7999 clang::Parser::ParseOpenMPDeclarativeOrExecutableDirective(clang::Parser::ParsedStmtContext, bool) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9ceb999)
#12 0x000056483ba955ba clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9cb95ba)
#13 0x000056483ba93972 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9cb7972)
#14 0x000056483ba9dbc1 clang::Parser::ParseCompoundStatementBody(bool) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9cc1bc1)
#15 0x000056483ba9ec62 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9cc2c62)
#16 0x000056483b9f2ded clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9c16ded)
#17 0x000056483ba63a3e clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9c87a3e)
#18 0x000056483b9f1a5f clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9c15a5f)
#19 0x000056483b9f12e6 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9c152e6)
#20 0x000056483b9f01bd clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9c141bd)
#21 0x000056483b9ee226 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9c12226)
#22 0x000056483b9e8c1e clang::ParseAST(clang::Sema&, bool, bool) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x9c0cc1e)
#23 0x000056483a139d0f clang::FrontendAction::Execute() (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x835dd0f)
#24 0x000056483a0a972d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x82cd72d)
#25 0x000056483a21c52e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x844052e)
#26 0x0000564836f72202 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x5196202)
#27 0x0000564836f6e5ad ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#28 0x0000564836f6d299 clang_main(int, char**, llvm::ToolContext const&) (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x5191299)
#29 0x0000564836f7ea31 main (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x51a2a31)
#30 0x00007f1976560cd0 (/usr/lib/libc.so.6+0x27cd0)
#31 0x00007f1976560d8a __libc_start_main (/usr/lib/libc.so.6+0x27d8a)
#32 0x0000564836f6aaa5 _start (/mnt/nvme/tmp/build/llvm-bisect/bin/clang+0x518eaa5)
...
********************
********************
Failed Tests (17):
  Clang :: OpenMP/distribute_parallel_for_simd_misc_messages.c
  Clang :: OpenMP/distribute_simd_misc_messages.c
  Clang :: OpenMP/for_misc_messages.c
  Clang :: OpenMP/for_simd_misc_messages.c
  Clang :: OpenMP/master_taskloop_misc_messages.c
  Clang :: OpenMP/master_taskloop_simd_misc_messages.c
  Clang :: OpenMP/parallel_for_misc_messages.c
  Clang :: OpenMP/parallel_for_simd_misc_messages.c
  Clang :: OpenMP/parallel_master_taskloop_misc_messages.c
  Clang :: OpenMP/parallel_master_taskloop_simd_misc_messages.c
  Clang :: OpenMP/simd_misc_messages.c
  Clang :: OpenMP/target_parallel_for_misc_messages.c
  Clang :: OpenMP/target_parallel_for_simd_misc_messages.c
  Clang :: OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c
  Clang :: OpenMP/target_teams_distribute_simd_misc_messages.c
  Clang :: OpenMP/taskloop_misc_messages.c
  Clang :: OpenMP/taskloop_simd_misc_messages.c
...
```

I don't mean for this next bit to sound as aggressive or irritated as it might but https://github.com/llvm/llvm-project/issues/73168 has been open for almost a month now and it is actively preventing us from testing the Linux kernel against tip of tree LLVM because (for better or worse...) the kernel has started deploying `__attribute__((__counted_by__(...)))` annotations (and other developers are hitting this too: https://github.com/llvm/llvm-project/issues/75173). Can we please come to some consensus so that issue can be resolved?

https://github.com/llvm/llvm-project/pull/73730


More information about the flang-commits mailing list