[llvm-bugs] [Bug 46516] New: ICE in Sema/SemaDecl.cpp

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 30 05:04:44 PDT 2020


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

            Bug ID: 46516
           Summary: ICE in Sema/SemaDecl.cpp
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tangyixuan at mail.dlut.edu.cn
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Hi, clang++ falls on this case, while g++ is ok, please consider:
$: cat s.C
#ifdef __SIZEOF_INT128__
enum A { A1 = (__uint128_t)-1} a;
#endif

$: clang++ -std=c++2a -c s.C
clang-9: /home/oscar/compiler/llvm-project/clang/lib/Sema/SemaDecl.cpp:17512:
void clang::Sema::ActOnEnumBody(clang::SourceLocation, clang::SourceRange,
clang::Decl*, llvm::ArrayRef<clang::Decl*>, clang::Scope*, const
clang::ParsedAttributesView&): Assertion `NumPositiveBits <= BestWidth && "How
could an initializer get larger than ULL?"' failed.
Stack dump:
0.      Program arguments: /home/oscar/compiler/llvm-project/build/bin/clang-9
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name s.C -mrelocation-model static -mthread-model posix
-mframe-pointer=all -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -resource-dir
/home/oscar/compiler/llvm-project/build/lib/clang/10.0.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/x86_64-linux-gnu/c++/7.5.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/x86_64-linux-gnu/c++/7.5.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/oscar/compiler/llvm-project/build/lib/clang/10.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++2a -fdeprecated-macro -fdebug-compilation-dir
/media/oscar/xuaner1/autogeneration/testsuitC++/bugreports/clang -ferror-limit
19 -fmessage-length 0 -fgnuc-version=4.2.1 -fno-implicit-modules
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -faddrsig -o s.o -x c++ s.C 
1.      s.C:2:32: current parser token 'a'
 #0 0x00005647324b405f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:544:0
 #1 0x00005647324b40f2 PrintStackTraceSignalHandler(void*)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:605:0
 #2 0x00005647324b1f55 llvm::sys::RunSignalHandlers()
/home/oscar/compiler/llvm-project/llvm/lib/Support/Signals.cpp:68:0
 #3 0x00005647324b39ea SignalHandler(int)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:391:0
 #4 0x00007fc8985ea890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x00007fc8976e2e97 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3ee97)
 #6 0x00007fc8976e4801 abort (/lib/x86_64-linux-gnu/libc.so.6+0x40801)
 #7 0x00007fc8976d439a (/lib/x86_64-linux-gnu/libc.so.6+0x3039a)
 #8 0x00007fc8976d4412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x000056473511c5e8 clang::Sema::ActOnEnumBody(clang::SourceLocation,
clang::SourceRange, clang::Decl*, llvm::ArrayRef<clang::Decl*>, clang::Scope*,
clang::ParsedAttributesView const&)
/home/oscar/compiler/llvm-project/clang/lib/Sema/SemaDecl.cpp:17513:0
#10 0x0000564734e95df7 clang::Parser::ParseEnumBody(clang::SourceLocation,
clang::Decl*)
/home/oscar/compiler/llvm-project/clang/lib/Parse/ParseDecl.cpp:4747:0
#11 0x0000564734e951a5 clang::Parser::ParseEnumSpecifier(clang::SourceLocation,
clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&,
clang::AccessSpecifier, clang::Parser::DeclSpecContext)
/home/oscar/compiler/llvm-project/clang/lib/Parse/ParseDecl.cpp:4612:0
#12 0x0000564734e923f4
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/home/oscar/compiler/llvm-project/clang/lib/Parse/ParseDecl.cpp:3870:0
#13 0x0000564734e6cf78
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:1006:0
#14 0x0000564734e6d59f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:1111:0
#15 0x0000564734e6caff
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:931:0
#16 0x0000564734e6bd5c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:682:0
#17 0x0000564734e6b7f7
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:560:0
#18 0x0000564734e67ade clang::ParseAST(clang::Sema&, bool, bool)
/home/oscar/compiler/llvm-project/clang/lib/Parse/ParseAST.cpp:157:0
#19 0x0000564732f3733b clang::ASTFrontendAction::ExecuteAction()
/home/oscar/compiler/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1042:0
#20 0x00005647337e0be2 clang::CodeGenAction::ExecuteAction()
/home/oscar/compiler/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1089:0
#21 0x0000564732f36c9c clang::FrontendAction::Execute()
/home/oscar/compiler/llvm-project/clang/lib/Frontend/FrontendAction.cpp:939:0
#22 0x0000564732ecef17
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/oscar/compiler/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:956:0
#23 0x000056473309ea9b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/oscar/compiler/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:0
#24 0x000056472fb8b0bf cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/oscar/compiler/llvm-project/clang/tools/driver/cc1_main.cpp:250:0
#25 0x000056472fb80613 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/home/oscar/compiler/llvm-project/clang/tools/driver/driver.cpp:309:0
#26 0x000056472fb80d09 main
/home/oscar/compiler/llvm-project/clang/tools/driver/driver.cpp:382:0
#27 0x00007fc8976c5b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#28 0x000056472fb7edea _start
(/home/oscar/compiler/llvm-project/build/bin/clang-9+0x2b39dea)
clang-9: error: unable to execute command: Aborted (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.0 (https://github.com/llvm/llvm-project.git
722b61892454b3217d73ec486e52156c5a92b5b3)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/oscar/compiler/llvm-project/build/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-9: note: diagnostic msg: Error generating preprocessed source(s).

-- 
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/20200630/b45d47e0/attachment-0001.html>


More information about the llvm-bugs mailing list