This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Remove count_sub_rtxs from genattrtab.c
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 23 Nov 2003 22:06:48 +0100
- Subject: [PATCH] Remove count_sub_rtxs from genattrtab.c
Hello,
the function count_sub_rtxs in genattrtab.c is unused; this patch
removes it. Commited as obvious.
Zdenek
* genattrtab.c (count_sub_rtxs): Removed.
Index: genattrtab.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genattrtab.c,v
retrieving revision 1.136
diff -c -3 -p -r1.136 genattrtab.c
*** genattrtab.c 22 Aug 2003 06:45:14 -0000 1.136
--- genattrtab.c 23 Nov 2003 21:03:49 -0000
*************** static rtx test_for_current_value (struc
*** 407,413 ****
static rtx simplify_with_current_value (rtx, struct dimension *, int);
static rtx simplify_with_current_value_aux (rtx);
static void clear_struct_flag (rtx);
- static int count_sub_rtxs (rtx, int);
static void remove_insn_ent (struct attr_value *, struct insn_ent *);
static void insert_insn_ent (struct attr_value *, struct insn_ent *);
static rtx insert_right_side (enum rtx_code, rtx, rtx, int, int);
--- 407,412 ----
*************** clear_struct_flag (rtx x)
*** 3952,4016 ****
break;
}
}
- }
-
- /* Return the number of RTX objects making up the expression X.
- But if we count more than MAX objects, stop counting. */
-
- static int
- count_sub_rtxs (rtx x, int max)
- {
- int i;
- int j;
- enum rtx_code code;
- const char *fmt;
- int total = 0;
-
- code = GET_CODE (x);
-
- switch (code)
- {
- case REG:
- case QUEUED:
- case CONST_INT:
- case CONST_DOUBLE:
- case CONST_VECTOR:
- case SYMBOL_REF:
- case CODE_LABEL:
- case PC:
- case CC0:
- case EQ_ATTR:
- case ATTR_FLAG:
- return 1;
-
- default:
- break;
- }
-
- /* Compare the elements. If any pair of corresponding elements
- fail to match, return 0 for the whole things. */
-
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- {
- if (total >= max)
- return total;
-
- switch (fmt[i])
- {
- case 'V':
- case 'E':
- for (j = 0; j < XVECLEN (x, i); j++)
- total += count_sub_rtxs (XVECEXP (x, i, j), max);
- break;
-
- case 'e':
- total += count_sub_rtxs (XEXP (x, i), max);
- break;
- }
- }
- return total;
-
}
/* Create table entries for DEFINE_ATTR. */
--- 3951,3956 ----