an obvious bug of MOVDI_USD in mips.md
Hiroyuki Machida
machida@sm.sony.co.jp
Mon Apr 8 06:17:00 GMT 2002
Hi, all
I found an obvious bug of MOVDI_USD in gcc/config/mips/mips.md. This
pattern accepts const_0 as operands[1], so you have to use "%z1" for
operands[1], not "%1".
Here is a patch. Please apply this patch to gcc-3_0-branch,
gcc-3_1-branch and HEAD.
---
ChangeLog entry:
* gcc/config/mips/mips.md (movdi_usd): Use "%z1" for operands[1].
Index: mips.md
Index: mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.87.4.5
diff -p -U18 -r1.87.4.5 mips.md
--- mips.md 19 Feb 2002 23:16:53 -0000 1.87.4.5
+++ mips.md 8 Apr 2002 12:23:34 -0000
@@ -4735,37 +4735,37 @@ move\\t%0,%z4\\n\\
(define_insn "movdi_usd"
[(set (match_operand:BLK 0 "memory_operand" "=R,o")
(unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ,dJ")] 1))]
""
"*
{
rtx offset = const0_rtx;
rtx addr = XEXP (operands[0], 0);
rtx mem_addr = eliminate_constant_term (addr, &offset);
if (TARGET_STATS)
mips_count_memory_refs (operands[0], 2);
/* The stack/frame pointers are always aligned, so we can convert
to the faster sw if we are referencing an aligned stack location. */
if ((INTVAL (offset) & 7) == 0
&& (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
- return \"sd\\t%1,%0\";
+ return \"sd\\t%z1,%0\";
return \"usd\\t%z1,%0\";
}"
[(set_attr "type" "store")
(set_attr "mode" "SI")
(set_attr "length" "8,16")])
;; These two patterns support loading addresses with two instructions instead
;; of using the macro instruction la.
;; ??? mips_move_1word has support for HIGH, so this pattern may be
;; unnecessary.
(define_insn "high"
[(set (match_operand:SI 0 "register_operand" "=r")
(high:SI (match_operand:SI 1 "immediate_operand" "")))]
"mips_split_addresses && !TARGET_MIPS16"
"lui\\t%0,%%hi(%1) # high"
---
Hiroyuki Machida
Sony Corp.
More information about the Gcc-patches
mailing list