Re: [patch] Reuse non-gimple_reg variable for inlining

2021-06-09 Thread Richard Biener
On Wed, 9 Jun 2021, Eric Botcazou wrote: > > I'm afraid the inliner would need to prove the to be inlined callee doesn't > > modify its own copy of the variable too, because if it modifies it (at least > > in C/C++ const can be cast away), then this introduces wrong-code, see > > PR100994 for deta

Re: [patch] Reuse non-gimple_reg variable for inlining

2021-06-09 Thread Eric Botcazou
> I'm afraid the inliner would need to prove the to be inlined callee doesn't > modify its own copy of the variable too, because if it modifies it (at least > in C/C++ const can be cast away), then this introduces wrong-code, see > PR100994 for details. Then please remove the TREE_READONLY marker

Re: [patch] Reuse non-gimple_reg variable for inlining

2021-06-09 Thread Jakub Jelinek via Gcc-patches
On Mon, May 03, 2021 at 10:04:20AM +0200, Eric Botcazou wrote: > Hi, > > when a call to a function is inlined and takes a parameter whose type is not > gimple_reg, a variable is created in the caller to hold a copy of the argument > passed in the call with the following comment: > > /* We m

Re: [patch] Reuse non-gimple_reg variable for inlining

2021-05-04 Thread Richard Biener via Gcc-patches
On Mon, May 3, 2021 at 5:06 PM Eric Botcazou wrote: > > > Hmm, instead of (ab-)using debug_map can we instead use sth like setting > > TREE_VISITED on the argument decl (not the value - it might be passed > > multiple tiimes)? IIRC TREE_VISITED state is undetermined thus we can > > clear it at th

Re: [patch] Reuse non-gimple_reg variable for inlining

2021-05-03 Thread Eric Botcazou
> Hmm, instead of (ab-)using debug_map can we instead use sth like setting > TREE_VISITED on the argument decl (not the value - it might be passed > multiple tiimes)? IIRC TREE_VISITED state is undetermined thus we can > clear it at the start of setup_one_parameter and set it when we want to > avo

Re: [patch] Reuse non-gimple_reg variable for inlining

2021-05-03 Thread Richard Biener via Gcc-patches
On Mon, May 3, 2021 at 11:02 AM Eric Botcazou wrote: > > Hi, > > when a call to a function is inlined and takes a parameter whose type is not > gimple_reg, a variable is created in the caller to hold a copy of the argument > passed in the call with the following comment: > > /* We may produc