This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/82524] [7/8 Regression] expensive-optimizations produces wrong results
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Oct 2017 14:07:43 +0000
- Subject: [Bug rtl-optimization/82524] [7/8 Regression] expensive-optimizations produces wrong results
- Auto-submitted: auto-generated
- References: <bug-82524-4@http.gcc.gnu.org/bugzilla/>
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.