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]


PR2912 is the result of the new cmpstr peepholes in the x86 back-end.

The problem is that these peepholes fall afoul of what looks to be an
undocumented restriction on peepholes: they must not change the set of
live registers.  The new peepholes get rid of instructions we don't
need that mess with `al' and `dl' -- and thereby make those registers
no longer killed.

There are a two ways I can see to fix this problem:

  - Add CLOBBERS for the registers, so that we maintain the invariant.
    I am leaning towards this solution on the branch, since it seems
    least invasive.

  - Make peephole2_optimize update the liveness information when its
    done peepholing.  We already do this for targets with conditional
    execution, but we go to some lengths to avoid it for targets
    that do not have conditional execution.

Since we do not (presently) try to reallocate registers in any way
after peephole2, there should actually be no harm in adding the
clobbers; we're not smart enough to use the registers anyhow.  Still,
it seems somewhat inelegant.

In any case, if I am correct that this is an implicit restriction on
peepholes, we should document it.  And if I am incorrect, then I'm way
confused, and someone should leave me out of this maze of twistly
little registers, all alike.

Which is it?

Mark Mitchell         
CodeSourcery, LLC     

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