https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127437
Bug ID: 127437
Summary: ICE when compiling static constexpr class member in
folly v2024.06.24.00
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: emcdonou at qti dot qualcomm.com
Target Milestone: ---
Building an older version of Facebook's folly library (v2024.06.24.00) with GCC
trunk raises an internal compiler error:
```
FAILED: CMakeFiles/folly_base.dir/folly/executors/ThreadedExecutor.cpp.o
/LOCAL_GCC_DIR/install/bin/g++ -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_NO_LIB
-DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_NO_LIB
-DBOOST_THREAD_NO_LIB
-DFOLLY_XLOG_STRIP_PREFIXES=\"/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly:/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/build/folly\"
-DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/build/folly
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/installed/boost-zx4dnmrsYQuLnaBBZgU9QGA7zjQqdfd-RUkfMX_dWME/include
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/installed/gflags-we_TrUvMp4XcTXHtm-ej3ysaYipXlvsuX6--4CLKfww/include
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/installed/glog-jdGF4xdx3mDg3sWabURe0GsaYeyesw-thMupATB-cCQ/include
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-deps/include
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/installed/zlib-NNb0z_RM9obMYpwsPComg3ERXb-7FfFBPp7y-NOo76A/include
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/installed/libdwarf-BUSbng2aiM5s9nPljKcrcj3hXEDfnSzlof2mViQ3cdk/include
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/installed/libsodium-aRKiFrYazNb4dA1IYxxJ1cnnf96EPxvQ7yS39dcfRw8/include
-I/USER_HOME/DCPerfGCC/benchmarks/tao_bench/build-folly/installed/fmt-bfXqayLRkD1f2EbJX0-uPnwefDmCQQxreA2ws6YU6D8/include
-save-temps -freport-bug -O2 -g -DNDEBUG -std=gnu++17 -fcoroutines -g
-finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated
-Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized
-Wunused-label -Wunused-result -Wshadow-compatible-local -Wno-noexcept-type
-faligned-new -fopenmp -MD -MT
CMakeFiles/folly_base.dir/folly/executors/ThreadedExecutor.cpp.o -MF
CMakeFiles/folly_base.dir/folly/executors/ThreadedExecutor.cpp.o.d -o
CMakeFiles/folly_base.dir/folly/executors/ThreadedExecutor.cpp.o -c
/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly/folly/executors/ThreadedExecutor.cpp
In file included from
/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly/folly/synchronization/Hazptr.h:23,
from
/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly/folly/concurrency/UnboundedQueue.h:30,
from
/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly/folly/executors/ThreadedExecutor.h:24,
from
/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly/folly/executors/ThreadedExecutor.cpp:17:
/USER_HOME/DCPerfGCC/benchmarks/tao_bench/folly/folly/synchronization/HazptrObjLinked.h:91:40:
internal compiler error: in verify_ctor_sanity, at cp/constexpr.cc:7362
91 | static constexpr Count kRef = Count{1};
| ^
0x29bb6d3 internal_error(char const*, ...)
/LOCAL_GCC_BUILD_DIR/gcc/gcc/diagnostic-global-context.cc:787
0x8aff8b fancy_abort(char const*, int, char const*)
/LOCAL_GCC_BUILD_DIR/gcc/gcc/diagnostics/context.cc:1813
0x91a9bb verify_ctor_sanity
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/constexpr.cc:7362
0x93662f verify_ctor_sanity
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/constexpr.cc:7362
0x93662f cxx_eval_bare_aggregate
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/constexpr.cc:7407
0x9279bf cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/constexpr.cc:10673
0x93b5fb cxx_eval_outermost_constant_expr
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/constexpr.cc:11655
0x946627 maybe_constant_init_1
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/constexpr.cc:12302
0xce37e3 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/typeck2.cc:1102
0x9ef637 check_initializer
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/decl.cc:8778
0x9f645b cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/decl.cc:9898
0xa0e16f finish_static_data_member_decl(tree_node*, tree_node*, bool,
tree_node*, int)
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/decl2.cc:1229
0xb6bd3b cp_parser_member_declaration
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:31631
0xb3115b cp_parser_member_specification_opt
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:31054
0xb3115b cp_parser_class_specifier
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:29940
0xb32ba7 cp_parser_type_specifier
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:22507
0xb53dbf cp_parser_decl_specifier_seq
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:18986
0xb67c73 cp_parser_single_declaration
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:36679
0xb682bf cp_parser_template_declaration_after_parameters
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:36436
0xb682bf cp_parser_explicit_template_declaration
/LOCAL_GCC_BUILD_DIR/gcc/gcc/cp/parser.cc:36610
```
GCC version: GCC 17 (HEAD -> 6ef69b644ea98da590e3830a97a9fed3c3044ca3)
Options used when building GCC: --with-gcc-major-version-only --enable-checking
--disable-nls --build=aarch64-redhat-linux --enable-languages=c,c++,lto
OS: Centos 9
Target triple: aarch64-redhat-linux
Processor: ARM Neoverse-V2