This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/30590] [4.1/4.2/4.3 Regression] tree-nrv optimization clobbers return variable
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Feb 2007 01:54:53 -0000
- Subject: [Bug tree-optimization/30590] [4.1/4.2/4.3 Regression] tree-nrv optimization clobbers return variable
- References: <bug-30590-1501@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pinskia at gcc dot gnu dot org 2007-02-04 01:54 -------
> + @@@ This is a kludge. Should look into removing the NRV
> + optimization from the C++ front end for GCC 4.3. */
You can't because the NVR optimization in the front-end also removes the copy
constructor call if would have been called. The question is how do you remove
the copy constructor after optimizations have might inlined it. Unless you do
NVR before any other optimization might have happened.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30590