Commit 7cbb2a85 by Kaveh R. Ghazi Committed by Kaveh Ghazi

cse.c (approx_reg_cost_1, cse_insn): Fix -Wc++-compat and/or -Wcast-qual warnings.

	* cse.c (approx_reg_cost_1, cse_insn): Fix -Wc++-compat and/or
	-Wcast-qual warnings.
	* gcc.c (process_command): Likewise.
	* genattrtab.c (oballoc): Use XOBNEW.
	(oballocvec): Define.
	(attr_hash_add_rtx, attr_hash_add_string, attr_string,
	get_attr_value, fill_attr, make_length_attrs, gen_attr, gen_insn,
	gen_delay, find_attr, gen_insn_reserv, gen_bypass_1): Fix
	-Wc++-compat and/or -Wcast-qual warnings.
	* genautomata.c (XCREATENODE, XCREATENODEVEC, XCREATENODEVAR,
	XCOPYNODE, XCOPYNODEVEC, XCOPYNODEVAR): New.
	(gen_cpu_unit, gen_query_cpu_unit, gen_bypass, gen_excl_set,
	gen_presence_absence_set, gen_automaton, gen_regexp_el,
	gen_regexp_repeat, gen_regexp_allof, gen_regexp_oneof,
	gen_regexp_sequence, gen_reserv, gen_insn_reserv, process_excls,
	add_excls, process_presence_absence_names,
	process_presence_absence_patterns, add_presence_absence,
	process_regexp, add_advance_cycle_insn_decl, get_free_alt_state,
	get_free_state, add_arc, get_free_automata_list_el,
	form_reserv_sets_list, copy_insn_regexp, transform_1, transform_2,
	transform_3, cache_presence, create_ainsns, create_automata,
	create_state_ainsn_table, dfa_insn_code_enlarge,
	output_trans_func, output_min_issue_delay_func,
	output_dead_lock_func, output_reset_func,
	output_get_cpu_unit_code_func, output_dfa_start_func,
	expand_automata): Likewise.
	* genextract.c (gen_insn): Likewise.
	* gengtype-lex.l: Likewise.
	* gengtype.c (read_input_list, adjust_field_type,
	process_gc_options): Likewise.
	* genoutput.c (note_constraint): Likewise.
	* genpreds.c (mangle, add_constraint): Likewise.
	* genrecog.c (process_define_predicate, new_decision,
	add_to_sequence): Likewise.
	* gensupport.c (record_insn_name): Likewise.

