try/finally improvement

Per Bothner per@bothner.com
Tue Jul 23 11:20:00 GMT 2002


Richard Henderson wrote:
> Changes try/finally to only use the control-flow-destroying
> GOTO_SUBROUTINE_EXPR when there is no other alternative.  We
> much prefer to simply re-expand the finally block in all the
> places it must be invoked.

The finally block could be a substantial block of code.  So
I assume that re-expanding the finally block is not done when
optimizing for space?

Also, re-expanding the finally block complicates setting breakpoints,
so you probably don't want to do it when compiling with -O0 or -O1.
In principle the descision to re-expand the finally block is
similar to whether to whether to inline functions, and so should
depend on various factors, including the size of the inlined
function (i.e. finally block).

(You've probably thought about these issues; I'm just making sure.)
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Gcc-patches mailing list