This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13044] Calls to stack object destructors should be merged for multiple return points
- From: "bryner at brianryner dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Nov 2003 02:59:30 -0000
- Subject: [Bug optimization/13044] Calls to stack object destructors should be merged for multiple return points
- References: <20031114023320.13044.bryner@brianryner.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bryner at brianryner dot com 2003-11-14 02:59 -------
Created an attachment (id=5132)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5132&action=view)
testcase
Compiled with:
c++ -Os -fno-exceptions -c -o early_return_optimize.o early_return_optimize.cpp
using a gcc trunk build from Oct. 27.
I'll attach the generated assembly next, but to summarize: in earlyReturn1(), a
call to ~A() is generated for each |return|. It could equivalently generate
the code in earlyReturn2(), which is 8 bytes smaller.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13044