public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992
@ 2023-05-09 16:11 eric.niebler at gmail dot com
2023-05-09 16:12 ` [Bug c++/109790] " eric.niebler at gmail dot com
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: eric.niebler at gmail dot com @ 2023-05-09 16:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Bug ID: 109790
Summary: internal compiler error in write_member_name, at
cp/mangle.cc:2992
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric.niebler at gmail dot com
Target Milestone: ---
Created attachment 55032
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55032&action=edit
the result of -freport-bug
Compile the attached test_when_all.i.cpp with:
g++ -std=c++20 -fext-numeric-literals -Wno-non-template-friend \
test_when_all.i.cpp
Result:
In file included from
/home/eniebler/Code/stdexec/include/stdexec/execution.hpp:35,
from
/home/eniebler/Code/stdexec/test/stdexec/algos/adaptors/test_when_all.cpp:18:
/home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp: In
instantiation of ‘constexpr stdexec::__tup::__tuple_for<_Ts ...>
stdexec::__tup::__make_tuple_fn::operator()(_Ts ...) const [with _Ts =
{____C_A_T_C_H____T_E_S_T____24()::<lambda(int, int, int)>}]’:
/home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:284:37:
required from here
/home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:284:37:
internal compiler error: in write_member_name, at cp/mangle.cc:2992
284 | constexpr __tuple_for<_Ts...> operator()(_Ts... __ts) const
| ^~~~~~~~
0x9acf33 write_member_name
../../gcc/cp/mangle.cc:2992
0x9ace8f write_member_name
../../gcc/cp/mangle.cc:2999
0x9ad8ce write_expression
../../gcc/cp/mangle.cc:3668
0x9adecc write_expression
../../gcc/cp/mangle.cc:3592
0x9b290c write_type
../../gcc/cp/mangle.cc:2489
0x9b198c write_template_args
../../gcc/cp/mangle.cc:2966
0x9b7e2f write_nested_name
../../gcc/cp/mangle.cc:1154
0x9b26de write_class_enum_type
../../gcc/cp/mangle.cc:2937
0x9b26de write_type
../../gcc/cp/mangle.cc:2362
0x9b6739 write_bare_function_type
../../gcc/cp/mangle.cc:2856
0x9b699b write_mangled_name
../../gcc/cp/mangle.cc:799
0x9b8827 mangle_decl_string
../../gcc/cp/mangle.cc:4143
0x9b8ac8 get_mangled_id
../../gcc/cp/mangle.cc:4164
0x9b8ac8 mangle_decl(tree_node*)
../../gcc/cp/mangle.cc:4202
0x15934b5 decl_assembler_name(tree_node*)
../../gcc/tree.cc:715
0x15c6d59 assign_assembler_name_if_needed(tree_node*)
../../gcc/tree.cc:830
0xd126f1 cgraph_node::analyze()
../../gcc/cgraphunit.cc:677
0xd15f7a analyze_functions
../../gcc/cgraphunit.cc:1247
0xd170ed symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.cc:2554
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.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
@ 2023-05-09 16:12 ` eric.niebler at gmail dot com
2023-05-09 16:18 ` pinskia at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: eric.niebler at gmail dot com @ 2023-05-09 16:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
--- Comment #1 from Eric Niebler <eric.niebler at gmail dot com> ---
Possible dupe of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100632
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
2023-05-09 16:12 ` [Bug c++/109790] " eric.niebler at gmail dot com
@ 2023-05-09 16:18 ` pinskia at gcc dot gnu.org
2023-05-09 19:39 ` pinskia at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-09 16:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
reducing ...
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
2023-05-09 16:12 ` [Bug c++/109790] " eric.niebler at gmail dot com
2023-05-09 16:18 ` pinskia at gcc dot gnu.org
@ 2023-05-09 19:39 ` pinskia at gcc dot gnu.org
2023-05-09 22:25 ` [Bug c++/109790] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-09 19:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |c++-lambda,
| |ice-on-valid-code
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Eric Niebler from comment #1)
> Possible dupe of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100632
It is unrelated. it seems more lambda related while I am reducing it.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [11/12/13/14 Regression] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (2 preceding siblings ...)
2023-05-09 19:39 ` pinskia at gcc dot gnu.org
@ 2023-05-09 22:25 ` pinskia at gcc dot gnu.org
2023-05-09 22:54 ` mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-09 22:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Target Milestone|--- |11.4
Last reconfirmed| |2023-05-09
Ever confirmed|0 |1
Keywords| |needs-bisection
Known to fail| |10.1.0, 11.1.0, 8.5.0,
| |9.3.0
Summary|internal compiler error in |[11/12/13/14 Regression]
|write_member_name, at |internal compiler error in
|cp/mangle.cc:2992 |write_member_name, at
| |cp/mangle.cc:2992
Known to work| |10.3.0, 10.4.0, 9.4.0,
| |9.5.0
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced:
```
auto ll = [](auto ... ){};
template <class _Impl, class _Args>
void mm(void (_Impl::*__p)(_Args) const);
template <class _Ts>
using __impl_for = decltype(mm(&decltype(ll)::operator()<_Ts>));
template <class _Ts> __impl_for<_Ts> f() { }
void aaa() {
f<int>();
}
```
as far as I can tell the above is valid C++17 code.
It was rejected in 10.1.0, 9.3.0 8.5.0 and started to ICE in 11.1.0. But it was
accepted in 10.3.0 10.4.0 9.5.0 9.4.0.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [11/12/13/14 Regression] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (3 preceding siblings ...)
2023-05-09 22:25 ` [Bug c++/109790] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2023-05-09 22:54 ` mpolacek at gcc dot gnu.org
2023-05-10 7:06 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-05-09 22:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|needs-bisection |
CC| |mpolacek at gcc dot gnu.org
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
In GCC 11, the code in comment 4 started to be accepted with r11-2420:
commit 2c58f5cadfac338a67723fd6e41c9097760c4a33
Author: Patrick Palka <ppalka@redhat.com>
Date: Wed Jul 29 22:06:44 2020 -0400
c++: overload sets and placeholder return type [PR64194]
and started to ICE with r11-6301:
commit 027935eec43173a89cd3eeace0b51967288ac075
Author: Jason Merrill <jason@redhat.com>
Date: Mon Dec 21 17:31:16 2020 -0500
c++: Add some asserts in mangle.c
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [11/12/13/14 Regression] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (4 preceding siblings ...)
2023-05-09 22:54 ` mpolacek at gcc dot gnu.org
@ 2023-05-10 7:06 ` rguenth at gcc dot gnu.org
2023-05-16 12:33 ` ppalka at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-10 7:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [11/12/13/14 Regression] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (5 preceding siblings ...)
2023-05-10 7:06 ` rguenth at gcc dot gnu.org
@ 2023-05-16 12:33 ` ppalka at gcc dot gnu.org
2023-05-29 10:08 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-05-16 12:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Here's a non-lambda version that ICEs in the same spot:
struct A {
template<class T> void operator+(T);
};
template<class T>
decltype(&A::operator+<T>) f();
int main() {
f<int>();
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [11/12/13/14 Regression] internal compiler error in write_member_name, at cp/mangle.cc:2992
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (6 preceding siblings ...)
2023-05-16 12:33 ` ppalka at gcc dot gnu.org
@ 2023-05-29 10:08 ` jakub at gcc dot gnu.org
2024-07-19 13:20 ` [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mange operators and their ptmf rguenth at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.4 |11.5
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mange operators and their ptmf
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (7 preceding siblings ...)
2023-05-29 10:08 ` jakub at gcc dot gnu.org
@ 2024-07-19 13:20 ` rguenth at gcc dot gnu.org
2024-09-11 10:29 ` simartin at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-07-19 13:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.5 |12.5
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11 branch is being closed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mange operators and their ptmf
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (8 preceding siblings ...)
2024-07-19 13:20 ` [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mange operators and their ptmf rguenth at gcc dot gnu.org
@ 2024-09-11 10:29 ` simartin at gcc dot gnu.org
2024-09-23 13:06 ` [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mangle " cvs-commit at gcc dot gnu.org
2024-09-23 13:09 ` simartin at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-09-11 10:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Simon Martin <simartin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |simartin at gcc dot gnu.org
--- Comment #9 from Simon Martin <simartin at gcc dot gnu.org> ---
Working on this one.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mangle operators and their ptmf
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (9 preceding siblings ...)
2024-09-11 10:29 ` simartin at gcc dot gnu.org
@ 2024-09-23 13:06 ` cvs-commit at gcc dot gnu.org
2024-09-23 13:09 ` simartin at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-09-23 13:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simartin@gcc.gnu.org>:
https://gcc.gnu.org/g:a030fcad4f9f490a08db0a4cad4c22635a0585c1
commit r15-3797-ga030fcad4f9f490a08db0a4cad4c22635a0585c1
Author: Simon Martin <simon@nasilyan.com>
Date: Mon Sep 16 13:45:32 2024 +0200
c++: Don't crash when mangling member with anonymous union or template type
[PR100632, PR109790]
We currently crash upon mangling members that have an anonymous union or
a template operator type.
The problem is that before calling write_unqualified_name,
write_member_name asserts that it has a declaration whose DECL_NAME is
an identifier node that is not that of an operator. This is wrong:
- In PR100632, it's an anonymous union declaration, hence a 0 DECL_NAME
- In PR109790, it's a legitimate template declaration for an operator
(this was accepted up to GCC 10)
This assert was added via r11-6301, to be sure that we do write the "on"
marker for operator members.
This patch removes that assert and instead
- Lets members with an anonymous union type go through
- For operators, adds the missing "on" marker for ABI versions greater
than the highest usable with GCC 10
PR c++/109790
PR c++/100632
gcc/cp/ChangeLog:
* mangle.cc (write_member_name): Handle members whose type is an
anonymous union member. Write missing "on" marker for operators
when ABI version is at least 16.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/decltype83.C: New test.
* g++.dg/cpp0x/decltype83a.C: New test.
* g++.dg/cpp1y/lambda-ice3.C: New test.
* g++.dg/cpp1y/lambda-ice3a.C: New test.
* g++.dg/cpp2a/nontype-class67.C: New test.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mangle operators and their ptmf
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
` (10 preceding siblings ...)
2024-09-23 13:06 ` [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mangle " cvs-commit at gcc dot gnu.org
@ 2024-09-23 13:09 ` simartin at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-09-23 13:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109790
Simon Martin <simartin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
Target Milestone|12.5 |15.0
--- Comment #11 from Simon Martin <simartin at gcc dot gnu.org> ---
Fixed in GCC 15.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2024-09-23 13:09 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09 16:11 [Bug c++/109790] New: internal compiler error in write_member_name, at cp/mangle.cc:2992 eric.niebler at gmail dot com
2023-05-09 16:12 ` [Bug c++/109790] " eric.niebler at gmail dot com
2023-05-09 16:18 ` pinskia at gcc dot gnu.org
2023-05-09 19:39 ` pinskia at gcc dot gnu.org
2023-05-09 22:25 ` [Bug c++/109790] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-05-09 22:54 ` mpolacek at gcc dot gnu.org
2023-05-10 7:06 ` rguenth at gcc dot gnu.org
2023-05-16 12:33 ` ppalka at gcc dot gnu.org
2023-05-29 10:08 ` jakub at gcc dot gnu.org
2024-07-19 13:20 ` [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mange operators and their ptmf rguenth at gcc dot gnu.org
2024-09-11 10:29 ` simartin at gcc dot gnu.org
2024-09-23 13:06 ` [Bug c++/109790] [12/13/14/15 Regression] ICE while trying to mangle " cvs-commit at gcc dot gnu.org
2024-09-23 13:09 ` simartin 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).