aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Schmidt <bernd.schmidt@codesourcery.com>2010-04-15 08:57:27 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2010-04-15 08:57:27 +0000
commit077668e3f55c4aa1bc26ddfa14a7d229fc0cf930 (patch)
tree56e8b60da0a8e99a2b747f1c4b7825c3d65ca98d /gcc
parente429bb493195630da7530aad22ccbe50bac0587f (diff)
downloadgcc-077668e3f55c4aa1bc26ddfa14a7d229fc0cf930.zip
gcc-077668e3f55c4aa1bc26ddfa14a7d229fc0cf930.tar.gz
gcc-077668e3f55c4aa1bc26ddfa14a7d229fc0cf930.tar.bz2
re PR target/43742 (web.c/union_match_dups segfaults for a null *ref on sh-elf)
PR target/43742 * config/sh/sh.md (doloop_end_split, dect): Undo previous patch. Use matching constraints to ensure inputs match the output. From-SVN: r158367
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.md18
2 files changed, 15 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a49e6b1..2f22438 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-15 Bernd Schmidt <bernd.schmidt@codesourcery.com>
+
+ PR target/43742
+ * config/sh/sh.md (doloop_end_split, dect): Undo previous patch. Use
+ matching constraints to ensure inputs match the output.
+
2010-04-15 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/43742
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index aa0b449..485c038 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -7050,22 +7050,21 @@ label:
(define_insn_and_split "doloop_end_split"
[(set (pc)
- (if_then_else (ne:SI (match_operand:SI 0 "arith_reg_dest" "")
+ (if_then_else (ne:SI (match_operand:SI 2 "arith_reg_dest" "0")
(const_int 1))
(label_ref (match_operand 1 "" ""))
(pc)))
- (set (match_dup 0)
- (plus (match_dup 0) (const_int -1)))
+ (set (match_operand:SI 0 "arith_reg_dest" "=r")
+ (plus (match_dup 2) (const_int -1)))
(clobber (reg:SI T_REG))]
"TARGET_SH2"
"#"
""
[(parallel [(set (reg:SI T_REG)
- (eq:SI (match_operand:SI 0 "arith_reg_dest" "+r")
- (const_int 1)))
- (set (match_dup 0) (plus:SI (match_dup 0) (const_int -1)))])
+ (eq:SI (match_dup 2) (const_int 1)))
+ (set (match_dup 0) (plus:SI (match_dup 2) (const_int -1)))])
(set (pc) (if_then_else (eq (reg:SI T_REG) (const_int 0))
- (label_ref (match_operand 1 "" ""))
+ (label_ref (match_dup 1))
(pc)))]
""
[(set_attr "type" "cbranch")])
@@ -8308,8 +8307,9 @@ label:
(define_insn "dect"
[(set (reg:SI T_REG)
- (eq:SI (match_operand:SI 0 "arith_reg_dest" "+r") (const_int 1)))
- (set (match_dup 0) (plus:SI (match_dup 0) (const_int -1)))]
+ (eq:SI (match_operand:SI 1 "arith_reg_dest" "0") (const_int 1)))
+ (set (match_operand:SI 0 "arith_reg_dest" "=r")
+ (plus:SI (match_dup 1) (const_int -1)))]
"TARGET_SH2"
"dt %0"
[(set_attr "type" "arith")])