This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81147] [avr] C++ for -mmcu=atmega2560 doesn't do NRVO or RVO when class inherits from empty base
- From: "felipe at expertisesolutions dot com.br" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Jul 2017 20:17:18 +0000
- Subject: [Bug c++/81147] [avr] C++ for -mmcu=atmega2560 doesn't do NRVO or RVO when class inherits from empty base
- Auto-submitted: auto-generated
- References: <bug-81147-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81147
--- Comment #6 from Felipe Magno de Almeida <felipe at expertisesolutions dot com.br> ---
NRVO: Named Return Value Optimization
RVO: Return Value Optiomization
It is the eliminiation of copying when returning objects by value (or passed
by-value as parameters for rvalues).
The assembly shows copying from return values and/or parameters for avr gcc
which do not happen for x86, but only when the type inherits from other
classes, even if the base class is empty. This restriction doesn't happen with
x86-64 backend.
Regards,