public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2620] d: Clarify comment for generating static array assignment with literal.
@ 2021-07-30 10:56 Iain Buclaw
0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2021-07-30 10:56 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c18db639a31b9d651b3b997fee331106b25789ef
commit r12-2620-gc18db639a31b9d651b3b997fee331106b25789ef
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Mon Jul 26 19:22:48 2021 +0200
d: Clarify comment for generating static array assignment with literal.
The code block is done as an optimization to elide a call to the runtime
library helpers _d_arrayctor or _d_arrayassign.
gcc/d/ChangeLog:
* expr.cc (ExprVisitor::visit (AssignExp *)): Clarify comment
for generating static array assignment with literal.
Diff:
---
gcc/d/expr.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index 85269c6b2be..76c1e613e77 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -1163,9 +1163,9 @@ public:
bool destructor = needs_dtor (etype);
bool lvalue = lvalue_p (e->e2);
- /* Even if the elements in rhs are all rvalues and don't have
- to call postblits, this assignment should call dtors on old
- assigned elements. */
+ /* Optimize static array assignment with array literal. Even if the
+ elements in rhs are all rvalues and don't have to call postblits,
+ this assignment should call dtors on old assigned elements. */
if ((!postblit && !destructor)
|| (e->op == TOKconstruct && e->e2->op == TOKarrayliteral)
|| (e->op == TOKconstruct && !lvalue && postblit)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-30 10:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 10:56 [gcc r12-2620] d: Clarify comment for generating static array assignment with literal Iain Buclaw
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).