On 09/07/2011 05:38 AM, Alexander Monakov wrote:
Hello,

The patch repairs a problem when we attempt to substitute an insn like
(... (cmp (mem (reg:DI ax)) (reg:SI ax))) (note different modes) through
(set (reg:DI ax) (reg:DI dx)), which leaves the (reg:SI ax) part of the
comparison intact, causing an ICE later on when we notice that the dependency
on ax is still present.  As this is quite rare, we can simply forbid
substitution in such circumstances, much like substitution of multiple hard
reg references is forbidden now.

En passant, the patch simplifes the code a little, as we never try to
substitute anything but registers.

Bootstrapped and regtested on x86_64-linux with sel-sched enabled at -O2, OK?
(I'll add the testcase from Bugzilla when committing)

Ok.  Thanks for the patch.
2011-09-07  Alexander Monakov<amona...@ispras.ru>

        PR rtl-optimization/50205
        * sel-sched.c (count_occurrences_1): Simplify on the assumption that
        p->x is a register.  Forbid substitution when the same register is
        found in a different mode.
        (count_occurrences_equiv): Assert that 'what' is a register.


Reply via email to