aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2021-05-05 17:00:43 +0200
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2021-05-05 17:00:43 +0200
commitbb283170e7a1f39bf533651418daf10ad18eccfc (patch)
tree8c2b1906fc03bf8be1887d4923abbe0489c78ca1
parentdfd2c92f3f5d204619bd218aa72b162997690796 (diff)
downloadgcc-bb283170e7a1f39bf533651418daf10ad18eccfc.zip
gcc-bb283170e7a1f39bf533651418daf10ad18eccfc.tar.gz
gcc-bb283170e7a1f39bf533651418daf10ad18eccfc.tar.bz2
PR rtl-optimization/100263: Ensure register can change mode
For move2add_valid_value_p we also have to ask the target whether a register can be accessed in a different mode than it was set before. gcc/ChangeLog: PR rtl-optimization/100263 * postreload.c (move2add_valid_value_p): Ensure register can change mode.
-rw-r--r--gcc/postreload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/postreload.c b/gcc/postreload.c
index e4b2acb..b12b8fe 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -1721,7 +1721,8 @@ move2add_valid_value_p (int regno, scalar_int_mode mode)
{
scalar_int_mode old_mode;
if (!is_a <scalar_int_mode> (reg_mode[regno], &old_mode)
- || !MODES_OK_FOR_MOVE2ADD (mode, old_mode))
+ || !MODES_OK_FOR_MOVE2ADD (mode, old_mode)
+ || !REG_CAN_CHANGE_MODE_P (regno, old_mode, mode))
return false;
/* The value loaded into regno in reg_mode[regno] is also valid in
mode after truncation only if (REG:mode regno) is the lowpart of