public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default
@ 2022-07-19 22:15 leo at adberg dot com
2022-07-19 22:19 ` [Bug c++/106361] " pinskia at gcc dot gnu.org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: leo at adberg dot com @ 2022-07-19 22:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
Bug ID: 106361
Summary: Internal compiler error when creating an out-of-line
operator==() = default
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: leo at adberg dot com
Target Milestone: ---
I was trying to define a default equality operator out of line for a struct
that contains a member without an equality operator. Clang errors with the
correct reason because it shouldn't be possible:
"defaulted 'operator==' is implicitly deleted because there is no viable
three-way comparison function for member 'f'"
GCC 11.1 correctly errors too, but 11.2 and above all crash with an internal
compiler error. See the example here: https://godbolt.org/z/WcbTaGonK
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
@ 2022-07-19 22:19 ` pinskia at gcc dot gnu.org
2022-07-19 22:21 ` [Bug c++/106361] [11/12/13 Regression] " pinskia at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-19 22:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 53320
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53320&action=edit
testcase
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
2022-07-19 22:19 ` [Bug c++/106361] " pinskia at gcc dot gnu.org
@ 2022-07-19 22:21 ` pinskia at gcc dot gnu.org
2022-07-19 22:22 ` pinskia at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-19 22:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Last reconfirmed| |2022-07-19
Target Milestone|--- |11.4
Ever confirmed|0 |1
Known to fail| |11.2.0, 12.1.0
Summary|Internal compiler error |[11/12/13 Regression]
|when creating an |Internal compiler error
|out-of-line operator==() = |when creating an
|default |out-of-line operator==() =
| |default
Known to work| |11.1.0
Status|UNCONFIRMED |NEW
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Please next time, either put the testcase inline or attach it.
Having a goldbolt link is not enough.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
2022-07-19 22:19 ` [Bug c++/106361] " pinskia at gcc dot gnu.org
2022-07-19 22:21 ` [Bug c++/106361] [11/12/13 Regression] " pinskia at gcc dot gnu.org
@ 2022-07-19 22:22 ` pinskia at gcc dot gnu.org
2022-07-19 22:24 ` leo at adberg dot com
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-19 22:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The ICE is:
<source>: In function 'int main()':
<source>:13:25: internal compiler error: in move_fn_p, at cp/decl.cc:15025
13 | return bar{} == bar{};
| ^
0x221f229 internal_error(char const*, ...)
???:0
0x74c10d fancy_abort(char const*, int, char const*)
???:0
0x82c49a move_fn_p(tree_node const*)
???:0
0x7801be build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
???:0
0xa8c9d1 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
???:0
0x99690d c_parse_file()
???:0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
` (2 preceding siblings ...)
2022-07-19 22:22 ` pinskia at gcc dot gnu.org
@ 2022-07-19 22:24 ` leo at adberg dot com
2022-07-19 22:25 ` mpolacek at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: leo at adberg dot com @ 2022-07-19 22:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
--- Comment #4 from Leo Adberg <leo at adberg dot com> ---
(In reply to Andrew Pinski from comment #2)
> Confirmed. Please next time, either put the testcase inline or attach it.
> Having a goldbolt link is not enough.
Will do next time! Sorry, first time here.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
` (3 preceding siblings ...)
2022-07-19 22:24 ` leo at adberg dot com
@ 2022-07-19 22:25 ` mpolacek at gcc dot gnu.org
2022-07-19 22:25 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-07-19 22:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
No worries, thanks for the report (and the reduced test).
Started with r12-885-gf71ca97def69b8ae.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
` (4 preceding siblings ...)
2022-07-19 22:25 ` mpolacek at gcc dot gnu.org
@ 2022-07-19 22:25 ` pinskia at gcc dot gnu.org
2022-07-21 21:21 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-19 22:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Duplicate of bug 106202.
*** This bug has been marked as a duplicate of bug 106202 ***
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
` (5 preceding siblings ...)
2022-07-19 22:25 ` pinskia at gcc dot gnu.org
@ 2022-07-21 21:21 ` cvs-commit at gcc dot gnu.org
2022-07-21 21:23 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-21 21:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
--- Comment #7 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:28be481cf47d52af8b11972d2394226bbaf87867
commit r13-1784-g28be481cf47d52af8b11972d2394226bbaf87867
Author: Jason Merrill <jason@redhat.com>
Date: Wed Jul 20 20:00:58 2022 -0400
c++: defaulted friend op== [PR106361]
Now non-member functions can be defaulted, so this assert is wrong.
move_signature_fn_p already checks for ctor or op=.
PR c++/106361
gcc/cp/ChangeLog:
* decl.cc (move_fn_p): Remove assert.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/spaceship-eq14.C: New test.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
` (6 preceding siblings ...)
2022-07-21 21:21 ` cvs-commit at gcc dot gnu.org
@ 2022-07-21 21:23 ` cvs-commit at gcc dot gnu.org
2022-07-22 5:40 ` cvs-commit at gcc dot gnu.org
2023-01-06 16:06 ` ppalka at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-21 21:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:707bc64fbeecf8a10f7aad103534b6999e9d190c
commit r12-8607-g707bc64fbeecf8a10f7aad103534b6999e9d190c
Author: Jason Merrill <jason@redhat.com>
Date: Wed Jul 20 20:00:58 2022 -0400
c++: defaulted friend op== [PR106361]
Now non-member functions can be defaulted, so this assert is wrong.
move_signature_fn_p already checks for ctor or op=.
PR c++/106361
gcc/cp/ChangeLog:
* decl.cc (move_fn_p): Remove assert.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/spaceship-eq14.C: New test.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
` (7 preceding siblings ...)
2022-07-21 21:23 ` cvs-commit at gcc dot gnu.org
@ 2022-07-22 5:40 ` cvs-commit at gcc dot gnu.org
2023-01-06 16:06 ` ppalka at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-22 5:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
--- Comment #9 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:1503d946c06e2005c860f56231d2ea582a8a340f
commit r11-10160-g1503d946c06e2005c860f56231d2ea582a8a340f
Author: Jason Merrill <jason@redhat.com>
Date: Wed Jul 20 20:00:58 2022 -0400
c++: defaulted friend op== [PR106361]
Now non-member functions can be defaulted, so this assert is wrong.
move_signature_fn_p already checks for ctor or op=.
PR c++/106361
gcc/cp/ChangeLog:
* decl.c (move_fn_p): Remove assert.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/spaceship-eq14.C: New test.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/106361] [11/12/13 Regression] Internal compiler error when creating an out-of-line operator==() = default
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
` (8 preceding siblings ...)
2022-07-22 5:40 ` cvs-commit at gcc dot gnu.org
@ 2023-01-06 16:06 ` ppalka at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-01-06 16:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106361
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pacoarjonilla at yahoo dot es
--- Comment #10 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 93527 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-01-06 16:06 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 22:15 [Bug c++/106361] New: Internal compiler error when creating an out-of-line operator==() = default leo at adberg dot com
2022-07-19 22:19 ` [Bug c++/106361] " pinskia at gcc dot gnu.org
2022-07-19 22:21 ` [Bug c++/106361] [11/12/13 Regression] " pinskia at gcc dot gnu.org
2022-07-19 22:22 ` pinskia at gcc dot gnu.org
2022-07-19 22:24 ` leo at adberg dot com
2022-07-19 22:25 ` mpolacek at gcc dot gnu.org
2022-07-19 22:25 ` pinskia at gcc dot gnu.org
2022-07-21 21:21 ` cvs-commit at gcc dot gnu.org
2022-07-21 21:23 ` cvs-commit at gcc dot gnu.org
2022-07-22 5:40 ` cvs-commit at gcc dot gnu.org
2023-01-06 16:06 ` 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).