This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300.md: Remove useless code.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 Mar 2003 08:01:02 -0500 (EST)
- Subject: [patch] h8300.md: Remove useless code.
Hi,
Attached is a patch to remove useless code.
In this peephole2, even though operands[1] is guaranteed to be a MEM,
"GET_CODE (operands[1]) == MEM" is done, which is useless.
Committed as obvious.
Kazu Hirata
2003-03-30 Kazu Hirata <kazu at cs dot umass dot edu>
* config/h8300/h8300.md (a peephole2): Remove useless code.
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.205
diff -u -4 -r1.205 h8300.md
--- h8300.md 29 Mar 2003 18:20:23 -0000 1.205
+++ h8300.md 30 Mar 2003 12:54:31 -0000
@@ -3933,16 +3933,19 @@
(lshiftrt:SI (match_dup 1)
(const_int 8)))]
"")
+;; If a load of mem:SI is followed by an AND that turns off the upper
+;; half, then we can load mem:HI instead.
+
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "memory_operand" ""))
(set (match_dup 0)
(and:SI (match_dup 0)
(match_operand:SI 2 "const_int_operand" "")))]
"(TARGET_H8300H || TARGET_H8300S)
- && !(GET_CODE (operands[1]) == MEM && MEM_VOLATILE_P (operands[1]))
+ && !MEM_VOLATILE_P (operands[1])
&& (INTVAL (operands[2]) & ~0xffff) == 0
&& INTVAL (operands[2]) != 255"
[(set (match_dup 3)
(match_dup 4))