<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Assert in OpenMP program when parsing use_allocator clause on target directive"
   href="https://bugs.llvm.org/show_bug.cgi?id=50619">50619</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assert in OpenMP program when parsing use_allocator clause on target directive
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>carlo.bertolli@amd.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24930" name="attach_24930" title="Input program provoking compiler assert">attachment 24930</a> <a href="attachment.cgi?id=24930&action=edit" title="Input program provoking compiler assert">[details]</a></span>
Input program provoking compiler assert

See attachment for source.
This only shows up for amdgpu target.
Build command:
 clang -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa alloc_cgroup.c

Assert:
clang-13:
/work/cbertoll/trunk/llvm-project/clang/lib/Parse/ParseExprCXX.cpp:159: bool
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::ParsedType, bool, bool, bool*, bool, clang::IdentifierInfo**, bool,
bool): Assertion `getLangOpts().CPlusPlus && "Call sites of this function
should be guarded by checking for C++"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /work/cbertoll/trunk/build/bin/clang-13 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations
-disable-free -main-file-name alloc_cgroup.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=/work/cbertoll/git/aomp13/aomp/test/smoke-fails/alloc_cgroup
-resource-dir /work/cbertoll/trunk/build/lib/clang/13.0.0 -internal-isystem
/work/cbertoll/trunk/build/lib/clang/13.0.0/include -internal-isystem
/usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../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=/work/cbertoll/git/aomp13/aomp/test/smoke-fails/alloc_cgroup
-ferror-limit 19 -fopenmp -fopenmp-cuda-parallel-target-regions
-fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig
-D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/alloc_cgroup-6bdfd6.o -x c alloc_cgroup.c
1.      alloc_cgroup.c:29:36: current parser token 'omp_cgroup_mem_alloc'
2.      alloc_cgroup.c:17:35: parsing function body
'test_uses_allocators_cgroup'
3.      alloc_cgroup.c:17:35: in compound statement ('{}')
 #0 0x0000559ac83a53ff PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000559ac83a2c4d SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fa68cf59980 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #3 0x00007fa68bc0afb7 raise
/build/glibc-S7xCS9/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #4 0x00007fa68bc0c921 abort /build/glibc-S7xCS9/glibc-2.27/stdlib/abort.c:81:0
 #5 0x00007fa68bbfc48a __assert_fail_base
/build/glibc-S7xCS9/glibc-2.27/assert/assert.c:89:0
 #6 0x00007fa68bbfc502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
 #7 0x0000559ac9f4c941
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool, bool*, bool,
clang::IdentifierInfo**, bool, bool)
(/work/cbertoll/trunk/build/bin/clang-13+0x4235941)
 #8 0x0000559ac9f4de39 clang::Parser::ParseCXXIdExpression(bool)
(/work/cbertoll/trunk/build/bin/clang-13+0x4236e39)
 #9 0x0000559ac9f6aae8
clang::Parser::ParseOpenMPUsesAllocatorClause(llvm::omp::Directive)
(/work/cbertoll/trunk/build/bin/clang-13+0x4253ae8)
#10 0x0000559ac9f6f3be clang::Parser::ParseOpenMPClause(llvm::omp::Directive,
llvm::omp::Clause, bool) (/work/cbertoll/trunk/build/bin/clang-13+0x42583be)
#11 0x0000559ac9f7357f
clang::Parser::ParseOpenMPDeclarativeOrExecutableDirective(clang::Parser::ParsedStmtContext)
(/work/cbertoll/trunk/build/bin/clang-13+0x425c57f)
#12 0x0000559ac9f90228
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::ParsedAttributesWithRange&)
(/work/cbertoll/trunk/build/bin/clang-13+0x4279228)
#13 0x0000559ac9f9145c
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/work/cbertoll/trunk/build/bin/clang-13+0x427a45c)
#14 0x0000559ac9f8dffb clang::Parser::ParseCompoundStatementBody(bool)
(/work/cbertoll/trunk/build/bin/clang-13+0x4276ffb)
#15 0x0000559ac9f8e4bb clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) (/work/cbertoll/trunk/build/bin/clang-13+0x42774bb)
#16 0x0000559ac9ef8f24
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/work/cbertoll/trunk/build/bin/clang-13+0x41e1f24)
#17 0x0000559ac9f1b4e6 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/work/cbertoll/trunk/build/bin/clang-13+0x42044e6)
#18 0x0000559ac9ef5139
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/work/cbertoll/trunk/build/bin/clang-13+0x41de139)
#19 0x0000559ac9ef5881
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.280) Parser.cpp:0:0
#20 0x0000559ac9ef5a70
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/work/cbertoll/trunk/build/bin/clang-13+0x41dea70)
#21 0x0000559ac9ef66c9
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/work/cbertoll/trunk/build/bin/clang-13+0x41df6c9)
#22 0x0000559ac9eec819 clang::ParseAST(clang::Sema&, bool, bool)
(/work/cbertoll/trunk/build/bin/clang-13+0x41d5819)
#23 0x0000559ac9359928 clang::CodeGenAction::ExecuteAction()
(/work/cbertoll/trunk/build/bin/clang-13+0x3642928)
#24 0x0000559ac8cb65c1 clang::FrontendAction::Execute()
(/work/cbertoll/trunk/build/bin/clang-13+0x2f9f5c1)
#25 0x0000559ac8c52e5a
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/work/cbertoll/trunk/build/bin/clang-13+0x2f3be5a)
#26 0x0000559ac8d83bfa
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/work/cbertoll/trunk/build/bin/clang-13+0x306cbfa)
#27 0x0000559ac6c5990c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/work/cbertoll/trunk/build/bin/clang-13+0xf4290c)
#28 0x0000559ac6c54ed9 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#29 0x0000559ac6bcd167 main (/work/cbertoll/trunk/build/bin/clang-13+0xeb6167)
#30 0x00007fa68bbedbf7 __libc_start_main
/build/glibc-S7xCS9/glibc-2.27/csu/../csu/libc-start.c:344:0
#31 0x0000559ac6c54a4a _start
(/work/cbertoll/trunk/build/bin/clang-13+0xf3da4a)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>