[PATCH] Optimize away unnecessary clobbers (PR tree-optimization/51117)

Jakub Jelinek jakub@redhat.com
Fri Dec 9 00:01:00 GMT 2011


On Thu, Dec 08, 2011 at 03:53:40PM -0800, Richard Henderson wrote:
> On 12/08/2011 11:57 AM, Jakub Jelinek wrote:
> > +      else if (gimple_code (last) == GIMPLE_RETURN
> > +	       || (gimple_code (last) == GIMPLE_RESX
> > +		   && stmt_can_throw_external (last)))
> > +	optimize_clobbers (bb);
> 
> If you need to do this for returns as well as resx, then
> this is the wrong place, since we'll only get here if there
> are exception regions in the current function.

I don't need to do it for returns, on the other side those clobbers
before return are useless and removing them perhaps might decrease
memory consumptions (after collect).

But if you prefer to keep it just for GIMPLE_RESX, fine with me.

It can be done anywhere else after inlining and before ehcleanup2
too if you have suggestions where to do it instead.

	Jakub



More information about the Gcc-patches mailing list