This is the mail archive of the
mailing list for the GCC project.
Re: Questions about tree-cfg.c:remove_forwarder_block.
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc at gcc dot gnu dot org, dvorakz at suse dot cz, law at redhat dot com, stevenb at suse dot de
- Date: Tue, 18 Jan 2005 16:52:23 +0100
- Subject: Re: Questions about tree-cfg.c:remove_forwarder_block.
- References: <email@example.com>
> tree-cfg.c:remove_forwarder_block contains
> /* If the destination block consists of an nonlocal label, do not merge
> it. */
> label = first_stmt (bb);
> if (label
> && TREE_CODE (label) == LABEL_EXPR
> && DECL_NONLOCAL (LABEL_EXPR_LABEL (label)))
> return false;
> 1) Is a nonlocal label guaranteed to be the first statement?
I think it is the case (see stmt_starts_bb_p).
> If not,
> we need to fix the code above such that it will scan all labels of
> the given basic block, looking for a nonlocal label just like
> 2) Should "first_stmt (bb)" be "first_stmt (dest)? The comment and
> and the code do not agree. Plus, the code as is is completely
> subsumed by tree_forwarder_block_p.
It definitely should be "first_stmt (dest)". The purpose of this piece
of code should have been to prevent nonlocal label to occur in the
middle of the basic block (thus violating the invariant mentioned in 1)
in case we move labels from bb to dest -- which may only happen if there
is an abnormal edge to bb, but no abnormal edge to dest. This I guess
may happen sometimes.