public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
@ 2022-03-08 19:55 gscfq@t-online.de
  2022-03-08 22:58 ` [Bug c++/104847] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2022-03-08 19:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104847
           Summary: [11/12 Regression] ICE in write_unqualified_name, at
                    cp/mangle.cc:1406
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started between 20200705 and 20200712 :


$ cat z1.cc
struct S { int i; };
union U { S k; };
template <class T, class... Ts> T sink(T&&, Ts&&...);
template <class T>
decltype(sink(U{1},T())) f(T) { return U{1}; }
int main() { f(3); }


$ g++-11-20200705 -c z1.cc
$
$ g++-12-20220306 -c z1.cc
z1.cc: In instantiation of 'decltype (sink(U{1}, T())) f(T) [with T = int]':
z1.cc:5:26: internal compiler error: Segmentation fault
    5 | decltype(sink(U{1},T())) f(T) { return U{1}; }
      |                          ^
0xda3e3f crash_signal
        ../../gcc/toplev.cc:322
0x77dc08 write_unqualified_name
        ../../gcc/cp/mangle.cc:1406
0x783f89 write_expression
        ../../gcc/cp/mangle.cc:3370
0x782e96 write_expression
        ../../gcc/cp/mangle.cc:3507
0x77fb94 write_type
        ../../gcc/cp/mangle.cc:2372
0x7815f9 write_bare_function_type
        ../../gcc/cp/mangle.cc:2775
0x781699 write_encoding
        ../../gcc/cp/mangle.cc:855
0x781c11 mangle_decl_string
        ../../gcc/cp/mangle.cc:4054
0x781e3b get_mangled_id
        ../../gcc/cp/mangle.cc:4075
0x781e3b mangle_decl(tree_node*)
        ../../gcc/cp/mangle.cc:4113
0x1016af2 decl_assembler_name(tree_node*)
        ../../gcc/tree.cc:700
0x9901ef symtab_node::get_comdat_group_id()
        ../../gcc/cgraph.h:254
0x9901ef analyze_functions
        ../../gcc/cgraphunit.cc:1192
0x9913bd symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.cc:2500

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

* [Bug c++/104847] [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
  2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
@ 2022-03-08 22:58 ` mpolacek at gcc dot gnu.org
  2022-03-15  8:47 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-03-08 22:58 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Priority|P3                          |P2
   Last reconfirmed|                            |2022-03-08
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |11.3
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  Started with r11-2016-g6324c52bba490b

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

* [Bug c++/104847] [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
  2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
  2022-03-08 22:58 ` [Bug c++/104847] " mpolacek at gcc dot gnu.org
@ 2022-03-15  8:47 ` jakub at gcc dot gnu.org
  2022-03-15  8:57 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-15  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
struct S { int i; };
union U { S k; };
template <class T, class... Ts> T sink(T&&, Ts&&...);
template <class T>
decltype(sink(U{.k={.i=1}},T())) f(T) { return U{1}; }
int main() { f(3); }

compiles fine.  I guess the question is if ce->index == NULL should be mangled
without the di production of <braced-expression>, or we should implicitly find
the first initializable field and use that with di, i.e. if this should mangle
as
_Z1fIiEDTcl4sinktl1Udi1kilLi1EEEcvT__EEES1_
or as
_Z1fIiEDTcl4sinktl1ULi1EEcvT__EEES1_

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

* [Bug c++/104847] [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
  2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
  2022-03-08 22:58 ` [Bug c++/104847] " mpolacek at gcc dot gnu.org
  2022-03-15  8:47 ` jakub at gcc dot gnu.org
@ 2022-03-15  8:57 ` jakub at gcc dot gnu.org
  2022-03-26 23:55 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-15  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though the nontype-class-union1.C testcase doesn't have explicit designator
syntax either.

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

* [Bug c++/104847] [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
  2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-03-15  8:57 ` jakub at gcc dot gnu.org
@ 2022-03-26 23:55 ` jason at gcc dot gnu.org
  2022-03-28 13:37 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2022-03-26 23:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

* [Bug c++/104847] [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
  2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-03-26 23:55 ` jason at gcc dot gnu.org
@ 2022-03-28 13:37 ` cvs-commit at gcc dot gnu.org
  2022-03-28 19:13 ` [Bug c++/104847] [11 " cvs-commit at gcc dot gnu.org
  2022-03-28 19:14 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-28 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:71e1db540c01a13b01fae054c92878a79252b471

commit r12-7849-g71e1db540c01a13b01fae054c92878a79252b471
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Mar 26 20:10:19 2022 -0400

    c++: mangling union{1} in template [PR104847]

    My implementation of union non-type template arguments in r11-2016 broke
    braced casts of union type, because they are still in syntactic
(undigested)
    form.

            PR c++/104847

    gcc/cp/ChangeLog:

            * mangle.cc (write_expression): Don't write a union designator when
            undigested.

    gcc/testsuite/ChangeLog:

            * g++.dg/abi/mangle-union1.C: New test.

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

* [Bug c++/104847] [11 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
  2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-03-28 13:37 ` cvs-commit at gcc dot gnu.org
@ 2022-03-28 19:13 ` cvs-commit at gcc dot gnu.org
  2022-03-28 19:14 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-28 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:07d7e8b8ae2879241207631fcaeaa83e5e85a240

commit r11-9706-g07d7e8b8ae2879241207631fcaeaa83e5e85a240
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Mar 26 20:10:19 2022 -0400

    c++: mangling union{1} in template [PR104847]

    My implementation of union non-type template arguments in r11-2016 broke
    braced casts of union type, because they are still in syntactic
(undigested)
    form.

            PR c++/104847

    gcc/cp/ChangeLog:

            * mangle.c (write_expression): Don't write a union designator when
            undigested.

    gcc/testsuite/ChangeLog:

            * g++.dg/abi/mangle-union1.C: New test.

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

* [Bug c++/104847] [11 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406
  2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-03-28 19:13 ` [Bug c++/104847] [11 " cvs-commit at gcc dot gnu.org
@ 2022-03-28 19:14 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2022-03-28 19:14 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed

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

end of thread, other threads:[~2022-03-28 19:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 19:55 [Bug c++/104847] New: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 gscfq@t-online.de
2022-03-08 22:58 ` [Bug c++/104847] " mpolacek at gcc dot gnu.org
2022-03-15  8:47 ` jakub at gcc dot gnu.org
2022-03-15  8:57 ` jakub at gcc dot gnu.org
2022-03-26 23:55 ` jason at gcc dot gnu.org
2022-03-28 13:37 ` cvs-commit at gcc dot gnu.org
2022-03-28 19:13 ` [Bug c++/104847] [11 " cvs-commit at gcc dot gnu.org
2022-03-28 19:14 ` jason 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).