aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2014-08-01 02:51:57 +0000
committerAndi Kleen <ak@gcc.gnu.org>2014-08-01 02:51:57 +0000
commitf768061c4c0d179bb44984e1c20a3bee15faeb1a (patch)
treee3029eaf9c62844fda4c9e4772c56a84c9882344 /gcc/rtl.c
parent50de5793fc6004bb8bf6f00e0f02e318f242ca2d (diff)
downloadgcc-f768061c4c0d179bb44984e1c20a3bee15faeb1a.zip
gcc-f768061c4c0d179bb44984e1c20a3bee15faeb1a.tar.gz
gcc-f768061c4c0d179bb44984e1c20a3bee15faeb1a.tar.bz2
RTL & dwarf2out changes
Convert dwarf2out and rtl.c to the new inchash interface. gcc/: 2014-07-31 Andi Kleen <ak@linux.intel.com> * Makefile.in (OBJS): Add rtlhash.o * dwarf2out.c (addr_table_entry_do_hash): Convert to inchash. (loc_checksum): Dito. (loc_checksum_ordered): Dito. (hash_loc_operands): Dito. (hash_locs): Dito. (hash_loc_list): Dito. * rtl.c (iterative_hash_rtx): Moved to rtlhash.c * rtl.h (iterative_hash_rtx): Moved to rtlhash.h * rtlhash.c: New file. * rtlhash.h: New file. From-SVN: r213395
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r--gcc/rtl.c79
1 files changed, 1 insertions, 78 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 520f9a8..3363eeb 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#ifdef GENERATOR_FILE
# include "errors.h"
#else
+# include "rtlhash.h"
# include "diagnostic-core.h"
#endif
@@ -654,84 +655,6 @@ rtx_equal_p (const_rtx x, const_rtx y)
return 1;
}
-/* Iteratively hash rtx X. */
-
-hashval_t
-iterative_hash_rtx (const_rtx x, hashval_t hash)
-{
- enum rtx_code code;
- enum machine_mode mode;
- int i, j;
- const char *fmt;
-
- if (x == NULL_RTX)
- return hash;
- code = GET_CODE (x);
- hash = iterative_hash_object (code, hash);
- mode = GET_MODE (x);
- hash = iterative_hash_object (mode, hash);
- switch (code)
- {
- case REG:
- i = REGNO (x);
- return iterative_hash_object (i, hash);
- case CONST_INT:
- return iterative_hash_object (INTVAL (x), hash);
- case CONST_WIDE_INT:
- for (i = 0; i < CONST_WIDE_INT_NUNITS (x); i++)
- hash = iterative_hash_object (CONST_WIDE_INT_ELT (x, i), hash);
- return hash;
- case SYMBOL_REF:
- if (XSTR (x, 0))
- return iterative_hash (XSTR (x, 0), strlen (XSTR (x, 0)) + 1,
- hash);
- return hash;
- case LABEL_REF:
- case DEBUG_EXPR:
- case VALUE:
- case SCRATCH:
- case CONST_DOUBLE:
- case CONST_FIXED:
- case DEBUG_IMPLICIT_PTR:
- case DEBUG_PARAMETER_REF:
- return hash;
- default:
- break;
- }
-
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- switch (fmt[i])
- {
- case 'w':
- hash = iterative_hash_object (XWINT (x, i), hash);
- break;
- case 'n':
- case 'i':
- hash = iterative_hash_object (XINT (x, i), hash);
- break;
- case 'V':
- case 'E':
- j = XVECLEN (x, i);
- hash = iterative_hash_object (j, hash);
- for (j = 0; j < XVECLEN (x, i); j++)
- hash = iterative_hash_rtx (XVECEXP (x, i, j), hash);
- break;
- case 'e':
- hash = iterative_hash_rtx (XEXP (x, i), hash);
- break;
- case 'S':
- case 's':
- if (XSTR (x, i))
- hash = iterative_hash (XSTR (x, 0), strlen (XSTR (x, 0)) + 1,
- hash);
- break;
- default:
- break;
- }
- return hash;
-}
-
void
dump_rtx_statistics (void)
{