diff options
author | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-24 12:08:05 +0000 |
---|---|---|
committer | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-24 12:08:05 +0000 |
commit | 1ed6fd0815d03379692fdd1a91a03db50e556797 (patch) | |
tree | c3b296a90710687cf466dcf02eea2a725f48276c /gcc/config/s390 | |
parent | ce1a737c5d8541db078a16891f5d9c60f9747bb6 (diff) | |
download | gcc-1ed6fd0815d03379692fdd1a91a03db50e556797.tar.gz |
2007-04-24 Andreas Krebbel <krebbel1@de.ibm.com>
PR target/31641
* config/s390/s390.c (s390_expand_setmem): Don't ICE for constant length
argument of 0 for memset.
(s390_expand_movmem, s390_expand_setmem, s390_expand_cmpmem): Use
unsigned shift instead of the signed variant.
2007-04-24 Andreas Krebbel <krebbel1@de.ibm.com>
PR target/31641
* gcc.c-torture/compile/pr31641.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124099 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390')
-rw-r--r-- | gcc/config/s390/s390.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 1721971fb1e..ced302a5ba8 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -3570,7 +3570,7 @@ s390_expand_movmem (rtx dst, rtx src, rtx len) if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, ashr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); if (temp != blocks) emit_move_insn (blocks, temp); @@ -3607,10 +3607,12 @@ s390_expand_movmem (rtx dst, rtx src, rtx len) void s390_expand_setmem (rtx dst, rtx len, rtx val) { - gcc_assert (GET_CODE (len) != CONST_INT || INTVAL (len) > 0); + if (GET_CODE (len) == CONST_INT && INTVAL (len) == 0) + return; + gcc_assert (GET_CODE (val) == CONST_INT || GET_MODE (val) == QImode); - if (GET_CODE (len) == CONST_INT && INTVAL (len) <= 257) + if (GET_CODE (len) == CONST_INT && INTVAL (len) > 0 && INTVAL (len) <= 257) { if (val == const0_rtx && INTVAL (len) <= 256) emit_insn (gen_clrmem_short (dst, GEN_INT (INTVAL (len) - 1))); @@ -3684,7 +3686,7 @@ s390_expand_setmem (rtx dst, rtx len, rtx val) if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, ashr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); if (temp != blocks) emit_move_insn (blocks, temp); @@ -3776,7 +3778,7 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len) if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, ashr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); if (temp != blocks) emit_move_insn (blocks, temp); |