[Bug rtl-optimization/67382] RTL combiner is too eager to combine (plus (reg 92) (reg 92)) to (ashift (reg 92) (const_int 1))

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jul 25 20:16:45 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67382

--- Comment #4 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> Note combine is able to figure out the jump is unconditional but there is no
> "pattern" to match it:
> Trying 10 -> 17:
>    10: r85:QI=0x1
>    17: {flags:CCC=cmp(r85:QI-0x1,r85:QI);clobber scratch;}
>       REG_DEAD r85:QI
>       REG_EQUAL cmp(0,0x1)
> Failed to match this instruction:
> (parallel [
>         (set (pc)
>             (pc))
>         (clobber (scratch:QI))
>     ])
> Failed to match this instruction:
> (set (pc)
>     (pc))

This is an other_insn, namely a cc_use_insn.  We currently use that for
changing the cc mode used.
update_cfg_for_uncondjump
There is code in combine for handling (set (pc) (pc)) in other_insn, in
fact (see where update_cfg_for_uncondjump is called).

There also is code (in recog_for_combine_1) that should handle noop sets
like this.  It does not print anything if that happens though.

Investigating.


More information about the Gcc-bugs mailing list