* alloc-pool.c (create_alloc_pool): Fix -Wc++-compat warnings.
* df-scan.c (df_notes_rescan): Likewise.
* ggc-page.c (set_page_table_entry): Likewise.
* intl.c (gcc_gettext_width): Likewise.
* varasm.c (get_unnamed_section, get_noswitch_section,
get_section): Likewise.
From-SVN: r137245
+2008-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alloc-pool.c (create_alloc_pool): Fix -Wc++-compat warnings.
+ * df-scan.c (df_notes_rescan): Likewise.
+ * ggc-page.c (set_page_table_entry): Likewise.
+ * intl.c (gcc_gettext_width): Likewise.
+ * varasm.c (get_unnamed_section, get_noswitch_section,
+ get_section): Likewise.
+
2008-06-28 Andrew Jenner <andrew@codesourcery.com>
* regrename.c (build_def_use): Don't copy RTX.
create_alloc_pool (const char *name, size_t size, size_t num)
{
alloc_pool pool;
- size_t pool_size, header_size;
+ size_t header_size;
#ifdef GATHER_STATISTICS
struct alloc_pool_descriptor *desc;
#endif
/* Um, we can't really allocate 0 elements per block. */
gcc_assert (num);
- /* Find the size of the pool structure, and the name. */
- pool_size = sizeof (struct alloc_pool_def);
-
- /* and allocate that much memory. */
- pool = xmalloc (pool_size);
+ /* Allocate memory for the pool structure. */
+ pool = XNEW (struct alloc_pool_def);
/* Now init the various pieces of our pool structure. */
pool->name = /*xstrdup (name)*/name;
if (collection_rec.next_mw > num_deleted)
{
insn_info->mw_hardregs =
- xrealloc (insn_info->mw_hardregs,
- (count + 1 + collection_rec.next_mw)
- * sizeof (struct df_ref*));
+ XRESIZEVEC (struct df_mw_hardreg *,
+ insn_info->mw_hardregs,
+ count + 1 + collection_rec.next_mw);
}
memcpy (&insn_info->mw_hardregs[count], collection_rec.mw_vec,
(collection_rec.next_mw + 1) * sizeof (struct df_mw_hardreg *));
goto found;
/* Not found -- allocate a new table. */
- table = xcalloc (1, sizeof(*table));
+ table = XCNEW (struct page_table_chain);
table->next = G.lookup;
table->high_bits = high_bits;
G.lookup = table;
gcc_gettext_width (const char *msgstr)
{
size_t nwcs = mbstowcs (0, msgstr, 0);
- wchar_t *wmsgstr = alloca ((nwcs + 1) * sizeof (wchar_t));
+ wchar_t *wmsgstr = XALLOCAVEC (wchar_t, nwcs + 1);
mbstowcs (wmsgstr, msgstr, nwcs + 1);
return wcswidth (wmsgstr, nwcs);
{
section *sect;
- sect = ggc_alloc (sizeof (struct unnamed_section));
+ sect = GGC_NEW (section);
sect->unnamed.common.flags = flags | SECTION_UNNAMED;
sect->unnamed.callback = callback;
sect->unnamed.data = data;
{
section *sect;
- sect = ggc_alloc (sizeof (struct unnamed_section));
+ sect = GGC_NEW (section);
sect->noswitch.common.flags = flags | SECTION_NOSWITCH;
sect->noswitch.callback = callback;
flags |= SECTION_NAMED;
if (*slot == NULL)
{
- sect = ggc_alloc (sizeof (struct named_section));
+ sect = GGC_NEW (section);
sect->named.common.flags = flags;
sect->named.name = ggc_strdup (name);
sect->named.decl = decl;