[PATCH] Simplify initial RTL for loops

Roger Sayle roger@www.eyesopen.com
Wed Jan 15 06:02:00 GMT 2003


On Tue, 14 Jan 2003, Zack Weinberg wrote:
> Roger Sayle <roger@www.eyesopen.com> writes:
> >   genrtl_while_stmt (t)
> >        tree t;
> >   {
> > !   tree cond;
> >     emit_nop ();
>
> Hmm, what is the point of that emit_nop()?  Why do we even have
> such a thing?

I think the clue is that the only uses of emit_nop are in
c-semantics.c, and all four instances are immediately followed
by a call to emit_line_note.  Perhaps at some point in the
past emit_line_note attached the line number information to
the last/previous instruction.  The implementation of emit_nop
in stmt.c certainly looks bizarre enough!

> void
> emit_nop ()
> {
>   rtx last_insn;
>
>   last_insn = get_last_insn ();
>   if (!optimize
>       && (GET_CODE (last_insn) == CODE_LABEL
>           || (GET_CODE (last_insn) == NOTE
>               && prev_real_insn (last_insn) == 0)))
>     emit_insn (gen_nop ());
> }


Like Zack, I too would be interested in hearing from anyone
that understands (the history of) this code.  Is it safe to
just delete this function, and its 4 uses in c-semantics.c?

Roger
--



More information about the Gcc-patches mailing list