+2008-06-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-format.c (handle_format_attribute): Fix -Wc++-compat and/or
+ -Wcast-qual warnings.
+ * c-pragma.c (dpm_eq, handle_pragma_push_macro,
+ handle_pragma_pop_macro): Likewise.
+ * collect2.c (resolve_lib_name): Likewise.
+ * config/arc/arc.c (arc_init): Likewise.
+ * config/arm/arm.c (neon_builtin_compare,
+ locate_neon_builtin_icode): Likewise.
+ * config/arm/pe.c (arm_mark_dllexport, arm_pe_unique_section):
+ Likewise.
+ * config/bfin/bfin.c (bfin_init_machine_status,
+ bfin_optimize_loop): Likewise.
+ * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Likewise.
+ * config/cris/cris.c (cris_init_expanders): Likewise.
+ * config/darwin-c.c (frameworks_in_use, add_framework): Likewise.
+ * config/darwin.c (machopic_indirection_eq,
+ machopic_indirection_name, machopic_output_indirection):
+ Likewise.
+ * config/frv/frv.c (frv_init_machine_status, frv_compare_insns,
+ frv_io_check_address, frv_io_handle_set, frv_io_handle_use_1,
+ frv_optimize_membar): Likewise.
+ * config/i386/cygwin.h (mingw_scan,
+ GCC_DRIVER_HOST_INITIALIZATION): Likewise.
+ * config/i386/cygwin1.c (mingw_scan): Likewise.
+ * config/i386/i386.c (machopic_output_stub): Likewise.
+ * config/i386/winnt.c (gen_stdcall_or_fastcall_suffix,
+ i386_pe_unique_section): Likewise.
+ * config/ia64/ia64.c (ia64_init_machine_status,
+ ia64_h_i_d_extended, get_free_bundle_state, bundling, ia64_reorg):
+ Likewise.
+ * config/iq2000/iq2000.c, iq2000_init_machine_status): Likewise.
+ * config/m68hc11/m68hc11.c (m68hc11_encode_label): Likewise.
+ * config/m68k/m68k.c (m68k_handle_option,
+ m68k_sched_md_init_global): Likewise.
+ * config/mcore/mcore.c (mcore_mark_dllexport,
+ mcore_mark_dllimport, mcore_unique_section): Likewise.
+ * config/mips/mips.c (mips_block_move_straight,
+ mips16_rewrite_pool_refs, mips_sim_wait_regs_2,
+ mips_sim_record_set): Likewise.
+ * config/mmix/mmix.c (mmix_init_machine_status,
+ mmix_encode_section_info): Likewise.
+ * config/pa/pa.c (pa_init_machine_status, hppa_encode_label):
+ Likewise.
+ * config/rs6000/rs6000.c (rs6000_init_machine_status,
+ print_operand_address, output_toc, redefine_groups,
+ rs6000_elf_encode_section_info, machopic_output_stub): Likewise.
+ * config/s390/s390.c (s390_init_machine_status): Likewise.
+ * config/score/score.c (score_block_move_straight,
+ score_block_move_loop_body): Likewise.
+ * config/sparc/sparc.c (sparc_init_machine_status): Likewise.
+ * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
+ * emit-rtl.c (find_auto_inc): Likewise.
+ * gcc.c (translate_options, process_command): Likewise.
+ * reorg.c (dbr_schedule): Likewise.
+ * sdbout.c (sdbout_start_source_file, sdbout_init): Likewise.
+ * xcoffout.c (xcoffout_declare_function): Likewise.
+
2008-06-27 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-structalias.c (find_func_aliases): Trivial fix to get
add them to FORMAT_TYPES at first use. */
if (TARGET_FORMAT_TYPES != NULL && !dynamic_format_types)
{
- dynamic_format_types = xmalloc ((n_format_types + TARGET_N_FORMAT_TYPES)
- * sizeof (dynamic_format_types[0]));
+ dynamic_format_types = XNEWVEC (format_kind_info,
+ n_format_types + TARGET_N_FORMAT_TYPES);
memcpy (dynamic_format_types, format_types_orig,
sizeof (format_types_orig));
memcpy (&dynamic_format_types[n_format_types], TARGET_FORMAT_TYPES,
static int
dpm_eq (const void *pa, const void *pb)
{
- const struct def_pragma_macro *a = pa, *b = pb;
+ const struct def_pragma_macro *const a = (const struct def_pragma_macro *) pa,
+ *const b = (const struct def_pragma_macro *) pb;
return a->hash == b->hash && strcmp (a->name, b->name) == 0;
}
dummy.name = macroname;
slot = htab_find_slot_with_hash (pushed_macro_table, &dummy,
dummy.hash, INSERT);
- c = *slot;
+ c = (struct def_pragma_macro *) *slot;
if (c == NULL)
{
- *slot = c = ggc_alloc (sizeof (struct def_pragma_macro));
+ *slot = c = GGC_NEW (struct def_pragma_macro);
c->hash = dummy.hash;
c->name = ggc_alloc_string (macroname, TREE_STRING_LENGTH (id) - 1);
c->value.prev = NULL;
else
{
struct def_pragma_macro_value *v;
- v = ggc_alloc (sizeof (struct def_pragma_macro_value));
+ v = GGC_NEW (struct def_pragma_macro_value);
*v = c->value;
c->value.prev = v;
}
dummy.hash, NO_INSERT);
if (slot == NULL)
return;
- c = *slot;
+ c = (struct def_pragma_macro *) *slot;
cpp_pop_definition (reader, c->name, c->value.value);
if (libpaths[i]->max_len > l)
l = libpaths[i]->max_len;
- lib_buf = xmalloc (l + strlen(name) + 10);
+ lib_buf = XNEWVEC (char, l + strlen(name) + 10);
for (i = 0; libpaths[i]; i++)
{
char *tmp;
/* Set the pseudo-ops for the various standard sections. */
- arc_text_section = tmp = xmalloc (strlen (arc_text_string) + sizeof (ARC_SECTION_FORMAT) + 1);
+ arc_text_section = tmp = XNEWVEC (char, strlen (arc_text_string) + sizeof (ARC_SECTION_FORMAT) + 1);
sprintf (tmp, ARC_SECTION_FORMAT, arc_text_string);
- arc_data_section = tmp = xmalloc (strlen (arc_data_string) + sizeof (ARC_SECTION_FORMAT) + 1);
+ arc_data_section = tmp = XNEWVEC (char, strlen (arc_data_string) + sizeof (ARC_SECTION_FORMAT) + 1);
sprintf (tmp, ARC_SECTION_FORMAT, arc_data_string);
- arc_rodata_section = tmp = xmalloc (strlen (arc_rodata_string) + sizeof (ARC_SECTION_FORMAT) + 1);
+ arc_rodata_section = tmp = XNEWVEC (char, strlen (arc_rodata_string) + sizeof (ARC_SECTION_FORMAT) + 1);
sprintf (tmp, ARC_SECTION_FORMAT, arc_rodata_string);
arc_init_reg_tables ();
static int
neon_builtin_compare (const void *a, const void *b)
{
- const neon_builtin_datum *key = a;
- const neon_builtin_datum *memb = b;
+ const neon_builtin_datum *const key = (const neon_builtin_datum *) a;
+ const neon_builtin_datum *const memb = (const neon_builtin_datum *) b;
unsigned int soughtcode = key->base_fcode;
if (soughtcode >= memb->base_fcode
int idx;
key.base_fcode = fcode;
- found = bsearch (&key, &neon_builtin_data[0], ARRAY_SIZE (neon_builtin_data),
+ found = (neon_builtin_datum *)
+ bsearch (&key, &neon_builtin_data[0], ARRAY_SIZE (neon_builtin_data),
sizeof (neon_builtin_data[0]), neon_builtin_compare);
gcc_assert (found);
idx = fcode - (int) found->base_fcode;
else if (arm_dllexport_name_p (oldname))
return; /* already done */
- newname = alloca (strlen (oldname) + 4);
+ newname = XALLOCAVEC (char, strlen (oldname) + 4);
sprintf (newname, "%ce.%s", ARM_PE_FLAG_CHAR, oldname);
/* We pass newname through get_identifier to ensure it has a unique
TREE_PUBLIC (decl) = 1;
}
- newname = alloca (strlen (oldname) + 11);
+ newname = XALLOCAVEC (char, strlen (oldname) + 11);
sprintf (newname, "%ci.__imp_%s", ARM_PE_FLAG_CHAR, oldname);
/* We pass newname through get_identifier to ensure it has a unique
else
prefix = ".data$";
len = strlen (name) + strlen (prefix);
- string = alloca (len + 1);
+ string = XALLOCAVEC (char, len + 1);
sprintf (string, "%s%s", prefix, name);
DECL_SECTION_NAME (decl) = build_string (len, string);
{
struct machine_function *f;
- f = ggc_alloc_cleared (sizeof (struct machine_function));
+ f = GGC_CNEW (struct machine_function);
return f;
}
if (JUMP_P (last_insn))
{
- loop_info inner = bb->aux;
+ loop_info inner = (loop_info) bb->aux;
if (inner
&& inner->outer == loop
&& inner->loop_end == last_insn
if (bfin_si_revision != -1) \
{ \
/* space of 0xnnnn and a NUL */ \
- char *buf = alloca (7); \
+ char *buf = XALLOCAVEC (char, 7); \
\
sprintf (buf, "0x%04x", bfin_si_revision); \
builtin_define_with_value ("__SILICON_REVISION__", buf, 0); \
static struct machine_function *
cris_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (struct machine_function));
+ return GGC_CNEW (struct machine_function);
}
/* Split a 2 word move (DI or presumably DF) into component parts.
BAD ("junk at end of '#pragma ms_struct'");
}
-static struct {
+static struct frameworks_in_use {
size_t len;
const char *name;
cpp_dir* dir;
{
max_frameworks = i*2;
max_frameworks += i == 0;
- frameworks_in_use = xrealloc (frameworks_in_use,
- max_frameworks*sizeof(*frameworks_in_use));
+ frameworks_in_use = XRESIZEVEC (struct frameworks_in_use,
+ frameworks_in_use, max_frameworks);
}
dir_name = XNEWVEC (char, len + 1);
memcpy (dir_name, name, len);
static int
machopic_indirection_eq (const void *slot, const void *key)
{
- return strcmp (((const machopic_indirection *) slot)->ptr_name, key) == 0;
+ return strcmp (((const machopic_indirection *) slot)->ptr_name,
+ (const char *) key) == 0;
}
/* Return the name of the non-lazy pointer (if STUB_P is false) or
else
suffix = NON_LAZY_POINTER_SUFFIX;
- buffer = alloca (strlen ("&L")
+ buffer = XALLOCAVEC (char, strlen ("&L")
+ strlen (prefix)
+ namelen
+ strlen (suffix)
sym_name = IDENTIFIER_POINTER (id);
}
- sym = alloca (strlen (sym_name) + 2);
+ sym = XALLOCAVEC (char, strlen (sym_name) + 2);
if (sym_name[0] == '*' || sym_name[0] == '&')
strcpy (sym, sym_name + 1);
else if (sym_name[0] == '-' || sym_name[0] == '+')
else
sprintf (sym, "%s%s", user_label_prefix, sym_name);
- stub = alloca (strlen (ptr_name) + 2);
+ stub = XALLOCAVEC (char, strlen (ptr_name) + 2);
if (ptr_name[0] == '*' || ptr_name[0] == '&')
strcpy (stub, ptr_name + 1);
else
static struct machine_function *
frv_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (struct machine_function));
+ return GGC_CNEW (struct machine_function);
}
\f
/* Implement TARGET_SCHED_ISSUE_RATE. */
static int
frv_compare_insns (const void *first, const void *second)
{
- const rtx *insn1 = first, *insn2 = second;
+ const rtx *const insn1 = (rtx const *) first,
+ *const insn2 = (rtx const *) second;
return frv_insn_unit (*insn1) - frv_insn_unit (*insn2);
}
static void
frv_io_check_address (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
{
- rtx *other = data;
+ rtx *other = (rtx *) data;
if (REG_P (x) && *other != 0 && reg_overlap_mentioned_p (x, *other))
*other = 0;
static void
frv_io_handle_set (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
{
- HARD_REG_SET *set = data;
+ HARD_REG_SET *set = (HARD_REG_SET *) data;
unsigned int regno;
if (REG_P (x))
static int
frv_io_handle_use_1 (rtx *x, void *data)
{
- HARD_REG_SET *set = data;
+ HARD_REG_SET *set = (HARD_REG_SET *) data;
unsigned int regno;
if (REG_P (*x))
rtx *last_membar;
compute_bb_for_insn ();
- first_io = xcalloc (last_basic_block, sizeof (struct frv_io));
- last_membar = xcalloc (last_basic_block, sizeof (rtx));
+ first_io = XCNEWVEC (struct frv_io, last_basic_block);
+ last_membar = XCNEWVEC (rtx, last_basic_block);
FOR_EACH_BB (bb)
frv_optimize_membar_local (bb, &first_io[bb->index],
#undef GEN_CVT_ARRAY
#endif /*GEN_CVT_ARRAY*/
-void mingw_scan (int, const char * const *, char **);
+void mingw_scan (int, const char * const *, const char **);
#if 1
#define GCC_DRIVER_HOST_INITIALIZATION \
do \
{ \
- mingw_scan(argc, (const char * const *) argv, (char **) &spec_machine); \
+ mingw_scan(argc, (const char * const *) argv, &spec_machine); \
} \
while (0)
#else
void
mingw_scan (int argc ATTRIBUTE_UNUSED,
const char *const *argv,
- char **spec_machine)
+ const char **spec_machine)
{
putenv (xstrdup ("GCC_CYGWIN_MINGW=0"));
if (p)
{
int len = p - *spec_machine;
- char *s = xmalloc (strlen (*spec_machine) + 3);
+ char *s = XNEWVEC (char, strlen (*spec_machine) + 3);
memcpy (s, *spec_machine, len);
strcpy (s + len, "-mingw32");
*spec_machine = s;
symb = (*targetm.strip_name_encoding) (symb);
length = strlen (stub);
- binder_name = alloca (length + 32);
+ binder_name = XALLOCAVEC (char, length + 32);
GEN_BINDER_NAME_FOR_STUB (binder_name, stub, length);
length = strlen (symb);
- symbol_name = alloca (length + 32);
+ symbol_name = XALLOCAVEC (char, length + 32);
GEN_SYMBOL_NAME_FOR_SYMBOL (symbol_name, symb, length);
sprintf (lazy_ptr_name, "L%d$lz", label);
}
}
/* Assume max of 8 base 10 digits in the suffix. */
- p = new_str = alloca (1 + strlen (old_str) + 1 + 8 + 1);
+ p = new_str = XALLOCAVEC (char, 1 + strlen (old_str) + 1 + 8 + 1);
if (fastcall)
*p++ = FASTCALL_PREFIX;
sprintf (p, "%s@" HOST_WIDE_INT_PRINT_DEC, old_str, total);
else
prefix = ".data$";
len = strlen (name) + strlen (prefix);
- string = alloca (len + 1);
+ string = XALLOCAVEC (char, len + 1);
sprintf (string, "%s%s", prefix, name);
DECL_SECTION_NAME (decl) = build_string (len, string);
static struct machine_function *
ia64_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (struct machine_function));
+ return GGC_CNEW (struct machine_function);
}
\f
static enum attr_itanium_class ia64_safe_itanium_class (rtx);
{
int new_max_uid = get_max_uid () + 1;
- spec_check_no = xrecalloc (spec_check_no, new_max_uid,
+ spec_check_no = (int *) xrecalloc (spec_check_no, new_max_uid,
max_uid, sizeof (*spec_check_no));
max_uid = new_max_uid;
}
{
int new_clocks_length = get_max_uid () + 1;
- stops_p = xrecalloc (stops_p, new_clocks_length, clocks_length, 1);
+ stops_p = (char *) xrecalloc (stops_p, new_clocks_length, clocks_length, 1);
if (ia64_tune == PROCESSOR_ITANIUM)
{
- clocks = xrecalloc (clocks, new_clocks_length, clocks_length,
- sizeof (int));
- add_cycles = xrecalloc (add_cycles, new_clocks_length, clocks_length,
- sizeof (int));
+ clocks = (int *) xrecalloc (clocks, new_clocks_length, clocks_length,
+ sizeof (int));
+ add_cycles = (int *) xrecalloc (add_cycles, new_clocks_length,
+ clocks_length, sizeof (int));
}
clocks_length = new_clocks_length;
}
else
{
- result = xmalloc (sizeof (struct bundle_state));
+ result = XNEW (struct bundle_state);
result->dfa_state = xmalloc (dfa_state_size);
result->allocated_states_chain = allocated_bundle_states_chain;
allocated_bundle_states_chain = result;
bundling_p = 1;
dfa_clean_insn_cache ();
initiate_bundle_state_table ();
- index_to_bundle_states = xmalloc ((insn_num + 2)
- * sizeof (struct bundle_state *));
+ index_to_bundle_states = XNEWVEC (struct bundle_state *, insn_num + 2);
/* First (forward) pass -- generation of bundle states. */
curr_state = get_free_bundle_state ();
curr_state->insn = NULL;
PREV_INSN (ia64_nop) = NEXT_INSN (ia64_nop) = NULL_RTX;
recog_memoized (ia64_nop);
clocks_length = get_max_uid () + 1;
- stops_p = xcalloc (1, clocks_length);
+ stops_p = XCNEWVEC (char, clocks_length);
if (ia64_tune == PROCESSOR_ITANIUM)
{
- clocks = xcalloc (clocks_length, sizeof (int));
- add_cycles = xcalloc (clocks_length, sizeof (int));
+ clocks = XCNEWVEC (int, clocks_length);
+ add_cycles = XCNEWVEC (int, clocks_length);
}
if (ia64_tune == PROCESSOR_ITANIUM2)
{
{
struct machine_function *f;
- f = ggc_alloc_cleared (sizeof (struct machine_function));
+ f = GGC_CNEW (struct machine_function);
return f;
}
{
const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
int len = strlen (str);
- char *newstr = alloca (len + 2);
+ char *newstr = XALLOCAVEC (char, len + 2);
newstr[0] = '@';
strcpy (&newstr[1], str);
error ("-mshared-library-id=%s is not between 0 and %d",
arg, MAX_LIBRARY_ID);
else
- asprintf ((char **) &m68k_library_id_string, "%d", (value * -4) - 4);
+ {
+ char *tmp;
+ asprintf (&tmp, "%d", (value * -4) - 4);
+ m68k_library_id_string = tmp;
+ }
return true;
default:
{
rtx insn;
- sched_branch_type = xcalloc (get_max_uid () + 1,
- sizeof (*sched_branch_type));
+ sched_branch_type = XCNEWVEC (enum attr_type, get_max_uid () + 1);
for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
{
case CPU_CFV3:
max_insn_size = 3;
sched_ib.records.n_insns = 8;
- sched_ib.records.adjust = xmalloc (sched_ib.records.n_insns
- * sizeof (*sched_ib.records.adjust));
+ sched_ib.records.adjust = XNEWVEC (int, sched_ib.records.n_insns);
break;
default:
if (mcore_dllexport_name_p (oldname))
return; /* Already done. */
- newname = alloca (strlen (oldname) + 4);
+ newname = XALLOCAVEC (char, strlen (oldname) + 4);
sprintf (newname, "@e.%s", oldname);
/* We pass newname through get_identifier to ensure it has a unique
TREE_PUBLIC (decl) = 1;
}
- newname = alloca (strlen (oldname) + 11);
+ newname = XALLOCAVEC (char, strlen (oldname) + 11);
sprintf (newname, "@i.__imp_%s", oldname);
/* We pass newname through get_identifier to ensure it has a unique
prefix = ".data$";
len = strlen (name) + strlen (prefix);
- string = alloca (len + 1);
+ string = XALLOCAVEC (char, len + 1);
sprintf (string, "%s%s", prefix, name);
delta = bits / BITS_PER_UNIT;
/* Allocate a buffer for the temporary registers. */
- regs = alloca (sizeof (rtx) * length / delta);
+ regs = XALLOCAVEC (rtx, length / delta);
/* Load as many BITS-sized chunks as possible. Use a normal load if
the source has enough alignment, otherwise use left/right pairs. */
static int
mips16_rewrite_pool_refs (rtx *x, void *data)
{
- struct mips16_rewrite_pool_refs_info *info = data;
+ struct mips16_rewrite_pool_refs_info *info =
+ (struct mips16_rewrite_pool_refs_info *) data;
if (force_to_mem_operand (*x, Pmode))
{
mips_sim_wait_regs_2 (rtx *x, void *data)
{
if (REG_P (*x))
- mips_sim_wait_reg (data, mips_sim_insn, *x);
+ mips_sim_wait_reg ((struct mips_sim *) data, mips_sim_insn, *x);
return 0;
}
{
struct mips_sim *state;
- state = data;
+ state = (struct mips_sim *) data;
if (REG_P (x))
{
unsigned int regno, end_regno;
static struct machine_function *
mmix_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (struct machine_function));
+ return GGC_CNEW (struct machine_function);
}
/* DATA_ALIGNMENT.
const char *str = XSTR (XEXP (rtl, 0), 0);
int len = strlen (str);
- char *newstr = alloca (len + 2);
+ char *newstr = XALLOCAVEC (char, len + 2);
newstr[0] = '@';
strcpy (newstr + 1, str);
XSTR (XEXP (rtl, 0), 0) = ggc_alloc_string (newstr, len + 1);
static struct machine_function *
pa_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (machine_function));
+ return GGC_CNEW (machine_function);
}
/* If FROM is a probable pointer register, mark TO as a probable
int len = strlen (str) + 1;
char *newstr, *p;
- p = newstr = alloca (len + 1);
+ p = newstr = XALLOCAVEC (char, len + 1);
*p++ = '@';
strcpy (p, str);
static struct machine_function *
rs6000_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (machine_function));
+ return GGC_CNEW (machine_function);
}
\f
/* These macros test for integers and extract the low-order bits. */
char *newname;
name = XSTR (symref, 0);
- newname = alloca (strlen (name) + sizeof ("@toc"));
+ newname = XALLOCAVEC (char, strlen (name) + sizeof ("@toc"));
strcpy (newname, name);
strcat (newname, "@toc");
XSTR (symref, 0) = newname;
toc_hash_table = htab_create_ggc (1021, toc_hash_function,
toc_hash_eq, NULL);
- h = ggc_alloc (sizeof (*h));
+ h = GGC_NEW (struct toc_hash_struct);
h->key = x;
h->key_mode = mode;
h->labelno = labelno;
/* Initialize. */
issue_rate = rs6000_issue_rate ();
- group_insns = alloca (issue_rate * sizeof (rtx));
+ group_insns = XALLOCAVEC (rtx, issue_rate);
for (i = 0; i < issue_rate; i++)
{
group_insns[i] = 0;
{
rtx sym_ref = XEXP (rtl, 0);
size_t len = strlen (XSTR (sym_ref, 0));
- char *str = alloca (len + 2);
+ char *str = XALLOCAVEC (char, len + 2);
str[0] = '.';
memcpy (str + 1, XSTR (sym_ref, 0), len + 1);
XSTR (sym_ref, 0) = ggc_alloc_string (str, len + 1);
length = strlen (symb);
- symbol_name = alloca (length + 32);
+ symbol_name = XALLOCAVEC (char, length + 32);
GEN_SYMBOL_NAME_FOR_SYMBOL (symbol_name, symb, length);
- lazy_ptr_name = alloca (length + 32);
+ lazy_ptr_name = XALLOCAVEC (char, length + 32);
GEN_LAZY_PTR_NAME_FOR_SYMBOL (lazy_ptr_name, symb, length);
if (flag_pic == 2)
fprintf (file, "\t.indirect_symbol %s\n", symbol_name);
label++;
- local_label_0 = alloca (sizeof ("\"L00000000000$spb\""));
+ local_label_0 = XALLOCAVEC (char, sizeof ("\"L00000000000$spb\""));
sprintf (local_label_0, "\"L%011d$spb\"", label);
fprintf (file, "\tmflr r0\n");
static struct machine_function *
s390_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (struct machine_function));
+ return GGC_CNEW (struct machine_function);
}
/* Change optimizations to be performed, depending on the
length -= leftover;
reg_count = length / UNITS_PER_WORD;
- regs = alloca (sizeof (rtx) * reg_count);
+ regs = XALLOCAVEC (rtx, reg_count);
for (i = 0; i < reg_count; i++)
regs[i] = gen_reg_rtx (SImode);
HOST_WIDE_INT length)
{
int reg_count = length / UNITS_PER_WORD;
- rtx *regs = alloca (sizeof (rtx) * reg_count);
+ rtx *regs = XALLOCAVEC (rtx, reg_count);
int i;
bool src_unaligned = (src_align < BITS_PER_WORD);
bool dst_unaligned = (dst_align < BITS_PER_WORD);
static struct machine_function *
sparc_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (struct machine_function));
+ return GGC_CNEW (struct machine_function);
}
/* Locate some local-dynamic symbol still in use by this function
static struct machine_function *
xtensa_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (struct machine_function));
+ return GGC_CNEW (struct machine_function);
}
find_auto_inc (rtx *xp, void *data)
{
rtx x = *xp;
- rtx reg = data;
+ rtx reg = (rtx) data;
if (GET_RTX_CLASS (GET_CODE (x)) != RTX_AUTOINC)
return 0;
}
newvsize += spaces * sizeof (const char *);
- newv = xrealloc (newv, newvsize);
+ newv = XRESIZEVAR (const char *, newv, newvsize);
sp = target_option_translations[tott_idx].replacements;
np = xstrdup (sp);
for (j = 0; j < ARRAY_SIZE (modify_target); j++)
if (! strcmp (argv[i], modify_target[j].sw))
{
- char *new_name = xmalloc (strlen (modify_target[j].str)
+ char *new_name = XNEWVEC (char, strlen (modify_target[j].str)
+ strlen (spec_machine));
const char *p, *r;
char *q;
epilogue_insn = insn;
}
- uid_to_ruid = xmalloc ((max_uid + 1) * sizeof (int));
+ uid_to_ruid = XNEWVEC (int, max_uid + 1);
for (i = 0, insn = first; insn; i++, insn = NEXT_INSN (insn))
uid_to_ruid[INSN_UID (insn)] = i;
if (unfilled_firstobj == 0)
{
gcc_obstack_init (&unfilled_slots_obstack);
- unfilled_firstobj = obstack_alloc (&unfilled_slots_obstack, 0);
+ unfilled_firstobj = XOBNEWVAR (&unfilled_slots_obstack, rtx, 0);
}
for (insn = next_active_insn (first); insn; insn = next_active_insn (insn))
obstack_free (&unfilled_slots_obstack, unfilled_firstobj);
/* It is not clear why the line below is needed, but it does seem to be. */
- unfilled_firstobj = obstack_alloc (&unfilled_slots_obstack, 0);
+ unfilled_firstobj = XOBNEWVAR (&unfilled_slots_obstack, rtx, 0);
if (dump_file)
{
const char *filename ATTRIBUTE_UNUSED)
{
#ifdef MIPS_DEBUGGING_INFO
- struct sdb_file *n = xmalloc (sizeof *n);
+ struct sdb_file *n = XNEW (struct sdb_file);
n->next = current_file;
n->name = filename;
tree t;
#ifdef MIPS_DEBUGGING_INFO
- current_file = xmalloc (sizeof *current_file);
+ current_file = XNEW (struct sdb_file);
current_file->next = NULL;
current_file->name = input_file_name;
#endif
len = strlen (name);
if (name[len - 1] == ']')
{
- char *n = alloca (len - 3);
+ char *n = XALLOCAVEC (char, len - 3);
memcpy (n, name, len - 4);
n[len - 4] = '\0';
name = n;