diff options
author | Matthew Fortune <matthew.fortune@imgtec.com> | 2017-02-20 12:07:06 +0000 |
---|---|---|
committer | Matthew Fortune <mpf@gcc.gnu.org> | 2017-02-20 12:07:06 +0000 |
commit | 62cdb862640710f991b9e61a5ab4b7a0456a8043 (patch) | |
tree | 767707bc6584dcc011f782b953752902371887ce | |
parent | 222aafd7b63a3d79a80c55efefae7b52953be5b4 (diff) | |
download | gcc-62cdb862640710f991b9e61a5ab4b7a0456a8043.zip gcc-62cdb862640710f991b9e61a5ab4b7a0456a8043.tar.gz gcc-62cdb862640710f991b9e61a5ab4b7a0456a8043.tar.bz2 |
Tighten condition for converting SUBREG reloads from OP_OUT to OP_INOUT
gcc/
PR target/78660
* lra-constraints.c (curr_insn_transform): Tighten condition
for converting SUBREG reloads from OP_OUT to OP_INOUT.
From-SVN: r245599
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lra-constraints.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9dc6b58..1823049 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ 2017-02-20 Matthew Fortune <matthew.fortune@imgtec.com> PR target/78660 + * lra-constraints.c (curr_insn_transform): Tighten condition + for converting SUBREG reloads from OP_OUT to OP_INOUT. + +2017-02-20 Matthew Fortune <matthew.fortune@imgtec.com> + + PR target/78660 * lra-constraints.c (curr_insn_transform): Handle WORD_REGISTER_OPERATIONS requirements when reloading SUBREGs. diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 62947e3..18b3096 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -4140,7 +4140,17 @@ curr_insn_transform (bool check_only_p) < GET_MODE_PRECISION (GET_MODE (reg)) && WORD_REGISTER_OPERATIONS))) { - if (type == OP_OUT) + /* An OP_INOUT is required when reloading a subreg of a + mode wider than a word to ensure that data beyond the + word being reloaded is preserved. Also automatically + ensure that strict_low_part reloads are made into + OP_INOUT which should already be true from the backend + constraints. */ + if (type == OP_OUT + && (curr_static_id->operand[i].strict_low + || (GET_MODE_SIZE (GET_MODE (reg)) > UNITS_PER_WORD + && (GET_MODE_SIZE (mode) + < GET_MODE_SIZE (GET_MODE (reg)))))) type = OP_INOUT; loc = &SUBREG_REG (*loc); mode = GET_MODE (*loc); |