* [Bug c++/91859] Using destroying delete should not clobber stores to the object
[not found] <bug-91859-4@http.gcc.gnu.org/bugzilla/>
@ 2021-05-20 2:07 ` josephcsible at gmail dot com
2021-05-20 6:29 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: josephcsible at gmail dot com @ 2021-05-20 2:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91859
--- Comment #5 from Joseph C. Sible <josephcsible at gmail dot com> ---
The real problem mentioned in comment 2 still happens as of GCC 11.1. I've
narrowed it down somewhat to the optimization flags "-Og -ftree-dse
-ftree-pta". Removing any one of those will make it behave again.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/91859] Using destroying delete should not clobber stores to the object
[not found] <bug-91859-4@http.gcc.gnu.org/bugzilla/>
2021-05-20 2:07 ` [Bug c++/91859] Using destroying delete should not clobber stores to the object josephcsible at gmail dot com
@ 2021-05-20 6:29 ` redi at gcc dot gnu.org
2021-06-01 15:39 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2021-05-20 6:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91859
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, but those optimizations are just doing what they are designed to do. I
suspect that the bug is due to the front end inserting a CLOBBER that says it's
ok for those optimizations to do that.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/91859] Using destroying delete should not clobber stores to the object
[not found] <bug-91859-4@http.gcc.gnu.org/bugzilla/>
2021-05-20 2:07 ` [Bug c++/91859] Using destroying delete should not clobber stores to the object josephcsible at gmail dot com
2021-05-20 6:29 ` redi at gcc dot gnu.org
@ 2021-06-01 15:39 ` cvs-commit at gcc dot gnu.org
2021-06-01 15:53 ` cvs-commit at gcc dot gnu.org
2021-06-01 16:41 ` jason at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-01 15:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91859
--- 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:cf2b7020ee8e9745ede527b0a3b2e0ffbafd492b
commit r12-1145-gcf2b7020ee8e9745ede527b0a3b2e0ffbafd492b
Author: Jason Merrill <jason@redhat.com>
Date: Fri May 28 17:05:23 2021 -0400
c++: no clobber for C++20 destroying delete [PR91859]
Before C++20 added destroying operator delete, by the time we called
operator delete for a pointer, the object would already be gone. But that
isn't true for destroying delete. Since the optimizers' assumptions about
operator delete are based on either DECL_IS_REPLACEABLE_OPERATOR (which
already is not set) or CALL_FROM_NEW_OR_DELETE_P, let's avoid setting the
latter flag in this case.
PR c++/91859
gcc/ChangeLog:
* tree.h (CALL_FROM_NEW_OR_DELETE_P): Adjust comment.
gcc/cp/ChangeLog:
* call.c (build_op_delete_call): Don't set
CALL_FROM_NEW_OR_DELETE_P
for destroying delete.
* init.c (build_delete): Don't clobber before destroying delete.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/destroying-delete5.C: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/91859] Using destroying delete should not clobber stores to the object
[not found] <bug-91859-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2021-06-01 15:39 ` cvs-commit at gcc dot gnu.org
@ 2021-06-01 15:53 ` cvs-commit at gcc dot gnu.org
2021-06-01 16:41 ` jason at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-01 15:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91859
--- Comment #8 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:ee3edeb01eca1cc8d7ebe777b4adb333f0c1118a
commit r11-8495-gee3edeb01eca1cc8d7ebe777b4adb333f0c1118a
Author: Jason Merrill <jason@redhat.com>
Date: Fri May 28 17:05:23 2021 -0400
c++: no clobber for C++20 destroying delete [PR91859]
Before C++20 added destroying operator delete, by the time we called
operator delete for a pointer, the object would already be gone. But that
isn't true for destroying delete. Since the optimizers' assumptions about
operator delete are based on either DECL_IS_REPLACEABLE_OPERATOR (which
already is not set) or CALL_FROM_NEW_OR_DELETE_P, let's avoid setting the
latter flag in this case.
PR c++/91859
gcc/ChangeLog:
* tree.h (CALL_FROM_NEW_OR_DELETE_P): Adjust comment.
gcc/cp/ChangeLog:
* call.c (build_op_delete_call): Don't set
CALL_FROM_NEW_OR_DELETE_P
for destroying delete.
* init.c (build_delete): Don't clobber before destroying delete.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/destroying-delete5.C: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/91859] Using destroying delete should not clobber stores to the object
[not found] <bug-91859-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2021-06-01 15:53 ` cvs-commit at gcc dot gnu.org
@ 2021-06-01 16:41 ` jason at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2021-06-01 16:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91859
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.2
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 11.2/12.
^ permalink raw reply [flat|nested] 5+ messages in thread