public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685
@ 2023-03-31 10:47 kgledits at cisco dot com
2023-03-31 17:00 ` [Bug c++/109357] [12/13 Regression] " xry111 at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: kgledits at cisco dot com @ 2023-03-31 10:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
Bug ID: 109357
Summary: GCC 13.0.1: internal compiler error in
cp/constexpr.cc:1685
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kgledits at cisco dot com
Target Milestone: ---
Created attachment 54797
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54797&action=edit
C++ file triggering internal compiler error
See also https://godbolt.org/z/obn7vvjje . Using the attached CPP file:
====
$ g++ --version
g++ (GCC) 13.0.1 20230318 (Red Hat 13.0.1-0)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ -std=c++20 -O2 -o - input-reduced.cpp
input-reduced.cpp: In destructor ‘s2::~s2()’:
input-reduced.cpp:15:19: warning: ISO C++ forbids converting a string constant
to ‘char*’ [-Wwrite-strings]
15 | s2::~s2() { s1 = {"", ""}; }
| ^~
input-reduced.cpp:15:23: warning: ISO C++ forbids converting a string constant
to ‘char*’ [-Wwrite-strings]
15 | s2::~s2() { s1 = {"", ""}; }
| ^~
input-reduced.cpp: In destructor ‘s2::~s2()’:
input-reduced.cpp:15:28: internal compiler error: in adjust_temp_type, at
cp/constexpr.cc:1685
15 | s2::~s2() { s1 = {"", ""}; }
| ^
Please submit a full bug report, with preprocessed source.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccN3KzRp.out file, please attach this to
your bugreport.
====
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/109357] [12/13 Regression] internal compiler error in cp/constexpr.cc:1685
2023-03-31 10:47 [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685 kgledits at cisco dot com
@ 2023-03-31 17:00 ` xry111 at gcc dot gnu.org
2023-03-31 17:11 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-03-31 17:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
Xi Ruoyao <xry111 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.3
Known to work| |11.3.0
CC| |xry111 at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-03-31
Ever confirmed|0 |1
Summary|GCC 13.0.1: internal |[12/13 Regression] internal
|compiler error in |compiler error in
|cp/constexpr.cc:1685 |cp/constexpr.cc:1685
Known to fail| |12.2.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/109357] [12/13 Regression] internal compiler error in cp/constexpr.cc:1685
2023-03-31 10:47 [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685 kgledits at cisco dot com
2023-03-31 17:00 ` [Bug c++/109357] [12/13 Regression] " xry111 at gcc dot gnu.org
@ 2023-03-31 17:11 ` jakub at gcc dot gnu.org
2023-04-15 2:25 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-31 17:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r12-6329-g4f6bc28fc7dd86bd9e7408cbf
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/109357] [12/13 Regression] internal compiler error in cp/constexpr.cc:1685
2023-03-31 10:47 [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685 kgledits at cisco dot com
2023-03-31 17:00 ` [Bug c++/109357] [12/13 Regression] " xry111 at gcc dot gnu.org
2023-03-31 17:11 ` jakub at gcc dot gnu.org
@ 2023-04-15 2:25 ` jason at gcc dot gnu.org
2023-04-15 16:35 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2023-04-15 2:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/109357] [12/13 Regression] internal compiler error in cp/constexpr.cc:1685
2023-03-31 10:47 [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685 kgledits at cisco dot com
` (2 preceding siblings ...)
2023-04-15 2:25 ` jason at gcc dot gnu.org
@ 2023-04-15 16:35 ` cvs-commit at gcc dot gnu.org
2023-04-18 20:46 ` [Bug c++/109357] [12 " jason at gcc dot gnu.org
2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-15 16:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:13669741e673fa6a7b7c8d68f992e58ecd393160
commit r13-7193-g13669741e673fa6a7b7c8d68f992e58ecd393160
Author: Jason Merrill <jason@redhat.com>
Date: Fri Apr 14 22:40:43 2023 -0400
c++: constexpr aggregate destruction [PR109357]
We were assuming that the result of evaluation of TARGET_EXPR_INITIAL would
always be the new value of the temporary, but that's not necessarily true
when the initializer is complex (i.e. target_expr_needs_replace). In that
case evaluating the initializer initializes the temporary as a side-effect.
PR c++/109357
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_constant_expression) [TARGET_EXPR]:
Check for complex initializer.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/constexpr-dtor15.C: New test.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/109357] [12 Regression] internal compiler error in cp/constexpr.cc:1685
2023-03-31 10:47 [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685 kgledits at cisco dot com
` (3 preceding siblings ...)
2023-04-15 16:35 ` cvs-commit at gcc dot gnu.org
@ 2023-04-18 20:46 ` jason at gcc dot gnu.org
2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2023-04-18 20:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 12.3/13.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/109357] [12 Regression] internal compiler error in cp/constexpr.cc:1685
2023-03-31 10:47 [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685 kgledits at cisco dot com
` (4 preceding siblings ...)
2023-04-18 20:46 ` [Bug c++/109357] [12 " jason at gcc dot gnu.org
@ 2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-18 20:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
--- Comment #4 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:618b90f5688fa7c0923a3e07a0741c6ede0e6e4e
commit r12-9445-g618b90f5688fa7c0923a3e07a0741c6ede0e6e4e
Author: Jason Merrill <jason@redhat.com>
Date: Fri Apr 14 22:40:43 2023 -0400
c++: constexpr aggregate destruction [PR109357]
We were assuming that the result of evaluation of TARGET_EXPR_INITIAL would
always be the new value of the temporary, but that's not necessarily true
when the initializer is complex (i.e. target_expr_needs_replace). In that
case evaluating the initializer initializes the temporary as a side-effect.
PR c++/109357
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_constant_expression) [TARGET_EXPR]:
Check for complex initializer.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/constexpr-dtor15.C: New test.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-04-18 20:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 10:47 [Bug c++/109357] New: GCC 13.0.1: internal compiler error in cp/constexpr.cc:1685 kgledits at cisco dot com
2023-03-31 17:00 ` [Bug c++/109357] [12/13 Regression] " xry111 at gcc dot gnu.org
2023-03-31 17:11 ` jakub at gcc dot gnu.org
2023-04-15 2:25 ` jason at gcc dot gnu.org
2023-04-15 16:35 ` cvs-commit at gcc dot gnu.org
2023-04-18 20:46 ` [Bug c++/109357] [12 " jason at gcc dot gnu.org
2023-04-18 20:46 ` cvs-commit 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).