Commit c9f59991 by Andreas Krebbel Committed by Andreas Krebbel

re PR target/31641 (ICE in s390_expand_setmem, at config/s390/s390.c:3618)

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.

From-SVN: r124099
parent c0e7e2bf
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>
* config/s390/s390.md ("*cmp<mode>_ccs_0_ibm", "*cmp<mode>_ccs_ibm",
"fix_trunc<BFP:mode><GPR:mode>2_ieee", "fix_truncdfsi2_ibm",
"floatsidf2_ibm", "floatsisf2", "truncdfsf2_ieee", "truncdfsf2_ibm",
......
......@@ -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);
......
2007-04-24 Andreas Krebbel <krebbel1@de.ibm.com>
PR target/31641
* gcc.c-torture/compile/pr31641.c: New testcase.
2007-04-24 Richard Sandiford <richard@nildram.co.uk>
* gcc.target/mips/madd-1.c, gcc.target/mips/madd-2.c,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment