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

            Bug ID: 117980
           Summary: [15 Regression] ICE in in
                    cxx_eval_outermost_constant_expr, at
                    cp/constexpr.cc:8950 on nix-2.25.2
           Product: gcc
           Version: 15.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: ---

Observed an ICE on today's gcc-master from r15-6053-gd4525729b74782 (did not
bisect yet).

Minimized example:

# ok:
$ g++ -c value.cc.cc -o value.o  -std=c++2a -O0
value.cc.cc:2:13: warning: inline function 'constexpr
basic_string::basic_string(basic_string&)' used but never defined
    2 |   constexpr basic_string(basic_string &);
      |             ^~~~~~~~~~~~

# bad:
$ g++ -c value.cc.cc -o vallue.o  -std=c++2a -O1
value.cc.cc: In function 'void makeConstantStorePathRef(StorePath)':
value.cc.cc:11:80: internal compiler error: in
cxx_eval_outermost_constant_expr, at cp/constexpr.cc:8950
   11 | void makeConstantStorePathRef(StorePath drvPath) {
DerivedPathOpaque{drvPath}; }
      |                                                                        
       ^
0x2403853 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2415160 internal_error(char const*, ...)
        ???:0
0x7a9299 fancy_abort(char const*, int, char const*)
        ???:0
0x761428 cxx_eval_outermost_constant_expr(tree_node*, bool, bool, mce_value,
bool, tree_node*) [clone .cold]
        ???:0
0x7fd21c maybe_constant_init_1(tree_node*, tree_node*, bool, bool)
        ???:0
0x81e28a cp_fold_r(tree_node**, int*, void*)
        ???:0
0x1374683 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x137482a walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x816d5b cp_fold_function(tree_node*)
        ???:0
0x853d60 finish_function(bool)
        ???:0
0x94cf09 cp_parser_function_definition_after_declarator(cp_parser*, bool)
        ???:0
0x94e10c 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
0x953b81 cp_parser_simple_declaration(cp_parser*, bool, tree_node**)
        ???:0
0x95dfeb cp_parser_declaration(cp_parser*, tree_node*)
        ???:0
0x95f25f c_parse_file()
        ???:0
0xa756d1 c_common_parse_file()
        ???:0

$ g++ -v |& unnix
Using built-in specs.
COLLECT_GCC=/<<NIX>>/gcc-15.0.0/bin/g++
COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-15.0.0/libexec/gcc/x86_64-unknown-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../source/configure --prefix=/<<NIX>>/gcc-15.0.0
--with-gmp-include=/<<NIX>>/gmp-6.3.0-dev/include
--with-gmp-lib=/<<NIX>>/gmp-6.3.0/lib
--with-mpfr-include=/<<NIX>>/mpfr-4.2.1-dev/include
--with-mpfr-lib=/<<NIX>>/mpfr-4.2.1/lib --with-mpc=/<<NIX>>/libmpc-1.3.1
--with-native-system-header-dir=/<<NIX>>/glibc-2.40-36-dev/include
--with-build-sysroot=/
--with-gxx-include-dir=/<<NIX>>/gcc-15.0.0/include/c++/15.0.0/
--program-prefix= --enable-lto --disable-libstdcxx-pch
--without-included-gettext --with-system-zlib --enable-checking=release
--enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin
--disable-libcc1 --with-isl=/<<NIX>>/isl-0.20 --disable-bootstrap
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=x86_64-unknown-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 99999999 (experimental) (GCC)

Reply via email to