This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Remove unused crossjump code

Steven Bosscher wrote:

Apparently GCC ran crossjumping before reload once, and it was useful
to substitute REG_EQUIV values for registers because it "helps take
care of G++ cleanups."

There are several problems with this code now:

1. It does not run.  Crossjumping only runs after reload right now
(before reload, crossjumping almost always fails because structurally
equivalent code looks different because different input registers are
used -- I have a patch to deal with that separately).

2. It does not help. As far as I know, GCC currently only has
REG_EQUIV notes for incoming arguments, and the arguments registers
don't overlap so substituting them can never result in a new
successful match. And a failure to substitute a REG_EQUAL note earlier
in the pipeline would mean there is a missed optimization somewhere.
(Cases with different insns but the same REG_EQUAL value are not
handled at all.)

3. I could not figure out what it may have been helpful for in the
past.  The code comes from the old crossjumping code in jump.c so it
predates even the CFG-based crossjumping code. And in jump.c the code
is already in the oldest available revision in SVN. So basically the
code has always been there but its raison-d'etre is lost...  Maybe
some (hi Jeff!) remembers what this was for?

4. The code as-is modifies the insns stream in a _p function. Bad.

Anyway, enough reasons for me to propose this patch, to just remove the code.
Bootstrapped&tested on {ia64,x86_64}-unknown-linux-gnu and
cross-built&tested on x86_64 X arm-elf, x86_64 X mips-elf.


* cfgcleanup.c (old_insns_match_p): Remove code to substitute
This doesn't look familiar to me at all. I can't even recall a time when cross jumping ran prior to reload. If you want to investigate further, the following might help:

Mon Aug 12 08:01:01 1991 Richard Kenner (kenner at

       * jump.c (find_cross_jump): Look at REG_EQUIV notes in addition to
       REG_EQUAL notes.
       (do_cross_jump): Remove REG_EQUAL or REG_EQUIV notes present on only
       one branch of the cross-jump so we don't get confused by them if we
       cross-jump again.

Sat May 18 03:51:06 1991 Michael Tiemann (tiemann at

       * jump.c (find_cross_jump): If we are processing a cross jump and
       the insns fail to match, try looking for a REG_EQUAL note that makes
       them equivalent insns.  If found, keep going.  This is important for
       merging cleanup codes when one cleanup path gets frame address in a
       register when the other path gets the frame address explicitly.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]