[Bug optimization/13044] Calls to stack object destructors should be merged for multiple return points
bryner at brianryner dot com
gcc-bugzilla@gcc.gnu.org
Fri Nov 14 02:59:00 GMT 2003
------- 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
More information about the Gcc-bugs
mailing list