From c8b8af718c7b79ac11d346a220fc90670a293c6f Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Fri, 13 Jul 2012 17:51:34 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 10 ++++++++++ gcc/alloc-pool.h | 2 +- gcc/final.c | 7 ++----- gcc/ggc.h | 24 ++++++++++++++++-------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f54f9ba562b2..2bff39a212c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2012-07-13 Steven Bosscher + + * 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 * emit-rtl.c (make_debug_insn_raw, make_jump_insn_raw): Make static. diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h index fa9848a2b9b8..4593b70f4b3a 100644 --- a/gcc/alloc-pool.h +++ b/gcc/alloc-pool.h @@ -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 diff --git a/gcc/final.c b/gcc/final.c index 668aacb309ee..5f9a5cb7107f 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -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 (); diff --git a/gcc/ggc.h b/gcc/ggc.h index 704237cc045d..d90eec2c2078 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -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)