On 09/30/14 08:15, Richard Earnshaw wrote:

I think part of the problem is in the naming of single_set().  From the
name it's not entirely obvious to users that this includes insns that
clobber registers or which write other registers that are unused after
that point.  I've previously had to fix a bug where this assumption was
made (eg https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54300)

Most uses of single_set prior to register allocation are probably safe;
but later uses are fraught with potential problems of this nature and
may well be bugs waiting to happen.
Very possibly. There's a bit of a natural tension here in that often we don't much care about the additional CLOBBERS, but when we get it wrong, obviously it's bad.

I haven't done any research, but I suspect the change it ignore clobbers in single_set came in as part of exposing the CC register and avoiding regressions all over the place as a result.

I wonder what would happen if we ignored prior to register allocation, then rejected insns with those CLOBBERs once register allocation started.

Jeff

Reply via email to