Question about apparently obsolete comment in gcse.c

Steven Bosscher stevenb@suse.de
Mon Jun 7 10:32:00 GMT 2004


Hi,

Here's something interesting I found while trying to understand the following
code+comment in gcse.c:compute_transpout():

  FOR_EACH_BB (bb)
    {
      /* Note that flow inserted a nop a the end of basic blocks that
         end in call instructions for reasons other than abnormal
         control flow.  */
      if (GET_CODE (BB_END (bb)) != CALL_INSN)
        continue;

This was added by rth in revision 1.64 of flow.c and 1.16 of gcse.c, in
October 1998 (!), along with a hack to the rest of gcc to emit a NOP after
a call that cannot trap (iiuc).

Later, a patch was submitted by Honza to not emit that NOP, but that
patch was not approved, or at least I can't find where it was approved
(cf. http://gcc.gnu.org/ml/gcc-patches/2001-07/msg00403.html).
In any case, that patch shows up in CVS in flow.c revision 1.420.

I don't know if the same objections against the patch are still relevant, but
it would be interesting to find out (unfortunately Honza is offline...).  For example.
should gcse, in the code mentioned above, be looking at the successors of bb
and do nothing if there are no abnormal edges there?

Gr.
Steven






More information about the Gcc mailing list