ggc.h (ggc_internal_alloc_stat, [...]): Add ATTRIBUTE_MALLOC.

* ggc.h (ggc_internal_alloc_stat, ggc_alloc_typed_stat,
	ggc_internal_cleared_alloc_stat, ggc_cleared_alloc_htab_ignore_args,
	ggc_cleared_alloc_ptr_array_two_args, ggc_splay_alloc): Add
	ATTRIBUTE_MALLOC.
	* alloc-pool.h (pool_alloc): Likewise.

	* final.c (final): Do not loop to find max_uid.

From-SVN: r189470
This commit is contained in:
Steven Bosscher 2012-07-13 17:51:34 +00:00
parent e4da1e17ea
commit c8b8af718c
4 changed files with 29 additions and 14 deletions

View File

@ -1,3 +1,13 @@
2012-07-13 Steven Bosscher <steven@gcc.gnu.org>
* ggc.h (ggc_internal_alloc_stat, ggc_alloc_typed_stat,
ggc_internal_cleared_alloc_stat, ggc_cleared_alloc_htab_ignore_args,
ggc_cleared_alloc_ptr_array_two_args, ggc_splay_alloc): Add
ATTRIBUTE_MALLOC.
* alloc-pool.h (pool_alloc): Likewise.
* final.c (final): Do not loop to find max_uid.
2012-07-13 Steven Bosscher <steven@gcc.gnu.org>
* emit-rtl.c (make_debug_insn_raw, make_jump_insn_raw): Make static.

View File

@ -61,7 +61,7 @@ extern alloc_pool create_alloc_pool (const char *, size_t, size_t);
extern void free_alloc_pool (alloc_pool);
extern void empty_alloc_pool (alloc_pool);
extern void free_alloc_pool_if_empty (alloc_pool *);
extern void *pool_alloc (alloc_pool);
extern void *pool_alloc (alloc_pool) ATTRIBUTE_MALLOC;
extern void pool_free (alloc_pool, void *);
extern void dump_alloc_pool_statistics (void);
#endif

View File

@ -1826,7 +1826,6 @@ void
final (rtx first, FILE *file, int optimize_p)
{
rtx insn, next;
int max_uid = 0;
int seen = 0;
/* Used for -dA dump. */
@ -1837,11 +1836,9 @@ final (rtx first, FILE *file, int optimize_p)
last_ignored_compare = 0;
#ifdef HAVE_cc0
for (insn = first; insn; insn = NEXT_INSN (insn))
{
if (INSN_UID (insn) > max_uid) /* Find largest UID. */
max_uid = INSN_UID (insn);
#ifdef HAVE_cc0
/* If CC tracking across branches is enabled, record the insn which
jumps to each branch only reached from one place. */
if (optimize_p && JUMP_P (insn))
@ -1852,8 +1849,8 @@ final (rtx first, FILE *file, int optimize_p)
LABEL_REFS (lab) = insn;
}
}
#endif
}
#endif
init_recog ();

View File

@ -143,19 +143,22 @@ extern void gt_pch_save (FILE *f);
/* Allocation. */
/* The internal primitive. */
extern void *ggc_internal_alloc_stat (size_t MEM_STAT_DECL);
extern void *ggc_internal_alloc_stat (size_t MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
extern size_t ggc_round_alloc_size (size_t requested_size);
#define ggc_internal_alloc(s) ggc_internal_alloc_stat (s MEM_STAT_INFO)
/* Allocate an object of the specified type and size. */
extern void *ggc_alloc_typed_stat (enum gt_types_enum, size_t MEM_STAT_DECL);
extern void *ggc_alloc_typed_stat (enum gt_types_enum, size_t MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
#define ggc_alloc_typed(s, z) ggc_alloc_typed_stat (s, z MEM_STAT_INFO)
/* Allocates cleared memory. */
extern void *ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL);
extern void *ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
/* Resize a block. */
extern void *ggc_realloc_stat (void *, size_t MEM_STAT_DECL);
@ -202,9 +205,11 @@ ggc_alloc_atomic_stat (size_t s MEM_STAT_DECL)
#define ggc_alloc_cleared_atomic(S) \
(ggc_internal_cleared_alloc_stat ((S) MEM_STAT_INFO))
extern void * ggc_cleared_alloc_htab_ignore_args (size_t, size_t);
extern void *ggc_cleared_alloc_htab_ignore_args (size_t, size_t)
ATTRIBUTE_MALLOC;
extern void * ggc_cleared_alloc_ptr_array_two_args (size_t, size_t);
extern void *ggc_cleared_alloc_ptr_array_two_args (size_t, size_t)
ATTRIBUTE_MALLOC;
#define htab_create_ggc(SIZE, HASH, EQ, DEL) \
htab_create_typed_alloc (SIZE, HASH, EQ, DEL, \
@ -216,7 +221,8 @@ extern void * ggc_cleared_alloc_ptr_array_two_args (size_t, size_t);
splay_tree_new_typed_alloc (COMPARE, NULL, NULL, &ALLOC_TREE, &ALLOC_NODE, \
&ggc_splay_dont_free, NULL)
extern void *ggc_splay_alloc (enum gt_types_enum, int, void *);
extern void *ggc_splay_alloc (enum gt_types_enum, int, void *)
ATTRIBUTE_MALLOC;
extern void ggc_splay_dont_free (void *, void *);
@ -276,10 +282,12 @@ extern struct alloc_zone tree_id_zone;
/* Allocate an object into the specified allocation zone. */
extern void *ggc_internal_alloc_zone_stat (size_t,
struct alloc_zone * MEM_STAT_DECL);
struct alloc_zone * MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
extern void *ggc_internal_cleared_alloc_zone_stat (size_t,
struct alloc_zone * MEM_STAT_DECL);
struct alloc_zone * MEM_STAT_DECL)
ATTRIBUTE_MALLOC;
static inline void *
ggc_internal_zone_alloc_stat (struct alloc_zone * z, size_t s MEM_STAT_DECL)