diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2016-10-28 22:56:28 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2016-10-28 22:56:28 +0200 |
commit | 9a5e1efcaca6305711e7d44b355e98c923f27c6d (patch) | |
tree | 8021e705f33c93434b854873987fa541d49d8007 /gcc/expr.c | |
parent | a5742b01585d78d5e9c39e8dbc9cfce7796af492 (diff) | |
download | gcc-9a5e1efcaca6305711e7d44b355e98c923f27c6d.zip gcc-9a5e1efcaca6305711e7d44b355e98c923f27c6d.tar.gz gcc-9a5e1efcaca6305711e7d44b355e98c923f27c6d.tar.bz2 |
combine: Improve change_zero_ext (fixes PR71847)
This improves a few things in change_zero_ext. Firstly, it should use
the passed in pattern in recog_for_combine, not the pattern of the insn
(they are not the same if the whole pattern was replaced). Secondly,
it handled zero_ext of a subreg, but with hard registers we do not get
a subreg, instead the mode of the reg is changed. So this handles that.
Thirdly, after changing a zero_ext to an AND, the resulting RTL may become
non-canonical, like (ior (ashift ..) (and ..)); the AND should be first,
it is commutative. And lastly, zero_extract as a set_dest wasn't handled
at all, but now it is.
This fixes the testcase in PR71847, and improves code generation in some
other edge cases too.
PR target/71847
* combine.c (change_zero_ext): Handle zero_ext of hard registers.
Swap commutative operands in new RTL if needed. Handle zero_ext
in the set_dest.
(recog_for_combine): Pass *pnewpat to change_zero_ext instead of
PATTERN (insn).
From-SVN: r241664
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions