This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fix for FAIL: memops-asm.c in gcc testcase
- From: Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>
- To: nickc at redhat dot com
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 20 May 2005 17:24:15 +0900
- Subject: [PATCH] fix for FAIL: memops-asm.c in gcc testcase
Hi Nick,
This is a patch to fix FAIL memops-asm.c testcase.
Please commit into 3.4-branch, 4.0-branch and mainline.
Regards,
Kazuhiro Inaoka
gcc/ChangeLog
2005-05-20 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
* config/m32r/m32r.md (movmemsi): Changed to fix FAIL memops-asm.c.
* config/m32r/m32r.c (m32r_expand_block_move): Ditto.
* config/m32r/m32r/m32r-protos.h (m32r_expand_block_move): Ditto.
Index: config/m32r/m32r-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r-protos.h,v
retrieving revision 1.27
diff -u -r1.27 m32r-protos.h
--- config/m32r/m32r-protos.h 30 Dec 2004 03:07:50 -0000 1.27
+++ config/m32r/m32r-protos.h 20 May 2005 07:30:55 -0000
@@ -47,7 +47,7 @@
extern int zero_and_one (rtx, rtx);
extern char * emit_cond_move (rtx *, rtx);
extern void m32r_output_block_move (rtx, rtx *);
-extern void m32r_expand_block_move (rtx *);
+extern int m32r_expand_block_move (rtx *);
extern void m32r_print_operand (FILE *, rtx, int);
extern void m32r_print_operand_address (FILE *, rtx);
extern int m32r_not_same_reg (rtx, rtx);
Index: config/m32r/m32r.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.c,v
retrieving revision 1.110
diff -u -r1.110 m32r.c
--- config/m32r/m32r.c 30 Dec 2004 03:07:50 -0000 1.110
+++ config/m32r/m32r.c 20 May 2005 07:30:55 -0000
@@ -2597,7 +2597,7 @@
operands[2] is the number of bytes to move.
operands[3] is the alignment. */
-void
+int
m32r_expand_block_move (rtx operands[])
{
rtx orig_dst = operands[0];
@@ -2612,7 +2612,7 @@
rtx dst_reg;
if (constp && bytes <= 0)
- return;
+ return 1;
/* Move the address into scratch registers. */
dst_reg = copy_addr_to_reg (XEXP (orig_dst, 0));
@@ -2627,7 +2627,7 @@
if (optimize_size || ! constp || align != UNITS_PER_WORD)
{
block_move_call (dst_reg, src_reg, bytes_rtx);
- return;
+ return 0;
}
leftover = bytes % MAX_MOVE_BYTES;
@@ -2684,6 +2684,7 @@
emit_insn (gen_movmemsi_internal (dst_reg, src_reg, GEN_INT (leftover),
gen_reg_rtx (SImode),
gen_reg_rtx (SImode)));
+ return 1;
}
Index: config/m32r/m32r.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.md,v
retrieving revision 1.50
diff -u -r1.50 m32r.md
--- config/m32r/m32r.md 15 Dec 2004 12:13:07 -0000 1.50
+++ config/m32r/m32r.md 20 May 2005 07:30:56 -0000
@@ -2534,8 +2534,10 @@
{
if (operands[0]) /* avoid unused code messages */
{
- m32r_expand_block_move (operands);
- DONE;
+ if (m32r_expand_block_move (operands))
+ DONE;
+ else
+ FAIL;
}
}")