public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94219] New: ICE in cxx_eval_bare_aggregate, at cp/constexpr.c:3790
@ 2020-03-18 22:24 ppalka at gcc dot gnu.org
  2020-03-19  8:17 ` [Bug c++/94219] " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-03-18 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94219
           Summary: ICE in cxx_eval_bare_aggregate, at cp/constexpr.c:3790
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

$ cat 94066-struct.C
struct A { long x; };

struct U;
constexpr A foo(U *up);

struct U {       // struct instead of union
  A a = foo(this); int y;
};

constexpr A foo(U *up) {
  up->y = 11;
  return {42};
}

extern constexpr U u = {};

static_assert(u.y == 11, "");
static_assert(u.a.x == 42, "");
$ g++ -std=c++14 94066-struct.C
94066-modified.C:15:25: internal compiler error: in cxx_eval_bare_aggregate, at
cp/constexpr.c:3790
   18 | extern constexpr U u = {};
      |                         ^
0x602956 cxx_eval_bare_aggregate
        /home/patrick/code/gcc-master/gcc/cp/constexpr.c:3790
0x941caf cxx_eval_constant_expression
        /home/patrick/code/gcc-master/gcc/cp/constexpr.c:5895
0x944914 cxx_eval_outermost_constant_expr
        /home/patrick/code/gcc-master/gcc/cp/constexpr.c:6451
0x9498c4 maybe_constant_init_1
        /home/patrick/code/gcc-master/gcc/cp/constexpr.c:6908
0xb1919c store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        /home/patrick/code/gcc-master/gcc/cp/typeck2.c:889
0x9acc22 check_initializer
        /home/patrick/code/gcc-master/gcc/cp/decl.c:6838
0x9ae917 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        /home/patrick/code/gcc-master/gcc/cp/decl.c:7764
0xa57a9d cp_parser_init_declarator
        /home/patrick/code/gcc-master/gcc/cp/parser.c:20837
0xa378f3 cp_parser_simple_declaration
        /home/patrick/code/gcc-master/gcc/cp/parser.c:13689
0xa5fd97 cp_parser_declaration
        /home/patrick/code/gcc-master/gcc/cp/parser.c:13388
0xa60517 cp_parser_translation_unit
        /home/patrick/code/gcc-master/gcc/cp/parser.c:4731
0xa60517 c_parse_file()
        /home/patrick/code/gcc-master/gcc/cp/parser.c:43758
0xb70dcb c_common_parse_file()
        /home/patrick/code/gcc-master/gcc/c-family/c-opts.c:1186



This is closely related to PR c++/94066, but unlike that PR, this one is not a
regression AFAICT.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-04 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 22:24 [Bug c++/94219] New: ICE in cxx_eval_bare_aggregate, at cp/constexpr.c:3790 ppalka at gcc dot gnu.org
2020-03-19  8:17 ` [Bug c++/94219] " marxin at gcc dot gnu.org
2020-04-01 21:41 ` ppalka at gcc dot gnu.org
2020-04-04 16:18 ` cvs-commit at gcc dot gnu.org
2020-04-04 16:21 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).