[Bug tree-optimization/86050] Inline break tail-call optimization
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 5 08:47:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86050
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-06-05
Ever confirmed|0 |1
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. It is because the address of 'value' escapes which is easier to
see when you instead do
static void __attribute__((noinline)) stackConsume(const char*stack){
char value;
__builtin_putchar ((long)&value);
}
this then causes us to hit
/* Make sure the tail invocation of this function does not indirectly
refer to local variables. (Passing variables directly by value
is OK.) */
FOR_EACH_LOCAL_DECL (cfun, idx, var)
{
if (TREE_CODE (var) != PARM_DECL
&& auto_var_in_fn_p (var, cfun->decl)
&& may_be_aliased (var)
&& (ref_maybe_used_by_stmt_p (call, var)
|| call_may_clobber_ref_p (call, var)))
return;
}
where we think that the recursive call might possibly access that very
escaped stack slot (for example via a global pointer). We do not have
sophisticated enough analysis to fix that easily.
More information about the Gcc-bugs
mailing list