aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMatthew Fortune <matthew.fortune@imgtec.com>2017-10-31 18:27:52 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-10-31 18:27:52 +0000
commit8e02e8a0a588d0dbd64c375dd604fecc8fde2f83 (patch)
treea1da5ce33f1ff799ca3bb72be6046baa4671c8fa /gcc
parente6b6e96a4fbe61536d3992529639fd7dcb2279e2 (diff)
downloadgcc-8e02e8a0a588d0dbd64c375dd604fecc8fde2f83.zip
gcc-8e02e8a0a588d0dbd64c375dd604fecc8fde2f83.tar.gz
gcc-8e02e8a0a588d0dbd64c375dd604fecc8fde2f83.tar.bz2
re PR rtl-optimization/81803 (miscompilation at -O1 on mips64el)
PR rtl-optimization/81803 * lra-constraints.c (curr_insn_transform): Also reload the whole register for a strict subreg no wider than a word if this is for a WORD_REGISTER_OPERATIONS target. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r254275
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/lra-constraints.c11
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ed1c09..b73c5c6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2017-10-31 Matthew Fortune <matthew.fortune@imgtec.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/81803
+ * lra-constraints.c (curr_insn_transform): Also reload the whole
+ register for a strict subreg no wider than a word if this is for
+ a WORD_REGISTER_OPERATIONS target.
+
2017-10-31 Jason Merrill <jason@redhat.com>
* gdbinit.in: Skip over inlines from timevar.h.
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index a423f06..3758409 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -4207,8 +4207,9 @@ curr_insn_transform (bool check_only_p)
reg = SUBREG_REG (*loc);
byte = SUBREG_BYTE (*loc);
if (REG_P (reg)
- /* Strict_low_part requires reload the register not
- the sub-register. */
+ /* Strict_low_part requires reloading the register and not
+ just the subreg. Likewise for a strict subreg no wider
+ than a word for WORD_REGISTER_OPERATIONS targets. */
&& (curr_static_id->operand[i].strict_low
|| (!paradoxical_subreg_p (mode, GET_MODE (reg))
&& (hard_regno
@@ -4219,7 +4220,11 @@ curr_insn_transform (bool check_only_p)
&& (goal_alt[i] == NO_REGS
|| (simplify_subreg_regno
(ira_class_hard_regs[goal_alt[i]][0],
- GET_MODE (reg), byte, mode) >= 0)))))
+ GET_MODE (reg), byte, mode) >= 0)))
+ || (GET_MODE_PRECISION (mode)
+ < GET_MODE_PRECISION (GET_MODE (reg))
+ && GET_MODE_SIZE (GET_MODE (reg)) <= UNITS_PER_WORD
+ && WORD_REGISTER_OPERATIONS)))
{
/* An OP_INOUT is required when reloading a subreg of a
mode wider than a word to ensure that data beyond the