This is the mail archive of the gcc@gcc.gnu.org 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]

Re: Combine error?


  In message <200003210700.HAA23579@cam-mail2.cambridge.arm.com>you write:
  > and dead-code 
  > elimination will only remove code to the end of a BB (ie it won't remove 
  > some code from a BB without removing all code to the end of that block) 
  > [err, actually, won't it only remove whole blocks?].
No, dead code elimination will remove any instruction which it can prove
is useless.  For example if we have consecutive stores to the same pseudo,
one must be dead and dead code elimination will delete the first store.

You might be confusing dead code elimination with removal of unreachable
code.  When we delete unreachable code we delete entire blocks (since the
entire block is unreachable).

  > Combine also can't 
  > create such anomalies because it only works on insns that have a single 
  > subsequent use.
I don't see how that avoids the problem.

In the simple case, when we do a 2->1 combination, one of the old insns is
dead.  I don't remember offhand if we combine earlier insns into later insns
or vice-versa.

If we combine earlier into later, then the earlier insn can be turned into
a NOTE_INSN_DELETED.  Presumably if that happens we delete the link from
the later insn to the earlier insn.

If we combine later into earlier, then the later insn can be turned into a
NOTE_INSN_DELETED, but we don't have any convenient way to find any LOG_LINKS
that pointed to the later insn.

The same basic problem applies to auto-inc.  If we turn the later insn into
a NOTE_INSN_DELETED, then we'd have to wander the insn chain to find LOG_LINKS
which point to the later insn.

jeff



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