d: Inline bounds checking for simple array assignments.
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 19 Jul 2020 13:18:08 +0000 (15:18 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 30 Jul 2020 16:02:59 +0000 (18:02 +0200)
commitfebd7c43bce0a305aa24ed214ea6a5cba69753dd
treee8ccc50f5a38f3ab0d85756c5b235a0830b74d5b
parentab0edbcb371cce5f82136f20ad45155c003d4982
d: Inline bounds checking for simple array assignments.

This optimizes the code generation of simple array assignments, inlining
the array bounds checking code so there is no reliance on the library
routine _d_arraycopy(), which also deals with postblit and copy
constructors for non-trivial arrays.

gcc/d/ChangeLog:

* expr.cc (ExprVisitor::visit (AssignExp *)): Inline bounds checking
for simple array assignments.

gcc/testsuite/ChangeLog:

* gdc.dg/array1.d: New test.
gcc/d/expr.cc
gcc/testsuite/gdc.dg/array1.d [new file with mode: 0644]