This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR41276, PR41307] don't leak VALUEs into VAR_LOCATION NOTEs
On Wed, Sep 09, 2009 at 09:46:07AM +0200, Eric Botcazou wrote:
> > Here's what I'm testing. Ok to install if it passes regtesting?
>
> I think it must be specified whether the return value of the callback is
> expanded again or not. With this latest patch it would be for VALUEs but
> wouldn't for SUBREGs; any possibility to unify that either way?
To me it looks like for VALUEs we expand them twice:
1) the only way how vt_expand_loc_callback returns non-NULL is through:
result = cselib_expand_value_rtx_cb (loc->loc, regs, max_depth,
vt_expand_loc_callback, vars);
result = check_wrap_constant (GET_MODE (loc->loc), result);
if (result)
break;
and then
2) result = evd->callback (orig, evd->regs_active, max_depth,
evd->callback_arg);
if (result == orig)
result = NULL;
else if (result)
result = cselib_expand_value_rtx_1 (result, evd, max_depth);
I wonder what the cselib_expand_value_rtx_1 call is for. If we dropped
this, the return value from the callback wouldn't be expanded again in any
case.
Jakub