https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127395

            Bug ID: 127395
           Summary: [17 Regression] ICE on abseil-cpp-20260817: in
                    verify_ctor_sanity, at cp/constexpr.cc:7362
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Initially noticed ICE on abseil-cpp-20260817 on gcc-master. Bisected down to
r17-4199-gdad7275f7cc570. `cvise` came up with this reproducer:

// $ cat substitute.cc.cc
template <typename> void JoinAlgorithm() { constexpr long kMaxSize = long{}; }

$ gcc/xg++ -Bgcc -c substitute.cc.cc
substitute.cc.cc: In function ‘void JoinAlgorithm()’:
substitute.cc.cc:1:75: internal compiler error: in verify_ctor_sanity, at
cp/constexpr.cc:7362
    1 | template <typename> void JoinAlgorithm() { constexpr long kMaxSize =
long{}; }
      |                                                                        
  ^
0x2c7aec0 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2c6d0b4 internal_error(char const*, ...)
        ???:0
0x2c783f7 fancy_abort(char const*, int, char const*)
        ???:0
0x8c5ad0 verify_ctor_sanity(constexpr_ctx const*, tree_node*)
        ???:0
0x8db441 cxx_eval_bare_aggregate(constexpr_ctx const*, tree_node*, value_cat,
bool*, bool*, tree_node**)
        ???:0
0x8cd115 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        ???:0
0x8e121a cxx_eval_outermost_constant_expr(tree_node*, bool, bool, mce_value,
bool, tree_node*)
        ???:0
0x8ec1c7 maybe_constant_init_1(tree_node*, tree_node*, bool, mce_value)
        ???:0
0x8ec2d8 maybe_constant_init(tree_node*, tree_node*, bool)
        ???:0
0xc8a4b4 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0x995909 check_initializer(tree_node*, tree_node*, int, vec<tree_node*, va_gc,
vl_embed>**)
        ???:0
0x99d5ba cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
        ???:0
0xb12aec cp_parser_init_declarator(cp_parser*, int, cp_decl_specifier_seq*,
vec<deferred_access_check, va_gc, vl_embed>*, bool, bool, int, bool*,
tree_node**, unsigned long*, tree_node**)
        ???:0
0xb15c5a cp_parser_simple_declaration(cp_parser*, bool, tree_node**)
        ???:0
0xb16343 cp_parser_block_declaration(cp_parser*, bool)
        ???:0
0xb16416 cp_parser_declaration_statement(cp_parser*)
        ???:0
0xae1a22 cp_parser_statement(cp_parser*, tree_node*, bool, bool*,
vec<tree_node*, va_heap, vl_ptr>*, unsigned long*)
        ???:0
0xae1d29 cp_parser_statement_seq_opt(cp_parser*, tree_node*)
        ???:0
0xae1f21 cp_parser_compound_statement(cp_parser*, tree_node*, int, bool)
        ???:0
0xb11661 cp_parser_ctor_initializer_opt_and_function_body(cp_parser*, bool)
        ???:0
gcc/cc1plus -quiet -iprefix /tmp/gb/gcc/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
-isystem gcc/include -isystem gcc/include-fixed -D_GNU_SOURCE substitute.cc.cc
-quiet -dumpbase substitute.cc.cc -dumpbase-ext .cc -mtune=generic
-march=x86-64 -o /tmp/nix-shell-1775698-4163961962/cco3oNDT.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ gcc/xg++ -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xg++
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer
--enable-languages=c,c++ CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260914 (experimental) (GCC)

Reply via email to