aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-02-25 08:59:10 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-02-25 08:59:10 +0000
commit84053e02c03caa3afb572e41f347f7a94b908c3a (patch)
tree3865f08b7dd05cdeedbb9072627f9628d56e0850 /gcc
parent4094757e4be196c5a0f059e96ad149263c60555e (diff)
downloadgcc-84053e02c03caa3afb572e41f347f7a94b908c3a.zip
gcc-84053e02c03caa3afb572e41f347f7a94b908c3a.tar.gz
gcc-84053e02c03caa3afb572e41f347f7a94b908c3a.tar.bz2
re PR middle-end/60291 (slow compile times for any mode (-O0/-O1/-O2) on large .c source file (30MBs))
2014-02-25 Richard Biener <rguenther@suse.de> PR middle-end/60291 * emit-rtl.c (mem_attrs_htab): Remove. (mem_attrs_htab_hash): Likewise. (mem_attrs_htab_eq): Likewise. (set_mem_attrs): Always allocate new mem-attrs when something changed. (init_emit_once): Do not allocate mem_attrs_htab. From-SVN: r208113
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/emit-rtl.c44
2 files changed, 14 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a7efc65..499fb33 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
2014-02-25 Richard Biener <rguenther@suse.de>
+ PR middle-end/60291
+ * emit-rtl.c (mem_attrs_htab): Remove.
+ (mem_attrs_htab_hash): Likewise.
+ (mem_attrs_htab_eq): Likewise.
+ (set_mem_attrs): Always allocate new mem-attrs when something
+ changed.
+ (init_emit_once): Do not allocate mem_attrs_htab.
+
+2014-02-25 Richard Biener <rguenther@suse.de>
+
PR lto/60319
* lto-opts.c (lto_write_options): Output non-explicit conservative
-fwrapv, -fno-trapv and -fno-strict-overflow.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index dc1408b..4736f8d 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -126,10 +126,6 @@ rtx cc0_rtx;
static GTY ((if_marked ("ggc_marked_p"), param_is (struct rtx_def)))
htab_t const_int_htab;
-/* A hash table storing memory attribute structures. */
-static GTY ((if_marked ("ggc_marked_p"), param_is (struct mem_attrs)))
- htab_t mem_attrs_htab;
-
/* A hash table storing register attribute structures. */
static GTY ((if_marked ("ggc_marked_p"), param_is (struct reg_attrs)))
htab_t reg_attrs_htab;
@@ -157,8 +153,6 @@ static rtx lookup_const_double (rtx);
static hashval_t const_fixed_htab_hash (const void *);
static int const_fixed_htab_eq (const void *, const void *);
static rtx lookup_const_fixed (rtx);
-static hashval_t mem_attrs_htab_hash (const void *);
-static int mem_attrs_htab_eq (const void *, const void *);
static hashval_t reg_attrs_htab_hash (const void *);
static int reg_attrs_htab_eq (const void *, const void *);
static reg_attrs *get_reg_attrs (tree, int);
@@ -249,20 +243,6 @@ const_fixed_htab_eq (const void *x, const void *y)
return fixed_identical (CONST_FIXED_VALUE (a), CONST_FIXED_VALUE (b));
}
-/* Returns a hash code for X (which is a really a mem_attrs *). */
-
-static hashval_t
-mem_attrs_htab_hash (const void *x)
-{
- const mem_attrs *const p = (const mem_attrs *) x;
-
- return (p->alias ^ (p->align * 1000)
- ^ (p->addrspace * 4000)
- ^ ((p->offset_known_p ? p->offset : 0) * 50000)
- ^ ((p->size_known_p ? p->size : 0) * 2500000)
- ^ (size_t) iterative_hash_expr (p->expr, 0));
-}
-
/* Return true if the given memory attributes are equal. */
static bool
@@ -280,23 +260,11 @@ mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
&& operand_equal_p (p->expr, q->expr, 0))));
}
-/* Returns nonzero if the value represented by X (which is really a
- mem_attrs *) is the same as that given by Y (which is also really a
- mem_attrs *). */
-
-static int
-mem_attrs_htab_eq (const void *x, const void *y)
-{
- return mem_attrs_eq_p ((const mem_attrs *) x, (const mem_attrs *) y);
-}
-
/* Set MEM's memory attributes so that they are the same as ATTRS. */
static void
set_mem_attrs (rtx mem, mem_attrs *attrs)
{
- void **slot;
-
/* If everything is the default, we can just clear the attributes. */
if (mem_attrs_eq_p (attrs, mode_mem_attrs[(int) GET_MODE (mem)]))
{
@@ -304,14 +272,12 @@ set_mem_attrs (rtx mem, mem_attrs *attrs)
return;
}
- slot = htab_find_slot (mem_attrs_htab, attrs, INSERT);
- if (*slot == 0)
+ if (!MEM_ATTRS (mem)
+ || !mem_attrs_eq_p (attrs, MEM_ATTRS (mem)))
{
- *slot = ggc_alloc_mem_attrs ();
- memcpy (*slot, attrs, sizeof (mem_attrs));
+ MEM_ATTRS (mem) = ggc_alloc_mem_attrs ();
+ memcpy (MEM_ATTRS (mem), attrs, sizeof (mem_attrs));
}
-
- MEM_ATTRS (mem) = (mem_attrs *) *slot;
}
/* Returns a hash code for X (which is a really a reg_attrs *). */
@@ -5665,8 +5631,6 @@ init_emit_once (void)
const_fixed_htab = htab_create_ggc (37, const_fixed_htab_hash,
const_fixed_htab_eq, NULL);
- mem_attrs_htab = htab_create_ggc (37, mem_attrs_htab_hash,
- mem_attrs_htab_eq, NULL);
reg_attrs_htab = htab_create_ggc (37, reg_attrs_htab_hash,
reg_attrs_htab_eq, NULL);