From-SVN: r137135
parent d3bfe4de
2008-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2008-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cse.c (approx_reg_cost_1, cse_insn): Fix -Wc++-compat and/or
-Wcast-qual warnings.
* gcc.c (process_command): Likewise.
* genattrtab.c (oballoc): Use XOBNEW.
(oballocvec): Define.
(attr_hash_add_rtx, attr_hash_add_string, attr_string,
get_attr_value, fill_attr, make_length_attrs, gen_attr, gen_insn,
gen_delay, find_attr, gen_insn_reserv, gen_bypass_1): Fix
-Wc++-compat and/or -Wcast-qual warnings.
* genautomata.c (XCREATENODE, XCREATENODEVEC, XCREATENODEVAR,
XCOPYNODE, XCOPYNODEVEC, XCOPYNODEVAR): New.
(gen_cpu_unit, gen_query_cpu_unit, gen_bypass, gen_excl_set,
gen_presence_absence_set, gen_automaton, gen_regexp_el,
gen_regexp_repeat, gen_regexp_allof, gen_regexp_oneof,
gen_regexp_sequence, gen_reserv, gen_insn_reserv, process_excls,
add_excls, process_presence_absence_names,
process_presence_absence_patterns, add_presence_absence,
process_regexp, add_advance_cycle_insn_decl, get_free_alt_state,
get_free_state, add_arc, get_free_automata_list_el,
form_reserv_sets_list, copy_insn_regexp, transform_1, transform_2,
transform_3, cache_presence, create_ainsns, create_automata,
create_state_ainsn_table, dfa_insn_code_enlarge,
output_trans_func, output_min_issue_delay_func,
output_dead_lock_func, output_reset_func,
output_get_cpu_unit_code_func, output_dfa_start_func,
expand_automata): Likewise.
* genextract.c (gen_insn): Likewise.
* gengtype-lex.l: Likewise.
* gengtype.c (read_input_list, adjust_field_type,
process_gc_options): Likewise.
* genoutput.c (note_constraint): Likewise.
* genpreds.c (mangle, add_constraint): Likewise.
* genrecog.c (process_define_predicate, new_decision,
add_to_sequence): Likewise.
* gensupport.c (record_insn_name): Likewise.
2008-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* config/i386/driver-i386.c (detect_caches_amd, * config/i386/driver-i386.c (detect_caches_amd,
detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat
and/or -Wcast-qual warnings. and/or -Wcast-qual warnings.
......
...@@ -663,7 +663,7 @@ static int ...@@ -663,7 +663,7 @@ static int
approx_reg_cost_1 (rtx *xp, void *data) approx_reg_cost_1 (rtx *xp, void *data)
{ {
rtx x = *xp; rtx x = *xp;
int *cost_p = data; int *cost_p = (int *) data;
if (x && REG_P (x)) if (x && REG_P (x))
{ {
...@@ -4005,7 +4005,7 @@ cse_insn (rtx insn) ...@@ -4005,7 +4005,7 @@ cse_insn (rtx insn)
if (GET_CODE (x) == SET) if (GET_CODE (x) == SET)
{ {
sets = alloca (sizeof (struct set)); sets = XALLOCA (struct set);
sets[0].rtl = x; sets[0].rtl = x;
/* Ignore SETs that are unconditional jumps. /* Ignore SETs that are unconditional jumps.
...@@ -4040,7 +4040,7 @@ cse_insn (rtx insn) ...@@ -4040,7 +4040,7 @@ cse_insn (rtx insn)
{ {
int lim = XVECLEN (x, 0); int lim = XVECLEN (x, 0);
sets = alloca (lim * sizeof (struct set)); sets = XALLOCAVEC (struct set, lim);
/* Find all regs explicitly clobbered in this insn, /* Find all regs explicitly clobbered in this insn,
and ensure they are not replaced with any other regs and ensure they are not replaced with any other regs
......
...@@ -3409,15 +3409,14 @@ process_command (int argc, const char **argv) ...@@ -3409,15 +3409,14 @@ process_command (int argc, const char **argv)
for (baselen = strlen (progname); baselen > 0; baselen--) for (baselen = strlen (progname); baselen > 0; baselen--)
if (IS_DIR_SEPARATOR (progname[baselen-1])) if (IS_DIR_SEPARATOR (progname[baselen-1]))
break; break;
new_argv0 = (char *) xmemdup (progname, baselen, new_argv0 = XDUPVAR (char, progname, baselen,
baselen + concat_length (new_version, new_machine, baselen + concat_length (new_version, new_machine,
"-gcc-", NULL) + 1); "-gcc-", NULL) + 1);
strcpy (new_argv0 + baselen, new_machine); strcpy (new_argv0 + baselen, new_machine);
strcat (new_argv0, "-gcc-"); strcat (new_argv0, "-gcc-");
strcat (new_argv0, new_version); strcat (new_argv0, new_version);
new_argv = (char **) xmemdup (argv, (argc + 1) * sizeof (argv[0]), new_argv = XDUPVEC (char *, argv, argc + 1);
(argc + 1) * sizeof (argv[0]));
new_argv[0] = new_argv0; new_argv[0] = new_argv0;
execvp (new_argv0, new_argv); execvp (new_argv0, new_argv);
......
...@@ -286,7 +286,8 @@ static rtx one_fn (rtx); ...@@ -286,7 +286,8 @@ static rtx one_fn (rtx);
static rtx max_fn (rtx); static rtx max_fn (rtx);
static rtx min_fn (rtx); static rtx min_fn (rtx);
#define oballoc(size) obstack_alloc (hash_obstack, size) #define oballoc(T) XOBNEW (hash_obstack, T)
#define oballocvec(T, N) XOBNEWVEC (hash_obstack, T, (N))
/* Hash table for sharing RTL and strings. */ /* Hash table for sharing RTL and strings. */
...@@ -326,7 +327,7 @@ attr_hash_add_rtx (int hashcode, rtx rtl) ...@@ -326,7 +327,7 @@ attr_hash_add_rtx (int hashcode, rtx rtl)
{ {
struct attr_hash *h; struct attr_hash *h;
h = obstack_alloc (hash_obstack, sizeof (struct attr_hash)); h = XOBNEW (hash_obstack, struct attr_hash);
h->hashcode = hashcode; h->hashcode = hashcode;
h->u.rtl = rtl; h->u.rtl = rtl;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE]; h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
...@@ -340,7 +341,7 @@ attr_hash_add_string (int hashcode, char *str) ...@@ -340,7 +341,7 @@ attr_hash_add_string (int hashcode, char *str)
{ {
struct attr_hash *h; struct attr_hash *h;
h = obstack_alloc (hash_obstack, sizeof (struct attr_hash)); h = XOBNEW (hash_obstack, struct attr_hash);
h->hashcode = -hashcode; h->hashcode = -hashcode;
h->u.str = str; h->u.str = str;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE]; h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
...@@ -601,7 +602,7 @@ attr_string (const char *str, int len) ...@@ -601,7 +602,7 @@ attr_string (const char *str, int len)
return h->u.str; /* <-- return if found. */ return h->u.str; /* <-- return if found. */
/* Not found; create a permanent copy and add it to the hash table. */ /* Not found; create a permanent copy and add it to the hash table. */
new_str = obstack_alloc (hash_obstack, len + 1); new_str = XOBNEWVAR (hash_obstack, char, len + 1);
memcpy (new_str, str, len); memcpy (new_str, str, len);
new_str[len] = '\0'; new_str[len] = '\0';
attr_hash_add_string (hashcode, new_str); attr_hash_add_string (hashcode, new_str);
...@@ -1297,7 +1298,7 @@ get_attr_value (rtx value, struct attr_desc *attr, int insn_code) ...@@ -1297,7 +1298,7 @@ get_attr_value (rtx value, struct attr_desc *attr, int insn_code)
|| insn_alternatives[av->first_insn->def->insn_code])) || insn_alternatives[av->first_insn->def->insn_code]))
return av; return av;
av = oballoc (sizeof (struct attr_value)); av = oballoc (struct attr_value);
av->value = value; av->value = value;
av->next = attr->first_value; av->next = attr->first_value;
attr->first_value = av; attr->first_value = av;
...@@ -1440,7 +1441,7 @@ fill_attr (struct attr_desc *attr) ...@@ -1440,7 +1441,7 @@ fill_attr (struct attr_desc *attr)
else else
av = get_attr_value (value, attr, id->insn_code); av = get_attr_value (value, attr, id->insn_code);
ie = oballoc (sizeof (struct insn_ent)); ie = oballoc (struct insn_ent);
ie->def = id; ie->def = id;
insert_insn_ent (av, ie); insert_insn_ent (av, ie);
} }
...@@ -1571,7 +1572,7 @@ make_length_attrs (void) ...@@ -1571,7 +1572,7 @@ make_length_attrs (void)
no_address_fn[i], no_address_fn[i],
address_fn[i]), address_fn[i]),
new_attr, ie->def->insn_code); new_attr, ie->def->insn_code);
new_ie = oballoc (sizeof (struct insn_ent)); new_ie = oballoc (struct insn_ent);
new_ie->def = ie->def; new_ie->def = ie->def;
insert_insn_ent (new_av, new_ie); insert_insn_ent (new_av, new_ie);
} }
...@@ -2949,7 +2950,7 @@ gen_attr (rtx exp, int lineno) ...@@ -2949,7 +2950,7 @@ gen_attr (rtx exp, int lineno)
name_ptr = XSTR (exp, 1); name_ptr = XSTR (exp, 1);
while ((p = next_comma_elt (&name_ptr)) != NULL) while ((p = next_comma_elt (&name_ptr)) != NULL)
{ {
av = oballoc (sizeof (struct attr_value)); av = oballoc (struct attr_value);
av->value = attr_rtx (CONST_STRING, p); av->value = attr_rtx (CONST_STRING, p);
av->next = attr->first_value; av->next = attr->first_value;
attr->first_value = av; attr->first_value = av;
...@@ -3062,7 +3063,7 @@ gen_insn (rtx exp, int lineno) ...@@ -3062,7 +3063,7 @@ gen_insn (rtx exp, int lineno)
{ {
struct insn_def *id; struct insn_def *id;
id = oballoc (sizeof (struct insn_def)); id = oballoc (struct insn_def);
id->next = defs; id->next = defs;
defs = id; defs = id;
id->def = exp; id->def = exp;
...@@ -3126,7 +3127,7 @@ gen_delay (rtx def, int lineno) ...@@ -3126,7 +3127,7 @@ gen_delay (rtx def, int lineno)
have_annul_false = 1; have_annul_false = 1;
} }
delay = oballoc (sizeof (struct delay_desc)); delay = oballoc (struct delay_desc);
delay->def = def; delay->def = def;
delay->num = ++num_delays; delay->num = ++num_delays;
delay->next = delays; delay->next = delays;
...@@ -4158,7 +4159,7 @@ find_attr (const char **name_p, int create) ...@@ -4158,7 +4159,7 @@ find_attr (const char **name_p, int create)
if (! create) if (! create)
return NULL; return NULL;
attr = oballoc (sizeof (struct attr_desc)); attr = oballoc (struct attr_desc);
attr->name = DEF_ATTR_STRING (name); attr->name = DEF_ATTR_STRING (name);
attr->first_value = attr->default_val = NULL; attr->first_value = attr->default_val = NULL;
attr->is_numeric = attr->is_const = attr->is_special = 0; attr->is_numeric = attr->is_const = attr->is_special = 0;
...@@ -4297,7 +4298,7 @@ static size_t n_insn_reservs; ...@@ -4297,7 +4298,7 @@ static size_t n_insn_reservs;
static void static void
gen_insn_reserv (rtx def) gen_insn_reserv (rtx def)
{ {
struct insn_reserv *decl = oballoc (sizeof (struct insn_reserv)); struct insn_reserv *decl = oballoc (struct insn_reserv);
decl->name = DEF_ATTR_STRING (XSTR (def, 0)); decl->name = DEF_ATTR_STRING (XSTR (def, 0));
decl->default_latency = XINT (def, 1); decl->default_latency = XINT (def, 1);
...@@ -4338,7 +4339,7 @@ gen_bypass_1 (const char *s, size_t len) ...@@ -4338,7 +4339,7 @@ gen_bypass_1 (const char *s, size_t len)
if (s == b->insn) if (s == b->insn)
return; /* already got that one */ return; /* already got that one */
b = oballoc (sizeof (struct bypass_list)); b = oballoc (struct bypass_list);
b->insn = s; b->insn = s;
b->next = all_bypasses; b->next = all_bypasses;
all_bypasses = b; all_bypasses = b;
...@@ -4544,13 +4545,13 @@ from the machine description file `md'. */\n\n"); ...@@ -4544,13 +4545,13 @@ from the machine description file `md'. */\n\n");
printf ("#define operands recog_data.operand\n\n"); printf ("#define operands recog_data.operand\n\n");
/* Make `insn_alternatives'. */ /* Make `insn_alternatives'. */
insn_alternatives = oballoc (insn_code_number * sizeof (int)); insn_alternatives = oballocvec (int, insn_code_number);
for (id = defs; id; id = id->next) for (id = defs; id; id = id->next)
if (id->insn_code >= 0) if (id->insn_code >= 0)
insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1; insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1;
/* Make `insn_n_alternatives'. */ /* Make `insn_n_alternatives'. */
insn_n_alternatives = oballoc (insn_code_number * sizeof (int)); insn_n_alternatives = oballocvec (int, insn_code_number);
for (id = defs; id; id = id->next) for (id = defs; id; id = id->next)
if (id->insn_code >= 0) if (id->insn_code >= 0)
insn_n_alternatives[id->insn_code] = id->num_alternatives; insn_n_alternatives[id->insn_code] = id->num_alternatives;
......
...@@ -152,7 +152,7 @@ gen_insn (rtx insn, int insn_code_number) ...@@ -152,7 +152,7 @@ gen_insn (rtx insn, int insn_code_number)
/* Otherwise, make a new extraction method. We stash the arrays /* Otherwise, make a new extraction method. We stash the arrays
after the extraction structure in memory. */ after the extraction structure in memory. */
p = xmalloc (sizeof (struct extraction) p = XNEWVAR (struct extraction, sizeof (struct extraction)
+ op_count*sizeof (char *) + op_count*sizeof (char *)
+ dup_count*sizeof (char *) + dup_count*sizeof (char *)
+ dup_count*sizeof (int)); + dup_count*sizeof (int));
......
...@@ -116,7 +116,7 @@ EOID [^[:alnum:]_] ...@@ -116,7 +116,7 @@ EOID [^[:alnum:]_]
"nested_ptr"/{EOID} { return NESTED_PTR; } "nested_ptr"/{EOID} { return NESTED_PTR; }
[0-9]+ { return NUM; } [0-9]+ { return NUM; }
"param"[0-9]*"_is"/{EOID} { "param"[0-9]*"_is"/{EOID} {
*yylval = xmemdup (yytext, yyleng, yyleng+1); *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1);
return PARAM_IS; return PARAM_IS;
} }
...@@ -127,28 +127,28 @@ EOID [^[:alnum:]_] ...@@ -127,28 +127,28 @@ EOID [^[:alnum:]_]
for (len = yyleng; ISSPACE (yytext[len-1]); len--) for (len = yyleng; ISSPACE (yytext[len-1]); len--)
; ;
*yylval = xmemdup (yytext, len, len+1); *yylval = XDUPVAR (const char, yytext, len, len+1);
update_lineno (yytext, yyleng); update_lineno (yytext, yyleng);
return SCALAR; return SCALAR;
} }
{ID}/{EOID} { {ID}/{EOID} {
*yylval = xmemdup (yytext, yyleng, yyleng+1); *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1);
return ID; return ID;
} }
\"([^"\\]|\\.)*\" { \"([^"\\]|\\.)*\" {
*yylval = xmemdup (yytext+1, yyleng-2, yyleng-1); *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1);
return STRING; return STRING;
} }
/* This "terminal" avoids having to parse integer constant expressions. */ /* This "terminal" avoids having to parse integer constant expressions. */
"["[^\[\]]*"]" { "["[^\[\]]*"]" {
*yylval = xmemdup (yytext+1, yyleng-2, yyleng-1); *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1);
return ARRAY; return ARRAY;
} }
"'"("\\".|[^\\])"'" { "'"("\\".|[^\\])"'" {
*yylval = xmemdup (yytext+1, yyleng-2, yyleng); *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng);
return CHAR; return CHAR;
} }
......
...@@ -439,7 +439,7 @@ read_input_list (const char *listname) ...@@ -439,7 +439,7 @@ read_input_list (const char *listname)
: lang_dir_names[langno - 1]); : lang_dir_names[langno - 1]);
bmap |= curlangs; bmap |= curlangs;
set_lang_bitmap ((char *)gt_files[i], bmap); set_lang_bitmap (CONST_CAST(char *, gt_files[i]), bmap);
here = committed; here = committed;
goto next_line; goto next_line;
} }
...@@ -1272,9 +1272,9 @@ adjust_field_type (type_p t, options_p opt) ...@@ -1272,9 +1272,9 @@ adjust_field_type (type_p t, options_p opt)
if (params[num] != NULL) if (params[num] != NULL)
error_at_line (&lexer_line, "duplicate `%s' option", opt->name); error_at_line (&lexer_line, "duplicate `%s' option", opt->name);
if (! ISDIGIT (opt->name[5])) if (! ISDIGIT (opt->name[5]))
params[num] = create_pointer ((type_p) opt->info); params[num] = create_pointer (CONST_CAST2(type_p, const char *, opt->info));
else else
params[num] = (type_p) opt->info; params[num] = CONST_CAST2 (type_p, const char *, opt->info);
} }
else if (strcmp (opt->name, "special") == 0) else if (strcmp (opt->name, "special") == 0)
{ {
...@@ -1323,7 +1323,8 @@ process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef, ...@@ -1323,7 +1323,8 @@ process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef,
options_p o; options_p o;
for (o = opt; o; o = o->next) for (o = opt; o; o = o->next)
if (strcmp (o->name, "ptr_alias") == 0 && level == GC_POINTED_TO) if (strcmp (o->name, "ptr_alias") == 0 && level == GC_POINTED_TO)
set_gc_used_type ((type_p) o->info, GC_POINTED_TO, NULL); set_gc_used_type (CONST_CAST2 (type_p, const char *, o->info),
GC_POINTED_TO, NULL);
else if (strcmp (o->name, "maybe_undef") == 0) else if (strcmp (o->name, "maybe_undef") == 0)
*maybe_undef = 1; *maybe_undef = 1;
else if (strcmp (o->name, "use_params") == 0) else if (strcmp (o->name, "use_params") == 0)
......
...@@ -1173,7 +1173,7 @@ note_constraint (rtx exp, int lineno) ...@@ -1173,7 +1173,7 @@ note_constraint (rtx exp, int lineno)
return; return;
} }
} }
new = xmalloc (sizeof (struct constraint_data) + namelen); new = XNEWVAR (struct constraint_data, sizeof (struct constraint_data) + namelen);
strcpy ((char *)new + offsetof(struct constraint_data, name), name); strcpy ((char *)new + offsetof(struct constraint_data, name), name);
new->namelen = namelen; new->namelen = namelen;
new->lineno = lineno; new->lineno = lineno;
......
...@@ -732,7 +732,7 @@ mangle (const char *name) ...@@ -732,7 +732,7 @@ mangle (const char *name)
} }
obstack_1grow (rtl_obstack, '\0'); obstack_1grow (rtl_obstack, '\0');
return obstack_finish (rtl_obstack); return XOBFINISH (rtl_obstack, const char *);
} }
/* Add one constraint, of any sort, to the tables. NAME is its name; /* Add one constraint, of any sort, to the tables. NAME is its name;
...@@ -897,7 +897,7 @@ add_constraint (const char *name, const char *regclass, ...@@ -897,7 +897,7 @@ add_constraint (const char *name, const char *regclass,
} }
c = obstack_alloc (rtl_obstack, sizeof (struct constraint_data)); c = XOBNEW (rtl_obstack, struct constraint_data);
c->name = name; c->name = name;
c->c_name = need_mangled_name ? mangle (name) : name; c->c_name = need_mangled_name ? mangle (name) : name;
c->lineno = lineno; c->lineno = lineno;
......
...@@ -366,7 +366,7 @@ compute_predicate_codes (rtx exp, char codes[NUM_RTX_CODE]) ...@@ -366,7 +366,7 @@ compute_predicate_codes (rtx exp, char codes[NUM_RTX_CODE])
static void static void
process_define_predicate (rtx desc) process_define_predicate (rtx desc)
{ {
struct pred_data *pred = xcalloc (sizeof (struct pred_data), 1); struct pred_data *pred = XCNEW (struct pred_data);
char codes[NUM_RTX_CODE]; char codes[NUM_RTX_CODE];
int i; int i;
...@@ -474,7 +474,7 @@ extern void debug_decision_list ...@@ -474,7 +474,7 @@ extern void debug_decision_list
static struct decision * static struct decision *
new_decision (const char *position, struct decision_head *last) new_decision (const char *position, struct decision_head *last)
{ {
struct decision *new = xcalloc (1, sizeof (struct decision)); struct decision *new = XCNEW (struct decision);
new->success = *last; new->success = *last;
new->position = xstrdup (position); new->position = xstrdup (position);
...@@ -890,7 +890,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position, ...@@ -890,7 +890,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
if (depth > max_depth) if (depth > max_depth)
max_depth = depth; max_depth = depth;
subpos = xmalloc (depth + 2); subpos = XNEWVAR (char, depth + 2);
strcpy (subpos, position); strcpy (subpos, position);
subpos[depth + 1] = 0; subpos[depth + 1] = 0;
......
...@@ -1434,7 +1434,7 @@ record_insn_name (int code, const char *name) ...@@ -1434,7 +1434,7 @@ record_insn_name (int code, const char *name)
{ {
int new_size; int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512); new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size); insn_name_ptr = XRESIZEVEC (char *, insn_name_ptr, new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0, memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size)); sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size; insn_name_ptr_size = new_size;
...@@ -1442,7 +1442,7 @@ record_insn_name (int code, const char *name) ...@@ -1442,7 +1442,7 @@ record_insn_name (int code, const char *name)
if (!name || name[0] == '\0') if (!name || name[0] == '\0')
{ {
new = xmalloc (strlen (last_real_name) + 10); new = XNEWVAR (char, strlen (last_real_name) + 10);
sprintf (new, "%s+%d", last_real_name, code - last_real_code); sprintf (new, "%s+%d", last_real_name, code - last_real_code);
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment