public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain Buclaw <ibuclaw@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-2620] d: Clarify comment for generating static array assignment with literal.
Date: Fri, 30 Jul 2021 10:56:16 +0000 (GMT)	[thread overview]
Message-ID: <20210730105616.BC968393D017@sourceware.org> (raw)

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)


                 reply	other threads:[~2021-07-30 10:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210730105616.BC968393D017@sourceware.org \
    --to=ibuclaw@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).