aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2016-02-11 09:12:18 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2016-02-11 09:12:18 +0000
commit3a71ddbcadbe628327cffec0924611beae284edf (patch)
tree8a745a40722b9e437803250c314bbc7c44cb24e8
parent281a11eb257c06ec1f6610288a10d9bbbfe0a751 (diff)
downloadgcc-3a71ddbcadbe628327cffec0924611beae284edf.zip
gcc-3a71ddbcadbe628327cffec0924611beae284edf.tar.gz
gcc-3a71ddbcadbe628327cffec0924611beae284edf.tar.bz2
re PR target/69713 (Invalid code of optimization in SH)
gcc/ PR target/69713 * config/sh/sh.md (casesi_worker_0): Add T_REG use. From-SVN: r233324
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.md12
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6037782..7ca86d6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-11 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/69713
+ * config/sh/sh.md (casesi_worker_0): Add T_REG use.
+
2016-02-11 Richard Biener <rguenther@suse.de>
PR rtl-optimization/69291
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 1b2523e..203215a 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -11707,12 +11707,16 @@ label:
;; ??? reload might clobber r0 if we use it explicitly in the RTL before
;; reload; using a R0_REGS pseudo reg is likely to give poor code.
;; So we keep the use of r0 hidden in a R0_REGS clobber until after reload.
+;;
+;; The use on the T_REG in the casesi_worker* patterns links the bounds
+;; checking insns and the table memory access. See also PR 69713.
(define_insn "casesi_worker_0"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(unspec:SI [(match_operand:SI 1 "register_operand" "0,r")
(label_ref (match_operand 2 "" ""))] UNSPEC_CASESI))
(clobber (match_scratch:SI 3 "=X,1"))
- (clobber (match_scratch:SI 4 "=&z,z"))]
+ (clobber (match_scratch:SI 4 "=&z,z"))
+ (use (reg:SI T_REG))]
"TARGET_SH1"
"#")
@@ -11721,7 +11725,8 @@ label:
(unspec:SI [(match_operand:SI 1 "register_operand" "")
(label_ref (match_operand 2 "" ""))] UNSPEC_CASESI))
(clobber (match_scratch:SI 3 ""))
- (clobber (match_scratch:SI 4 ""))]
+ (clobber (match_scratch:SI 4))
+ (use (reg:SI T_REG))]
"TARGET_SH1 && ! TARGET_SH2 && reload_completed"
[(set (reg:SI R0_REG) (unspec:SI [(label_ref (match_dup 2))] UNSPEC_MOVA))
(parallel [(set (match_dup 0)
@@ -11739,7 +11744,8 @@ label:
(unspec:SI [(match_operand:SI 1 "register_operand" "")
(label_ref (match_operand 2 "" ""))] UNSPEC_CASESI))
(clobber (match_scratch:SI 3 ""))
- (clobber (match_scratch:SI 4 ""))]
+ (clobber (match_scratch:SI 4))
+ (use (reg:SI T_REG))]
"TARGET_SH2 && reload_completed"
[(set (reg:SI R0_REG) (unspec:SI [(label_ref (match_dup 2))] UNSPEC_MOVA))
(parallel [(set (match_dup 0)