[Bug rtl-optimization/82524] [7/8 Regression] expensive-optimizations produces wrong results

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 12 14:07:00 GMT 2017


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

--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jakub Jelinek from comment #9)

> > Do we need "+Q" instead of "=Q" on LHS zero_extract patterns?
> 
> That said, yes, I think it should use +Q.
> As expected, if I fix those, then LRA ICEs, because it really has no way to
> reload that:
>
> [...]
>
> I think for the non-commutative inputs, we could as well just replace the
> match_operand 1 with match_dup 0.  For the commutative case, we need to
> verify one of the operands is rtx_equal_p.

It can be done in LRA, but:

(insn 66 37 38 2 (set (reg:SI 0 ax [159])
        (reg:SI 3 bx [159])) "pr82545.c":27 82 {*movsi_internal}
     (nil))

would have to be implemented with

(set (zero_extract:SI (reg:SI A) (const_int 8) (const_int 8))
     (zero_extract:SI (reg:SI B) (const_int 8) (const_int 8)))

that results in "movq %bh, %ah" as a reload.

In effect, LRA has to be taught how to reload zero_extract (and strict_low_part
?) LHS expression.


More information about the Gcc-bugs mailing list