This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree0ssa] Dead const/pure function removal take II
- From: law at redhat dot com
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Diego Novillo <dnovillo at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 11 Nov 2003 14:03:03 -0700
- Subject: Re: [tree0ssa] Dead const/pure function removal take II
- Reply-to: law at redhat dot com
In message <20031111203611.GD1729@kam.mff.cuni.cz>, Jan Hubicka writes:
>> 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
>NULL?
The label should have a context -- if something is creating a label
without a proper context, then that's a bug.
jeff