public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108417] New: [ICE] Crash on aggregate initialization of base class
@ 2023-01-16 13:25 m.cencora at gmail dot com
  2023-01-16 14:04 ` [Bug c++/108417] " m.cencora at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: m.cencora at gmail dot com @ 2023-01-16 13:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108417
           Summary: [ICE] Crash on aggregate initialization of base class
           Product: gcc
           Version: 10.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m.cencora at gmail dot com
  Target Milestone: ---

Code below compiled on any gcc<11 crashes with following output:
during RTL pass: expand
<source>: In function 'Derived ICE_createDerived()':
<source>:37:5: internal compiler error: in assign_temp, at function.c:984
   37 |     };
      |     ^


FWIW it doesn't crash if field 'f3' is removed.

g++ -std=c++17

struct NonTrivial
{
    NonTrivial() = default;
    NonTrivial(const NonTrivial&);
    NonTrivial& operator=(const NonTrivial&);

    char* ptr = nullptr;
};

struct Base
{
   int f1;
   NonTrivial f2;
   int f3;
};

struct Derived : Base
{
   int f4;
};

Derived createDerivedOk()
{
    return Derived{
        Base{},
        0
    };
}

Base createBase();

Derived ICE_createDerived()
{
    return Derived{
        createBase(),
        0
    };
}

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

end of thread, other threads:[~2023-01-17 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 13:25 [Bug c++/108417] New: [ICE] Crash on aggregate initialization of base class m.cencora at gmail dot com
2023-01-16 14:04 ` [Bug c++/108417] " m.cencora at gmail dot com
2023-01-16 14:17 ` rguenth at gcc dot gnu.org
2023-01-16 15:19 ` pinskia at gcc dot gnu.org
2023-01-16 15:37 ` m.cencora at gmail dot com
2023-01-16 16:19 ` pinskia at gcc dot gnu.org
2023-01-17  2:24 ` pinskia at gcc dot gnu.org
2023-01-17 12:57 ` m.cencora at gmail dot com

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).