diff options
author | Oleg Endo <olegendo@gcc.gnu.org> | 2012-09-02 23:15:25 +0000 |
---|---|---|
committer | Oleg Endo <olegendo@gcc.gnu.org> | 2012-09-02 23:15:25 +0000 |
commit | b07c437262919a5f5e5de215b21b0ff6920c59ed (patch) | |
tree | 15a4635667e509d8abbd872d1b3233364572d392 /gcc | |
parent | 613061fdd04360cdc6575c1dc057d465b30dc6d3 (diff) | |
download | gcc-b07c437262919a5f5e5de215b21b0ff6920c59ed.zip gcc-b07c437262919a5f5e5de215b21b0ff6920c59ed.tar.gz gcc-b07c437262919a5f5e5de215b21b0ff6920c59ed.tar.bz2 |
re PR target/54418 ([SH] Invalid operands for opcode)
PR target/54418
* config/sh/sh.md (cmpgeusi_t): Remove N alternative.
Check operands[1] in split condition instead of operands[0].
Add comments.
From-SVN: r190864
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/sh/sh.md | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1f8c50..b743a98 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-09-02 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/54418 + * config/sh/sh.md (cmpgeusi_t): Remove N alternative. + Check operands[1] in split condition instead of operands[0]. + Add comments. + 2012-09-02 Mark Kettenis <kettenis@openbsd.org> * config.gcc (x86_64-*-openbsd*): New target. diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index f1b5df7..d69d294 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -1043,13 +1043,19 @@ ;; SImode unsigned integer comparisons ;; ------------------------------------------------------------------------- +;; Usually comparisons of 'unsigned int >= 0' are optimized away completely. +;; However, especially when optimizations are off (e.g. -O0) such comparisons +;; might remain and we have to handle them. If the '>= 0' case wasn't +;; handled here, something else would just load a '0' into the second operand +;; and do the comparison. We can do slightly better by just setting the +;; T bit to '1'. (define_insn_and_split "cmpgeusi_t" [(set (reg:SI T_REG) (geu:SI (match_operand:SI 0 "arith_reg_operand" "r") - (match_operand:SI 1 "arith_reg_or_0_operand" "rN")))] + (match_operand:SI 1 "arith_reg_or_0_operand" "r")))] "TARGET_SH1" "cmp/hs %1,%0" - "&& satisfies_constraint_Z (operands[0])" + "&& satisfies_constraint_Z (operands[1])" [(set (reg:SI T_REG) (const_int 1))] "" [(set_attr "type" "mt_group")]) |