diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-07-03 02:42:14 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-07-03 13:00:56 +0200 |
commit | 152f4d0e4d3b524ce30d05f20e23a44b0dd29765 (patch) | |
tree | 305b63554a1557882c9258852a71e97706044670 /gcc/expr.c | |
parent | 7a60a6e8b36dec960939494baef0f1f15dbfc450 (diff) | |
download | gcc-152f4d0e4d3b524ce30d05f20e23a44b0dd29765.zip gcc-152f4d0e4d3b524ce30d05f20e23a44b0dd29765.tar.gz gcc-152f4d0e4d3b524ce30d05f20e23a44b0dd29765.tar.bz2 |
d: Missed RVO optimization with non-POD structs
The D front-end semantic pass sometimes declares a temporary inside a
return expression. This is now detected with the RESULT_DECL replacing
the temporary, allowing for RVO to be done.
PR d/101273
gcc/d/ChangeLog:
* toir.cc (IRVisitor::visit (ReturnStatement *)): Detect returns that
use a temporary, and replace with return value.
gcc/testsuite/ChangeLog:
* gdc.dg/torture/pr101273.d: New test.
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions