Commit e0ec4c3b by Richard Sandiford Committed by Richard Sandiford

re PR target/16357 (ICE copying 7 bytes between extern char[]s)

	PR target/16357
	* config/mips/mips.c (mips_block_move_straight): Pass BLKmode memrefs
	to mips_expand_unaligned_load, mips_expand_unaligned_store, and
	move_by_pieces.

From-SVN: r84108
parent feb61729
2004-07-05 Richard Sandiford <rsandifo@redhat.com>
PR target/16357
* config/mips/mips.c (mips_block_move_straight): Pass BLKmode memrefs
to mips_expand_unaligned_load, mips_expand_unaligned_store, and
move_by_pieces.
2004-07-05 Josef Zlomek <zlomekj@suse.cz> 2004-07-05 Josef Zlomek <zlomekj@suse.cz>
* var-tracking.c: Fix some comments. * var-tracking.c: Fix some comments.
......
...@@ -3402,33 +3402,33 @@ mips_block_move_straight (rtx dest, rtx src, HOST_WIDE_INT length) ...@@ -3402,33 +3402,33 @@ mips_block_move_straight (rtx dest, rtx src, HOST_WIDE_INT length)
the source has enough alignment, otherwise use left/right pairs. */ the source has enough alignment, otherwise use left/right pairs. */
for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++) for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++)
{ {
rtx part;
regs[i] = gen_reg_rtx (mode); regs[i] = gen_reg_rtx (mode);
part = adjust_address (src, mode, offset); if (MEM_ALIGN (src) >= bits)
if (MEM_ALIGN (part) >= bits) emit_move_insn (regs[i], adjust_address (src, mode, offset));
emit_move_insn (regs[i], part); else
else if (!mips_expand_unaligned_load (regs[i], part, bits, 0)) {
abort (); rtx part = adjust_address (src, BLKmode, offset);
if (!mips_expand_unaligned_load (regs[i], part, bits, 0))
abort ();
}
} }
/* Copy the chunks to the destination. */ /* Copy the chunks to the destination. */
for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++) for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++)
{ if (MEM_ALIGN (dest) >= bits)
rtx part; emit_move_insn (adjust_address (dest, mode, offset), regs[i]);
else
part = adjust_address (dest, mode, offset); {
if (MEM_ALIGN (part) >= bits) rtx part = adjust_address (dest, BLKmode, offset);
emit_move_insn (part, regs[i]); if (!mips_expand_unaligned_store (part, regs[i], bits, 0))
else if (!mips_expand_unaligned_store (part, regs[i], bits, 0)) abort ();
abort (); }
}
/* Mop up any left-over bytes. */ /* Mop up any left-over bytes. */
if (offset < length) if (offset < length)
{ {
src = adjust_address (src, mode, offset); src = adjust_address (src, BLKmode, offset);
dest = adjust_address (dest, mode, offset); dest = adjust_address (dest, BLKmode, offset);
move_by_pieces (dest, src, length - offset, move_by_pieces (dest, src, length - offset,
MIN (MEM_ALIGN (src), MEM_ALIGN (dest)), 0); MIN (MEM_ALIGN (src), MEM_ALIGN (dest)), 0);
} }
......
2004-07-05 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/compile/20040705-1.c: New test.
2004-07-04 Bud Davis <bdavis9659@comcast.net> 2004-07-04 Bud Davis <bdavis9659@comcast.net>
* gfortran.fortran-torture/execute/seq_io.f90: New test. * gfortran.fortran-torture/execute/seq_io.f90: New test.
......
extern char foo[], bar[];
void f (void) { memcpy (foo, bar, 7); }
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