Re: [PATCH] Improve stack variable reuse with inlining with exceptions (PR tree-optimization/86214)

2019-01-18 Thread Richard Biener
On Fri, 18 Jan 2019, Jakub Jelinek wrote: > On Thu, Jan 17, 2019 at 03:43:05PM +0100, Jakub Jelinek wrote: > > > So we do not care to optimize this to only clobber the vars that > > > are appear live over the EH edge? > > > > Wouldn't that be quite expensive (especially at that spot in the inline

Re: [PATCH] Improve stack variable reuse with inlining with exceptions (PR tree-optimization/86214)

2019-01-18 Thread Jakub Jelinek
On Thu, Jan 17, 2019 at 03:43:05PM +0100, Jakub Jelinek wrote: > > So we do not care to optimize this to only clobber the vars that > > are appear live over the EH edge? > > Wouldn't that be quite expensive (especially at that spot in the inliner)? > I could surely defer that (at the spot in copy_

Re: [PATCH] Improve stack variable reuse with inlining with exceptions (PR tree-optimization/86214)

2019-01-17 Thread Jakub Jelinek
On Thu, Jan 17, 2019 at 03:06:57PM +0100, Richard Biener wrote: > > + tree new_var = *t; > > + if (VAR_P (new_var) > > + && !DECL_HARD_REGISTER (new_var) > > + && !TREE_THIS_VOLATILE (new_var) > > + && !DECL_HAS_VALUE_EXPR_P (new_var) > > + && !is_gimple_reg (new_var) >

Re: [PATCH] Improve stack variable reuse with inlining with exceptions (PR tree-optimization/86214)

2019-01-17 Thread Richard Biener
On Thu, 17 Jan 2019, Jakub Jelinek wrote: > Hi! > > As the following testcases show, we are unable to share stack slots > for (large) variables from inline functions if something in those inline > functions can throw externally. > > The issue is that the clobbers we have even in the EH paths > a

[PATCH] Improve stack variable reuse with inlining with exceptions (PR tree-optimization/86214)

2019-01-17 Thread Jakub Jelinek
Hi! As the following testcases show, we are unable to share stack slots for (large) variables from inline functions if something in those inline functions can throw externally. The issue is that the clobbers we have even in the EH paths are usually removed by ehcleanup1 which attempts to make the