aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Fortune <matthew.fortune@imgtec.com>2017-02-20 12:07:23 +0000
committerMatthew Fortune <mpf@gcc.gnu.org>2017-02-20 12:07:23 +0000
commit1b51df94425a71e9f0ee1d53559e2063a29e85cc (patch)
tree17b1f58c60f934e17310ee46f296ffc97c773b9b
parent77850e96ddcb1c1c1be784569d9b18e1c3f96186 (diff)
downloadgcc-1b51df94425a71e9f0ee1d53559e2063a29e85cc.zip
gcc-1b51df94425a71e9f0ee1d53559e2063a29e85cc.tar.gz
gcc-1b51df94425a71e9f0ee1d53559e2063a29e85cc.tar.bz2
Ensure the mode used to create split registers is suppported
gcc/ PR target/78012 * lra-constraints.c (split_reg): Check requested split mode is supported by the register. From-SVN: r245601
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lra-constraints.c20
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aa7bb84..57857ee 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-02-20 Matthew Fortune <matthew.fortune@imgtec.com>
+ PR target/78012
+ * lra-constraints.c (split_reg): Check requested split mode
+ is supported by the register.
+
+2017-02-20 Matthew Fortune <matthew.fortune@imgtec.com>
+
* lra-constraints.c (simplify_operand_subreg): Remove early
return false.
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index a7de40b..bd5fbcd 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -5396,6 +5396,26 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
}
return false;
}
+ /* Split_if_necessary can split hard registers used as part of a
+ multi-register mode but splits each register individually. The
+ mode used for each independent register may not be supported
+ so reject the split. Splitting the wider mode should theoretically
+ be possible but is not implemented. */
+ if (! HARD_REGNO_MODE_OK (hard_regno, mode))
+ {
+ if (lra_dump_file != NULL)
+ {
+ fprintf (lra_dump_file,
+ " Rejecting split of %d(%s): unsuitable mode %s\n",
+ original_regno,
+ reg_class_names[lra_get_allocno_class (original_regno)],
+ GET_MODE_NAME (mode));
+ fprintf
+ (lra_dump_file,
+ " ))))))))))))))))))))))))))))))))))))))))))))))))\n");
+ }
+ return false;
+ }
new_reg = lra_create_new_reg (mode, original_reg, rclass, "split");
reg_renumber[REGNO (new_reg)] = hard_regno;
}