This is the mail archive of the
mailing list for the GCC project.
Re: [tree0ssa] Dead const/pure function removal take II
> On Tue, 2003-11-11 at 13:42, Jan Hubicka wrote:
> > > On Tue, 2003-11-11 at 12:31, Jan Hubicka wrote:
> > >
> > > > * gimplify.c (gimplify_call_expr): Unset side effects for
> > > > pure functions too.
> > > > * tree-cfg.c (update-call_expr_flags): New function.
> > > > (remove_useless_stmts_and_vars_1): Use it.
> > > > (is_ctrl_altering_stmt): Pure/const calls enver alter.
> > > >
> > > I can't parse this last entry.
> > We was thinking that pure/const call may do nonlocal GOTO and aborted on
> > attempt to remove it.
> > Perhaps it should say Pure/const calls never alter CFG?
> Oh! enver = never? Now I get it. Yes, 'pure/const calls never alter
> the CFG' is a bit more clear.
This actually brought me into investigating why I needed to fix this to
get libgcc built (it should have no nonlocal gotos).
It fails because normal goto gets flagged so in gimplification:
/* If this label is in a different context (function), then
mark it as a nonlocal label and mark its context as
receiving nonlocal gotos. */
tree context = decl_function_context (dest);
if (current_function_decl != context)
NONLOCAL_LABEL (dest) = 1;
FUNCTION_RECEIVES_NONLOCAL_GOTO (context) = 1;
Expand goto checks:
/* Check for a nonlocal goto to a containing function. */
context = decl_function_context (label);
if (context != 0 && context != current_function_decl)
So perhaps we need context != 0 too? HOw it can happen to have context