diff options
author | Richard Guenther <rguenther@suse.de> | 2009-10-20 14:15:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-10-20 14:15:52 +0000 |
commit | b78cd8859a15ad7dffd57a4f0be481c2e2762da6 (patch) | |
tree | 322a27d1030541cab9540d8239d50c48f6395e03 /gcc/ggc-page.c | |
parent | 8345c8e4278ecde5c20a1825d136e941833f04dc (diff) | |
download | gcc-b78cd8859a15ad7dffd57a4f0be481c2e2762da6.tar.gz |
ggc-page.c: Include cfgloop.h.
2009-10-20 Richard Guenther <rguenther@suse.de>
* ggc-page.c: Include cfgloop.h.
(struct max_alignment): Drop long double, add void *.
(extra_order_size_table): Add low non-power-of-two multiples
of MAX_ALIGNMENT. Drop small type-based entries, add
tree_type, cgraph_node and loop.
* alloc-pool.c (struct allocation_object_def): Drop long double
aligning element.
From-SVN: r153014
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r-- | gcc/ggc-page.c | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 744355e3de3..adb32880cfa 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see #include "timevar.h" #include "params.h" #include "tree-flow.h" +#include "cfgloop.h" #include "plugin.h" /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a @@ -157,6 +158,24 @@ along with GCC; see the file COPYING3. If not see #define OFFSET_TO_BIT(OFFSET, ORDER) \ (((OFFSET) * DIV_MULT (ORDER)) >> DIV_SHIFT (ORDER)) +/* We use this structure to determine the alignment required for + allocations. For power-of-two sized allocations, that's not a + problem, but it does matter for odd-sized allocations. + We do not care about alignment for floating-point types. */ + +struct max_alignment { + char c; + union { + HOST_WIDEST_INT i; + void *p; + } u; +}; + +/* The biggest alignment required. */ + +#define MAX_ALIGNMENT (offsetof (struct max_alignment, u)) + + /* The number of extra orders, not corresponding to power-of-two sized objects. */ @@ -173,42 +192,35 @@ along with GCC; see the file COPYING3. If not see thing you need to do to add a new special allocation size. */ static const size_t extra_order_size_table[] = { - sizeof (struct var_ann_d), + /* Extra orders for small non-power-of-two multiples of MAX_ALIGNMENT. + There are a lot of structures with these sizes and explicitly + listing them risks orders being dropped because they changed size. */ + MAX_ALIGNMENT * 3, + MAX_ALIGNMENT * 5, + MAX_ALIGNMENT * 6, + MAX_ALIGNMENT * 7, + MAX_ALIGNMENT * 9, + MAX_ALIGNMENT * 10, + MAX_ALIGNMENT * 11, + MAX_ALIGNMENT * 12, + MAX_ALIGNMENT * 13, + MAX_ALIGNMENT * 14, + MAX_ALIGNMENT * 15, sizeof (struct tree_decl_non_common), sizeof (struct tree_field_decl), sizeof (struct tree_parm_decl), sizeof (struct tree_var_decl), - sizeof (struct tree_list), - sizeof (struct tree_ssa_name), + sizeof (struct tree_type), sizeof (struct function), sizeof (struct basic_block_def), - sizeof (bitmap_element), - sizeof (bitmap_head), - TREE_EXP_SIZE (2), - RTL_SIZE (2), /* MEM, PLUS, etc. */ - RTL_SIZE (9), /* INSN */ + sizeof (struct cgraph_node), + sizeof (struct loop), }; /* The total number of orders. */ #define NUM_ORDERS (HOST_BITS_PER_PTR + NUM_EXTRA_ORDERS) -/* We use this structure to determine the alignment required for - allocations. For power-of-two sized allocations, that's not a - problem, but it does matter for odd-sized allocations. */ - -struct max_alignment { - char c; - union { - HOST_WIDEST_INT i; - long double d; - } u; -}; - -/* The biggest alignment required. */ - -#define MAX_ALIGNMENT (offsetof (struct max_alignment, u)) - /* Compute the smallest nonnegative number which when added to X gives a multiple of F. */ |