Skip to content

Commit

Permalink
Tighten condition for converting SUBREG reloads from OP_OUT to OP_INOUT
Browse files Browse the repository at this point in the history
gcc/
	PR target/78660
	* lra-constraints.c (curr_insn_transform): Tighten condition
	for converting SUBREG reloads from OP_OUT to OP_INOUT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245599 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
mpf committed Feb 20, 2017
1 parent a547b44 commit 55996ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
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
Expand Down
12 changes: 11 additions & 1 deletion gcc/lra-constraints.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 55996ba

Please sign in to comment.