This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300: Remove an redundant argument from fix_bit_operand().
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Feb 2004 19:42:53 -0500 (EST)
- Subject: [patch] h8300: Remove an redundant argument from fix_bit_operand().
Hi,
Attached is a patch to remove an redundant argument "what" from
fix_bit_operand() as it can be deduced from the last argument "code".
Built h8300-elf. Committed.
Kazu Hirata
2004-02-17 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300-protos.h: Update the prototype of
fix_bit_operand().
* config/h8300/h8300.c (fix_bit_operand): Remove the second
argument "what".
* config/h8300/h8300.md: Update all callers.
Index: h8300-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300-protos.h,v
retrieving revision 1.69
diff -u -r1.69 h8300-protos.h
--- h8300-protos.h 10 Feb 2004 23:58:57 -0000 1.69
+++ h8300-protos.h 18 Feb 2004 00:20:07 -0000
@@ -48,7 +48,7 @@
extern void expand_a_shift (enum machine_mode, int, rtx[]);
extern int h8300_shift_needs_scratch_p (int, enum machine_mode);
extern int expand_a_rotate (enum rtx_code, rtx[]);
-extern int fix_bit_operand (rtx *, int, enum rtx_code);
+extern int fix_bit_operand (rtx *, enum rtx_code);
extern int h8300_adjust_insn_length (rtx, int);
extern void split_adds_subs (enum machine_mode, rtx[]);
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.279
diff -u -r1.279 h8300.c
--- h8300.c 18 Feb 2004 00:11:25 -0000 1.279
+++ h8300.c 18 Feb 2004 00:20:08 -0000
@@ -4070,14 +4070,15 @@
operating insn. */
int
-fix_bit_operand (rtx *operands, int what, enum rtx_code code)
+fix_bit_operand (rtx *operands, enum rtx_code code)
{
/* The bit_operand predicate accepts any memory during RTL generation, but
only 'U' memory afterwards, so if this is a MEM operand, we must force
it to be valid for 'U' by reloading the address. */
- if ((what == 0 && single_zero_operand (operands[2], QImode))
- || (what == 1 && single_one_operand (operands[2], QImode)))
+ if (code == AND
+ ? single_zero_operand (operands[2], QImode)
+ : single_one_operand (operands[2], QImode))
{
/* OK to have a memory dest. */
if (GET_CODE (operands[0]) == MEM
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.267
diff -u -r1.267 h8300.md
--- h8300.md 17 Feb 2004 23:44:14 -0000 1.267
+++ h8300.md 18 Feb 2004 00:20:09 -0000
@@ -1202,7 +1202,7 @@
""
"
{
- if (fix_bit_operand (operands, 0, AND))
+ if (fix_bit_operand (operands, AND))
DONE;
}")
@@ -1298,7 +1298,7 @@
""
"
{
- if (fix_bit_operand (operands, 1, IOR))
+ if (fix_bit_operand (operands, IOR))
DONE;
}")
@@ -1339,7 +1339,7 @@
""
"
{
- if (fix_bit_operand (operands, 1, XOR))
+ if (fix_bit_operand (operands, XOR))
DONE;
}")