This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch installed to remove unnecessary casts [part 2/3]
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 19 Jul 2003 10:58:11 -0400 (EDT)
- Subject: Patch installed to remove unnecessary casts [part 2/3]
- References: <200307191455.KAA13210@caip.rutgers.edu>
Part 2 of cast removal, Explanation and ChangeLog in part1's email.
diff -rup orig/egcc-CVS20030716/gcc/gcc.c egcc-CVS20030716/gcc/gcc.c
--- orig/egcc-CVS20030716/gcc/gcc.c 2003-07-11 20:01:14.000000000 -0400
+++ egcc-CVS20030716/gcc/gcc.c 2003-07-17 12:10:24.499107000 -0400
@@ -1107,8 +1107,7 @@ translate_options (int *argcp, const cha
int argc = *argcp;
const char *const *argv = *argvp;
int newvsize = (argc + 2) * 2 * sizeof (const char *);
- const char **newv =
- (const char **) xmalloc (newvsize);
+ const char **newv = xmalloc (newvsize);
int newindex = 0;
i = 0;
@@ -1138,7 +1137,7 @@ translate_options (int *argcp, const cha
}
newvsize += spaces * sizeof (const char *);
- newv = (const char **) xrealloc (newv, newvsize);
+ newv = xrealloc (newv, newvsize);
sp = target_option_translations[tott_idx].replacements;
np = xstrdup (sp);
@@ -1574,8 +1573,8 @@ init_spec (void)
notice ("Using built-in specs.\n");
#ifdef EXTRA_SPECS
- extra_specs = (struct spec_list *)
- xcalloc (sizeof (struct spec_list), ARRAY_SIZE (extra_specs_1));
+ extra_specs = xcalloc (sizeof (struct spec_list),
+ ARRAY_SIZE (extra_specs_1));
for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--)
{
@@ -1733,7 +1732,7 @@ set_spec (const char *name, const char *
if (!sl)
{
/* Not found - make it. */
- sl = (struct spec_list *) xmalloc (sizeof (struct spec_list));
+ sl = xmalloc (sizeof (struct spec_list));
sl->name = xstrdup (name);
sl->name_len = name_len;
sl->ptr_spec = &sl->ptr;
@@ -1805,7 +1804,7 @@ static void
alloc_args (void)
{
argbuf_length = 10;
- argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *));
+ argbuf = xmalloc (argbuf_length * sizeof (const char *));
}
/* Clear out the vector of arguments (after a command is executed). */
@@ -1827,9 +1826,7 @@ static void
store_arg (const char *arg, int delete_always, int delete_failure)
{
if (argbuf_index + 1 == argbuf_length)
- argbuf
- = (const char **) xrealloc (argbuf,
- (argbuf_length *= 2) * sizeof (const char *));
+ argbuf = xrealloc (argbuf, (argbuf_length *= 2) * sizeof (const char *));
argbuf[argbuf_index++] = arg;
argbuf[argbuf_index] = 0;
@@ -2119,9 +2116,8 @@ read_specs (const char *filename, int ma
{
/* Add this pair to the vector. */
compilers
- = ((struct compiler *)
- xrealloc (compilers,
- (n_compilers + 2) * sizeof (struct compiler)));
+ = xrealloc (compilers,
+ (n_compilers + 2) * sizeof (struct compiler));
compilers[n_compilers].suffix = suffix;
compilers[n_compilers].spec = spec;
@@ -2188,7 +2184,7 @@ record_temp_file (const char *filename,
if (! strcmp (name, temp->name))
goto already1;
- temp = (struct temp_file *) xmalloc (sizeof (struct temp_file));
+ temp = xmalloc (sizeof (struct temp_file));
temp->next = always_delete_queue;
temp->name = name;
always_delete_queue = temp;
@@ -2203,7 +2199,7 @@ record_temp_file (const char *filename,
if (! strcmp (name, temp->name))
goto already2;
- temp = (struct temp_file *) xmalloc (sizeof (struct temp_file));
+ temp = xmalloc (sizeof (struct temp_file));
temp->next = failure_delete_queue;
temp->name = name;
failure_delete_queue = temp;
@@ -2553,7 +2549,7 @@ add_prefix (struct path_prefix *pprefix,
if (len > pprefix->max_len)
pprefix->max_len = len;
- pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
+ pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = prefix;
pl->require_machine_suffix = require_machine_suffix;
pl->used_flag_ptr = warn;
@@ -2622,7 +2618,7 @@ execute (void)
n_commands++;
/* Get storage for each command. */
- commands = (struct command *) alloca (n_commands * sizeof (struct command));
+ commands = alloca (n_commands * sizeof (struct command));
/* Split argbuf into its separate piped processes,
and record info about each one.
@@ -3034,12 +3030,10 @@ add_preprocessor_option (const char *opt
n_preprocessor_options++;
if (! preprocessor_options)
- preprocessor_options
- = (char **) xmalloc (n_preprocessor_options * sizeof (char *));
+ preprocessor_options = xmalloc (n_preprocessor_options * sizeof (char *));
else
- preprocessor_options
- = (char **) xrealloc (preprocessor_options,
- n_preprocessor_options * sizeof (char *));
+ preprocessor_options = xrealloc (preprocessor_options,
+ n_preprocessor_options * sizeof (char *));
preprocessor_options [n_preprocessor_options - 1] =
save_string (option, len);
@@ -3051,12 +3045,10 @@ add_assembler_option (const char *option
n_assembler_options++;
if (! assembler_options)
- assembler_options
- = (char **) xmalloc (n_assembler_options * sizeof (char *));
+ assembler_options = xmalloc (n_assembler_options * sizeof (char *));
else
- assembler_options
- = (char **) xrealloc (assembler_options,
- n_assembler_options * sizeof (char *));
+ assembler_options = xrealloc (assembler_options,
+ n_assembler_options * sizeof (char *));
assembler_options [n_assembler_options - 1] = save_string (option, len);
}
@@ -3067,12 +3059,10 @@ add_linker_option (const char *option, i
n_linker_options++;
if (! linker_options)
- linker_options
- = (char **) xmalloc (n_linker_options * sizeof (char *));
+ linker_options = xmalloc (n_linker_options * sizeof (char *));
else
- linker_options
- = (char **) xrealloc (linker_options,
- n_linker_options * sizeof (char *));
+ linker_options = xrealloc (linker_options,
+ n_linker_options * sizeof (char *));
linker_options [n_linker_options - 1] = save_string (option, len);
}
@@ -3213,7 +3203,7 @@ process_command (int argc, const char *c
if (temp)
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
@@ -3248,7 +3238,7 @@ process_command (int argc, const char *c
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
@@ -3281,7 +3271,7 @@ process_command (int argc, const char *c
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
@@ -3484,8 +3474,7 @@ warranty; not even for MERCHANTABILITY o
}
else if (strcmp (argv[i], "-specs") == 0)
{
- struct user_specs *user = (struct user_specs *)
- xmalloc (sizeof (struct user_specs));
+ struct user_specs *user = xmalloc (sizeof (struct user_specs));
if (++i >= argc)
fatal ("argument to `-specs' is missing");
@@ -3499,8 +3488,7 @@ warranty; not even for MERCHANTABILITY o
}
else if (strncmp (argv[i], "-specs=", 7) == 0)
{
- struct user_specs *user = (struct user_specs *)
- xmalloc (sizeof (struct user_specs));
+ struct user_specs *user = xmalloc (sizeof (struct user_specs));
if (strlen (argv[i]) == 7)
fatal ("argument to `-specs=' is missing");
@@ -3673,9 +3661,8 @@ warranty; not even for MERCHANTABILITY o
for (j = 0; j < ARRAY_SIZE (modify_target); j++)
if (! strcmp (argv[i], modify_target[j].sw))
{
- char *new_name
- = (char *) xmalloc (strlen (modify_target[j].str)
- + strlen (spec_machine));
+ char *new_name = xmalloc (strlen (modify_target[j].str)
+ + strlen (spec_machine));
const char *p, *r;
char *q;
int made_addition = 0;
@@ -3818,9 +3805,8 @@ warranty; not even for MERCHANTABILITY o
/* Then create the space for the vectors and scan again. */
- switches = ((struct switchstr *)
- xmalloc ((n_switches + 1) * sizeof (struct switchstr)));
- infiles = (struct infile *) xmalloc ((n_infiles + 1) * sizeof (struct infile));
+ switches = xmalloc ((n_switches + 1) * sizeof (struct switchstr));
+ infiles = xmalloc ((n_infiles + 1) * sizeof (struct infile));
n_switches = 0;
n_infiles = 0;
last_language_n_infiles = -1;
@@ -3969,7 +3955,7 @@ warranty; not even for MERCHANTABILITY o
if (i + n_args >= argc)
fatal ("argument to `-%s' is missing", p);
switches[n_switches].args
- = (const char **) xmalloc ((n_args + 1) * sizeof(const char *));
+ = xmalloc ((n_args + 1) * sizeof(const char *));
while (j < n_args)
switches[n_switches].args[j++] = argv[++i];
/* Null-terminate the vector. */
@@ -3979,13 +3965,12 @@ warranty; not even for MERCHANTABILITY o
{
/* On some systems, ld cannot handle some options without
a space. So split the option from its argument. */
- char *part1 = (char *) xmalloc (2);
+ char *part1 = xmalloc (2);
part1[0] = c;
part1[1] = '\0';
switches[n_switches].part1 = part1;
- switches[n_switches].args
- = (const char **) xmalloc (2 * sizeof (const char *));
+ switches[n_switches].args = xmalloc (2 * sizeof (const char *));
switches[n_switches].args[0] = xstrdup (p+1);
switches[n_switches].args[1] = 0;
}
@@ -4453,7 +4438,7 @@ do_spec_1 (const char *spec, int inswitc
{
struct prefix_list *pl = startfile_prefixes.plist;
size_t bufsize = 100;
- char *buffer = (char *) xmalloc (bufsize);
+ char *buffer = xmalloc (bufsize);
int idx;
for (; pl; pl = pl->next)
@@ -4481,7 +4466,7 @@ do_spec_1 (const char *spec, int inswitc
>= bufsize)
bufsize = (strlen (pl->prefix)
+ strlen (machine_suffix)) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix);
strcat (buffer, machine_suffix);
if (is_directory (buffer, multilib_dir, 1))
@@ -4523,7 +4508,7 @@ do_spec_1 (const char *spec, int inswitc
/* Remove slash from machine_suffix. */
if (strlen (machine_suffix) >= bufsize)
bufsize = strlen (machine_suffix) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, machine_suffix);
idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1]))
@@ -4544,7 +4529,7 @@ do_spec_1 (const char *spec, int inswitc
/* Remove slash from pl->prefix. */
if (strlen (pl->prefix) >= bufsize)
bufsize = strlen (pl->prefix) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix);
idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1]))
@@ -4567,7 +4552,7 @@ do_spec_1 (const char *spec, int inswitc
char *buf;
while (*p != 0 && *p != '\n')
p++;
- buf = (char *) alloca (p - q + 1);
+ buf = alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
error ("%s", buf);
@@ -4581,7 +4566,7 @@ do_spec_1 (const char *spec, int inswitc
char *buf;
while (*p != 0 && *p != '\n')
p++;
- buf = (char *) alloca (p - q + 1);
+ buf = alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
notice ("%s\n", buf);
@@ -4663,8 +4648,8 @@ do_spec_1 (const char *spec, int inswitc
else
{
saved_suffix
- = (char *) xmalloc (suffix_length
- + strlen (TARGET_OBJECT_SUFFIX));
+ = xmalloc (suffix_length
+ + strlen (TARGET_OBJECT_SUFFIX));
strncpy (saved_suffix, suffix, suffix_length);
strcpy (saved_suffix + suffix_length,
TARGET_OBJECT_SUFFIX);
@@ -4735,7 +4720,7 @@ do_spec_1 (const char *spec, int inswitc
{
if (t == 0)
{
- t = (struct temp_name *) xmalloc (sizeof (struct temp_name));
+ t = xmalloc (sizeof (struct temp_name));
t->next = temp_names;
temp_names = t;
}
@@ -5131,7 +5116,7 @@ do_spec_1 (const char *spec, int inswitc
}
else
{
- char *x = (char *) alloca (strlen (name) * 2 + 1);
+ char *x = alloca (strlen (name) * 2 + 1);
char *buf = x;
const char *y = name;
int flag = 0;
@@ -5812,7 +5797,7 @@ is_directory (const char *path1, const c
{
int len1 = strlen (path1);
int len2 = strlen (path2);
- char *path = (char *) alloca (3 + len1 + len2);
+ char *path = alloca (3 + len1 + len2);
char *cp;
struct stat st;
@@ -6016,9 +6001,8 @@ main (int argc, const char *const *argv)
/* Initialize the vector of specs to just the default.
This means one element containing 0s, as a terminator. */
- compilers = (struct compiler *) xmalloc (sizeof default_compilers);
- memcpy ((char *) compilers, (char *) default_compilers,
- sizeof default_compilers);
+ compilers = xmalloc (sizeof default_compilers);
+ memcpy (compilers, default_compilers, sizeof default_compilers);
n_compilers = n_default_compilers;
/* Read specs from a file if there is one. */
@@ -6036,9 +6020,8 @@ main (int argc, const char *const *argv)
/* We need to check standard_exec_prefix/just_machine_suffix/specs
for any override of as, ld and libraries. */
- specs_file = (char *) alloca (strlen (standard_exec_prefix)
- + strlen (just_machine_suffix)
- + sizeof ("specs"));
+ specs_file = alloca (strlen (standard_exec_prefix)
+ + strlen (just_machine_suffix) + sizeof ("specs"));
strcpy (specs_file, standard_exec_prefix);
strcat (specs_file, just_machine_suffix);
@@ -6297,7 +6280,7 @@ main (int argc, const char *const *argv)
i = n_infiles;
i += lang_specific_extra_outfiles;
- outfiles = (const char **) xcalloc (i, sizeof (char *));
+ outfiles = xcalloc (i, sizeof (char *));
/* Record which files were specified explicitly as link input. */
@@ -6751,8 +6734,7 @@ used_arg (const char *p, int len)
if (*q == ';')
cnt++;
- matches =
- (struct mswitchstr *) alloca ((sizeof (struct mswitchstr)) * cnt);
+ matches = alloca ((sizeof (struct mswitchstr)) * cnt);
i = 0;
q = multilib_matches;
while (*q != '\0')
@@ -6784,8 +6766,7 @@ used_arg (const char *p, int len)
xmalloc from calling fatal, and prevents us from re-executing this
block of code. */
mswitches
- = (struct mswitchstr *)
- xmalloc (sizeof (struct mswitchstr)
+ = xmalloc (sizeof (struct mswitchstr)
* (n_mdswitches + (n_switches ? n_switches : 1)));
for (i = 0; i < n_switches; i++)
{
@@ -6912,9 +6893,7 @@ set_multilib_dir (void)
{
int i = 0;
- mdswitches
- = (struct mdswitchstr *) xmalloc (sizeof (struct mdswitchstr)
- * n_mdswitches);
+ mdswitches = xmalloc (sizeof (struct mdswitchstr) * n_mdswitches);
for (start = multilib_defaults; *start != '\0'; start = end + 1)
{
while (*start == ' ' || *start == '\t')
diff -rup orig/egcc-CVS20030716/gcc/gccspec.c egcc-CVS20030716/gcc/gccspec.c
--- orig/egcc-CVS20030716/gcc/gccspec.c 2003-07-06 20:01:07.000000000 -0400
+++ egcc-CVS20030716/gcc/gccspec.c 2003-07-17 12:11:13.324577000 -0400
@@ -73,7 +73,7 @@ lang_specific_driver (int *in_argc ATTRI
if (shared_libgcc)
{
/* Make sure to have room for the trailing NULL argument. */
- arglist = (const char **) xmalloc ((argc+2) * sizeof (char *));
+ arglist = xmalloc ((argc+2) * sizeof (char *));
i = 0;
do
diff -rup orig/egcc-CVS20030716/gcc/gcov.c egcc-CVS20030716/gcc/gcov.c
--- orig/egcc-CVS20030716/gcc/gcov.c 2003-07-10 14:05:57.000000000 -0400
+++ egcc-CVS20030716/gcc/gcov.c 2003-07-17 12:13:19.572899000 -0400
@@ -520,7 +520,7 @@ process_file (const char *file_name)
for (fn = functions; fn; fn = fn->next)
solve_flow_graph (fn);
for (src = sources; src; src = src->next)
- src->lines = (line_t *) xcalloc (src->num_lines, sizeof (line_t));
+ src->lines = xcalloc (src->num_lines, sizeof (line_t));
for (fn = functions; fn; fn = fn->next)
{
coverage_t coverage;
@@ -682,7 +682,7 @@ find_source (const char *file_name)
if (!strcmp (file_name, src->name))
return src;
- src = (source_t *)xcalloc (1, sizeof (source_t));
+ src = xcalloc (1, sizeof (source_t));
src->name = xstrdup (file_name);
src->coverage.name = src->name;
src->index = sources ? sources->index + 1 : 1;
@@ -748,7 +748,7 @@ read_graph_file (void)
src = find_source (gcov_read_string ());
lineno = gcov_read_unsigned ();
- fn = (function_t *)xcalloc (1, sizeof (function_t));
+ fn = xcalloc (1, sizeof (function_t));
fn->name = function_name;
fn->ident = ident;
fn->checksum = checksum;
@@ -784,8 +784,7 @@ read_graph_file (void)
unsigned ix, num_blocks = GCOV_TAG_BLOCKS_NUM (length);
fn->num_blocks = num_blocks;
- fn->blocks
- = (block_t *)xcalloc (fn->num_blocks, sizeof (block_t));
+ fn->blocks = xcalloc (fn->num_blocks, sizeof (block_t));
for (ix = 0; ix != num_blocks; ix++)
fn->blocks[ix].flags = gcov_read_unsigned ();
}
@@ -806,7 +805,7 @@ read_graph_file (void)
if (dest >= fn->num_blocks)
goto corrupt;
- arc = (arc_t *) xcalloc (1, sizeof (arc_t));
+ arc = xcalloc (1, sizeof (arc_t));
arc->dst = &fn->blocks[dest];
arc->src = &fn->blocks[src];
@@ -851,8 +850,7 @@ read_graph_file (void)
else if (fn && tag == GCOV_TAG_LINES)
{
unsigned blockno = gcov_read_unsigned ();
- unsigned *line_nos
- = (unsigned *)xcalloc (length - 1, sizeof (unsigned));
+ unsigned *line_nos = xcalloc (length - 1, sizeof (unsigned));
if (blockno >= fn->num_blocks || fn->blocks[blockno].u.line.encoding)
goto corrupt;
@@ -1047,8 +1045,7 @@ read_count_file (void)
goto mismatch;
if (!fn->counts)
- fn->counts
- = (gcov_type *)xcalloc (fn->num_counts, sizeof (gcov_type));
+ fn->counts = xcalloc (fn->num_counts, sizeof (gcov_type));
for (ix = 0; ix != fn->num_counts; ix++)
fn->counts[ix] += gcov_read_counter ();
diff -rup orig/egcc-CVS20030716/gcc/gcse.c egcc-CVS20030716/gcc/gcse.c
--- orig/egcc-CVS20030716/gcc/gcse.c 2003-07-16 20:01:29.000000000 -0400
+++ egcc-CVS20030716/gcc/gcse.c 2003-07-17 14:42:53.407707000 -0400
@@ -549,9 +549,9 @@ struct null_pointer_info
};
static void compute_can_copy (void);
-static char *gmalloc (unsigned int);
-static char *grealloc (char *, unsigned int);
-static char *gcse_alloc (unsigned long);
+static void *gmalloc (unsigned int);
+static void *grealloc (void *, unsigned int);
+static void *gcse_alloc (unsigned long);
static void alloc_gcse_mem (rtx);
static void free_gcse_mem (void);
static void alloc_reg_set_mem (int);
@@ -821,12 +821,11 @@ gcse_main (rtx f, FILE *file)
if (changed)
{
free_modify_mem_tables ();
- modify_mem_list
- = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
+ modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
canon_modify_mem_list
- = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx));
- memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ = gmalloc (last_basic_block * sizeof (rtx));
+ memset (modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ memset (canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
}
free_reg_set_mem ();
alloc_reg_set_mem (max_reg_num ());
@@ -954,7 +953,7 @@ can_copy_p (enum machine_mode mode)
/* Cover function to xmalloc to record bytes allocated. */
-static char *
+static void *
gmalloc (unsigned int size)
{
bytes_used += size;
@@ -965,19 +964,19 @@ gmalloc (unsigned int size)
We don't record the additional size since we don't know it.
It won't affect memory usage stats much anyway. */
-static char *
-grealloc (char *ptr, unsigned int size)
+static void *
+grealloc (void *ptr, unsigned int size)
{
return xrealloc (ptr, size);
}
/* Cover function to obstack_alloc. */
-static char *
+static void *
gcse_alloc (unsigned long size)
{
bytes_used += size;
- return (char *) obstack_alloc (&gcse_obstack, size);
+ return obstack_alloc (&gcse_obstack, size);
}
/* Allocate memory for the cuid mapping array,
@@ -997,8 +996,8 @@ alloc_gcse_mem (rtx f)
max_uid = get_max_uid ();
n = (max_uid + 1) * sizeof (int);
- uid_cuid = (int *) gmalloc (n);
- memset ((char *) uid_cuid, 0, n);
+ uid_cuid = gmalloc (n);
+ memset (uid_cuid, 0, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
@@ -1011,8 +1010,8 @@ alloc_gcse_mem (rtx f)
max_cuid = i;
n = (max_cuid + 1) * sizeof (rtx);
- cuid_insn = (rtx *) gmalloc (n);
- memset ((char *) cuid_insn, 0, n);
+ cuid_insn = gmalloc (n);
+ memset (cuid_insn, 0, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
if (INSN_P (insn))
CUID_INSN (i++) = insn;
@@ -1021,14 +1020,13 @@ alloc_gcse_mem (rtx f)
reg_set_bitmap = BITMAP_XMALLOC ();
/* Allocate vars to track sets of regs, memory per block. */
- reg_set_in_block = (sbitmap *) sbitmap_vector_alloc (last_basic_block,
- max_gcse_regno);
+ reg_set_in_block = sbitmap_vector_alloc (last_basic_block, max_gcse_regno);
/* Allocate array to keep a list of insns which modify memory in each
basic block. */
- modify_mem_list = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- canon_modify_mem_list = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx));
- memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
+ canon_modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
+ memset (modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ memset (canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
modify_mem_list_set = BITMAP_XMALLOC ();
canon_modify_mem_list_set = BITMAP_XMALLOC ();
}
@@ -1195,8 +1193,8 @@ alloc_reg_set_mem (int n_regs)
reg_set_table_size = n_regs + REG_SET_TABLE_SLOP;
n = reg_set_table_size * sizeof (struct reg_set *);
- reg_set_table = (struct reg_set **) gmalloc (n);
- memset ((char *) reg_set_table, 0, n);
+ reg_set_table = gmalloc (n);
+ memset (reg_set_table, 0, n);
gcc_obstack_init (®_set_obstack);
}
@@ -1221,16 +1219,14 @@ record_one_set (int regno, rtx insn)
{
int new_size = regno + REG_SET_TABLE_SLOP;
- reg_set_table
- = (struct reg_set **) grealloc ((char *) reg_set_table,
- new_size * sizeof (struct reg_set *));
- memset ((char *) (reg_set_table + reg_set_table_size), 0,
+ reg_set_table = grealloc (reg_set_table,
+ new_size * sizeof (struct reg_set *));
+ memset (reg_set_table + reg_set_table_size, 0,
(new_size - reg_set_table_size) * sizeof (struct reg_set *));
reg_set_table_size = new_size;
}
- new_reg_info = (struct reg_set *) obstack_alloc (®_set_obstack,
- sizeof (struct reg_set));
+ new_reg_info = obstack_alloc (®_set_obstack, sizeof (struct reg_set));
bytes_used += sizeof (struct reg_set);
new_reg_info->insn = insn;
new_reg_info->next = reg_set_table[regno];
@@ -1937,7 +1933,7 @@ insert_expr_in_table (rtx x, enum machin
if (! found)
{
- cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr));
+ cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */
@@ -1976,7 +1972,7 @@ insert_expr_in_table (rtx x, enum machin
else
{
/* First occurrence of this expression in this basic block. */
- antic_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ antic_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
if (cur_expr->antic_occr == NULL)
@@ -2011,7 +2007,7 @@ insert_expr_in_table (rtx x, enum machin
else
{
/* First occurrence of this expression in this basic block. */
- avail_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ avail_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
@@ -2058,7 +2054,7 @@ insert_set_in_table (rtx x, rtx insn, st
if (! found)
{
- cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr));
+ cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */
@@ -2097,7 +2093,7 @@ insert_set_in_table (rtx x, rtx insn, st
else
{
/* First occurrence of this expression in this basic block. */
- cur_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ cur_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
@@ -2286,9 +2282,8 @@ dump_hash_table (FILE *file, const char
unsigned int *hash_val;
struct expr *expr;
- flat_table
- = (struct expr **) xcalloc (table->n_elems, sizeof (struct expr *));
- hash_val = (unsigned int *) xmalloc (table->n_elems * sizeof (unsigned int));
+ flat_table = xcalloc (table->n_elems, sizeof (struct expr *));
+ hash_val = xmalloc (table->n_elems * sizeof (unsigned int));
for (i = 0; i < (int) table->size; i++)
for (expr = table->table[i]; expr != NULL; expr = expr->next_same_hash)
@@ -2459,8 +2454,7 @@ compute_hash_table_work (struct hash_tab
/* re-Cache any INSN_LIST nodes we have allocated. */
clear_modify_mem_tables ();
/* Some working arrays used to track first and last set in each block. */
- reg_avail_info = (struct reg_avail_info*)
- gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
+ reg_avail_info = gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
for (i = 0; i < max_gcse_regno; ++i)
reg_avail_info[i].last_bb = NULL;
@@ -2550,7 +2544,7 @@ alloc_hash_table (int n_insns, struct ha
??? Later take some measurements. */
table->size |= 1;
n = table->size * sizeof (struct expr *);
- table->table = (struct expr **) gmalloc (n);
+ table->table = gmalloc (n);
table->set_p = set_p;
}
@@ -2570,8 +2564,7 @@ compute_hash_table (struct hash_table *t
{
/* Initialize count of number of entries in hash table. */
table->n_elems = 0;
- memset ((char *) table->table, 0,
- table->size * sizeof (struct expr *));
+ memset (table->table, 0, table->size * sizeof (struct expr *));
compute_hash_table_work (table);
}
@@ -2842,16 +2835,16 @@ mark_oprs_set (rtx insn)
static void
alloc_rd_mem (int n_blocks, int n_insns)
{
- rd_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_kill = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_kill, n_blocks);
- rd_gen = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_gen = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_gen, n_blocks);
- reaching_defs = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ reaching_defs = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (reaching_defs, n_blocks);
- rd_out = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_out = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_out, n_blocks);
}
@@ -2969,16 +2962,16 @@ compute_rd (void)
static void
alloc_avail_expr_mem (int n_blocks, int n_exprs)
{
- ae_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_kill = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_kill, n_blocks);
- ae_gen = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_gen = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_gen, n_blocks);
- ae_in = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_in = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_in, n_blocks);
- ae_out = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_out = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_out, n_blocks);
}
@@ -3175,7 +3168,7 @@ expr_reaches_here_p (struct occr *occr,
int check_self_loop)
{
int rval;
- char *visited = (char *) xcalloc (last_basic_block, 1);
+ char *visited = xcalloc (last_basic_block, 1);
rval = expr_reaches_here_p_work (occr, expr, bb, check_self_loop, visited);
@@ -4591,7 +4584,7 @@ one_cprop_pass (int pass, int cprop_jump
local_cprop_pass (cprop_jumps);
/* Determine implicit sets. */
- implicit_sets = (rtx *) xcalloc (last_basic_block, sizeof (rtx));
+ implicit_sets = xcalloc (last_basic_block, sizeof (rtx));
find_implicit_sets ();
alloc_hash_table (max_cuid, &set_hash_table, 1);
@@ -5108,7 +5101,7 @@ static int
pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb)
{
int rval;
- char *visited = (char *) xcalloc (last_basic_block, 1);
+ char *visited = xcalloc (last_basic_block, 1);
rval = pre_expr_reaches_here_p_work (occr_bb, expr, bb, visited);
@@ -5577,7 +5570,7 @@ pre_gcse (void)
/* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */
- index_map = (struct expr **) xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
+ index_map = xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
@@ -5988,7 +5981,7 @@ delete_null_pointer_checks (rtx f ATTRIB
/* Go through the basic blocks, seeing whether or not each block
ends with a conditional branch whose condition is a comparison
against zero. Record the register compared in BLOCK_REG. */
- block_reg = (unsigned int *) xcalloc (last_basic_block, sizeof (int));
+ block_reg = xcalloc (last_basic_block, sizeof (int));
FOR_EACH_BB (bb)
{
rtx last_insn = bb->end;
@@ -6220,7 +6213,7 @@ hoist_code (void)
/* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */
- index_map = (struct expr **) xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
+ index_map = xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
@@ -6433,7 +6426,7 @@ ldst_entry (rtx x)
if (!ptr)
{
- ptr = (struct ls_expr *) xmalloc (sizeof (struct ls_expr));
+ ptr = xmalloc (sizeof (struct ls_expr));
ptr->next = pre_ldst_mems;
ptr->expr = NULL;
@@ -7079,7 +7072,7 @@ compute_store_table (void)
max_gcse_regno = max_reg_num ();
- reg_set_in_block = (sbitmap *) sbitmap_vector_alloc (last_basic_block,
+ reg_set_in_block = sbitmap_vector_alloc (last_basic_block,
max_gcse_regno);
sbitmap_vector_zero (reg_set_in_block, last_basic_block);
pre_ldst_mems = 0;
@@ -7379,10 +7372,10 @@ build_store_vectors (void)
/* Build the gen_vector. This is any store in the table which is not killed
by aliasing later in its block. */
- ae_gen = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ ae_gen = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (ae_gen, last_basic_block);
- st_antloc = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ st_antloc = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (st_antloc, last_basic_block);
for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr))
@@ -7415,10 +7408,10 @@ build_store_vectors (void)
}
}
- ae_kill = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ ae_kill = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (ae_kill, last_basic_block);
- transp = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ transp = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (transp, last_basic_block);
regs_set_in_block = xmalloc (sizeof (int) * max_gcse_regno);
diff -rup orig/egcc-CVS20030716/gcc/genattr.c egcc-CVS20030716/gcc/genattr.c
--- orig/egcc-CVS20030716/gcc/genattr.c 2003-07-08 20:41:52.000000000 -0400
+++ egcc-CVS20030716/gcc/genattr.c 2003-07-17 01:41:32.463002000 -0400
@@ -268,8 +268,7 @@ main (int argc, char **argv)
if (unit == 0)
{
- unit = (struct function_unit *)
- xmalloc (sizeof (struct function_unit));
+ unit = xmalloc (sizeof (struct function_unit));
unit->name = xstrdup (name);
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
diff -rup orig/egcc-CVS20030716/gcc/genattrtab.c egcc-CVS20030716/gcc/genattrtab.c
--- orig/egcc-CVS20030716/gcc/genattrtab.c 2003-07-08 20:41:52.000000000 -0400
+++ egcc-CVS20030716/gcc/genattrtab.c 2003-07-17 12:36:46.465325000 -0400
@@ -500,8 +500,7 @@ attr_hash_add_rtx (int hashcode, rtx rtl
{
struct attr_hash *h;
- h = (struct attr_hash *) obstack_alloc (hash_obstack,
- sizeof (struct attr_hash));
+ h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
h->hashcode = hashcode;
h->u.rtl = rtl;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
@@ -515,8 +514,7 @@ attr_hash_add_string (int hashcode, char
{
struct attr_hash *h;
- h = (struct attr_hash *) obstack_alloc (hash_obstack,
- sizeof (struct attr_hash));
+ h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
h->hashcode = -hashcode;
h->u.str = str;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
@@ -779,7 +777,7 @@ attr_string (const char *str, int len)
return h->u.str; /* <-- return if found. */
/* Not found; create a permanent copy and add it to the hash table. */
- new_str = (char *) obstack_alloc (hash_obstack, len + 1);
+ new_str = obstack_alloc (hash_obstack, len + 1);
memcpy (new_str, str, len);
new_str[len] = '\0';
attr_hash_add_string (hashcode, new_str);
@@ -1459,7 +1457,7 @@ get_attr_value (rtx value, struct attr_d
|| insn_alternatives[av->first_insn->insn_code]))
return av;
- av = (struct attr_value *) oballoc (sizeof (struct attr_value));
+ av = oballoc (sizeof (struct attr_value));
av->value = value;
av->next = attr->first_value;
attr->first_value = av;
@@ -1875,13 +1873,10 @@ expand_units (void)
/* Create an array of ops for each unit. Add an extra unit for the
result_ready_cost function that has the ops of all other units. */
- unit_ops = (struct function_unit_op ***)
- xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
- unit_num = (struct function_unit **)
- xmalloc ((num_units + 1) * sizeof (struct function_unit *));
+ unit_ops = xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
+ unit_num = xmalloc ((num_units + 1) * sizeof (struct function_unit *));
- unit_num[num_units] = unit = (struct function_unit *)
- xmalloc (sizeof (struct function_unit));
+ unit_num[num_units] = unit = xmalloc (sizeof (struct function_unit));
unit->num = num_units;
unit->num_opclasses = 0;
@@ -1889,7 +1884,7 @@ expand_units (void)
{
unit_num[num_units]->num_opclasses += unit->num_opclasses;
unit_num[unit->num] = unit;
- unit_ops[unit->num] = op_array = (struct function_unit_op **)
+ unit_ops[unit->num] = op_array =
xmalloc (unit->num_opclasses * sizeof (struct function_unit_op *));
for (op = unit->ops; op; op = op->next)
@@ -1897,7 +1892,7 @@ expand_units (void)
}
/* Compose the array of ops for the extra unit. */
- unit_ops[num_units] = op_array = (struct function_unit_op **)
+ unit_ops[num_units] = op_array =
xmalloc (unit_num[num_units]->num_opclasses
* sizeof (struct function_unit_op *));
@@ -2253,7 +2248,7 @@ fill_attr (struct attr_desc *attr)
else
av = get_attr_value (value, attr, id->insn_code);
- ie = (struct insn_ent *) oballoc (sizeof (struct insn_ent));
+ ie = oballoc (sizeof (struct insn_ent));
ie->insn_code = id->insn_code;
ie->insn_index = id->insn_code;
insert_insn_ent (av, ie);
@@ -2379,7 +2374,7 @@ make_length_attrs (void)
no_address_fn[i],
address_fn[i]),
new_attr, ie->insn_code);
- new_ie = (struct insn_ent *) oballoc (sizeof (struct insn_ent));
+ new_ie = oballoc (sizeof (struct insn_ent));
new_ie->insn_code = ie->insn_code;
new_ie->insn_index = ie->insn_index;
insert_insn_ent (new_av, new_ie);
@@ -2458,7 +2453,7 @@ simplify_cond (rtx exp, int insn_code, i
rtx defval = XEXP (exp, 1);
rtx new_defval = XEXP (exp, 1);
int len = XVECLEN (exp, 0);
- rtx *tests = (rtx *) xmalloc (len * sizeof (rtx));
+ rtx *tests = xmalloc (len * sizeof (rtx));
int allsame = 1;
rtx ret;
@@ -3398,17 +3393,15 @@ optimize_attrs (void)
return;
/* Make 2 extra elements, for "code" values -2 and -1. */
- insn_code_values
- = (struct attr_value_list **) xmalloc ((insn_code_number + 2)
- * sizeof (struct attr_value_list *));
- memset ((char *) insn_code_values, 0,
- (insn_code_number + 2) * sizeof (struct attr_value_list *));
+ insn_code_values = xmalloc ((insn_code_number + 2)
+ * sizeof (struct attr_value_list *));
+ memset (insn_code_values, 0,
+ (insn_code_number + 2) * sizeof (struct attr_value_list *));
/* Offset the table address so we can index by -2 or -1. */
insn_code_values += 2;
- iv = ivbuf = ((struct attr_value_list *)
- xmalloc (num_insn_ents * sizeof (struct attr_value_list)));
+ iv = ivbuf = xmalloc (num_insn_ents * sizeof (struct attr_value_list));
for (i = 0; i < MAX_ATTRS_INDEX; i++)
for (attr = attrs[i]; attr; attr = attr->next)
@@ -3499,7 +3492,7 @@ simplify_by_exploding (rtx exp)
cover the domain of the attribute. This makes the expanded COND form
order independent. */
- space = (struct dimension *) xmalloc (ndim * sizeof (struct dimension));
+ space = xmalloc (ndim * sizeof (struct dimension));
total = 1;
for (ndim = 0; list; ndim++)
@@ -3554,8 +3547,8 @@ simplify_by_exploding (rtx exp)
for (i = 0; i < ndim; i++)
space[i].current_value = space[i].values;
- condtest = (rtx *) xmalloc (total * sizeof (rtx));
- condval = (rtx *) xmalloc (total * sizeof (rtx));
+ condtest = xmalloc (total * sizeof (rtx));
+ condval = xmalloc (total * sizeof (rtx));
/* Expand the tests and values by iterating over all values in the
attribute space. */
@@ -4052,7 +4045,7 @@ gen_attr (rtx exp, int lineno)
name_ptr = XSTR (exp, 1);
while ((p = next_comma_elt (&name_ptr)) != NULL)
{
- av = (struct attr_value *) oballoc (sizeof (struct attr_value));
+ av = oballoc (sizeof (struct attr_value));
av->value = attr_rtx (CONST_STRING, p);
av->next = attr->first_value;
attr->first_value = av;
@@ -4196,7 +4189,7 @@ gen_insn (rtx exp, int lineno)
{
struct insn_def *id;
- id = (struct insn_def *) oballoc (sizeof (struct insn_def));
+ id = oballoc (sizeof (struct insn_def));
id->next = defs;
defs = id;
id->def = exp;
@@ -4260,7 +4253,7 @@ gen_delay (rtx def, int lineno)
have_annul_false = 1;
}
- delay = (struct delay_desc *) oballoc (sizeof (struct delay_desc));
+ delay = oballoc (sizeof (struct delay_desc));
delay->def = def;
delay->num = ++num_delays;
delay->next = delays;
@@ -4307,7 +4300,7 @@ gen_unit (rtx def, int lineno)
if (unit == 0)
{
- unit = (struct function_unit *) oballoc (sizeof (struct function_unit));
+ unit = oballoc (sizeof (struct function_unit));
unit->name = name;
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
@@ -4322,7 +4315,7 @@ gen_unit (rtx def, int lineno)
}
/* Make a new operation class structure entry and initialize it. */
- op = (struct function_unit_op *) oballoc (sizeof (struct function_unit_op));
+ op = oballoc (sizeof (struct function_unit_op));
op->condexp = condexp;
op->num = unit->num_opclasses++;
op->ready = ready_cost;
@@ -5579,7 +5572,7 @@ find_attr (const char *name, int create)
if (! create)
return NULL;
- attr = (struct attr_desc *) oballoc (sizeof (struct attr_desc));
+ attr = oballoc (sizeof (struct attr_desc));
attr->name = attr_string (name, strlen (name));
attr->first_value = attr->default_val = NULL;
attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0;
@@ -5896,13 +5889,13 @@ from the machine description file `md'.
printf ("#define operands recog_data.operand\n\n");
/* Make `insn_alternatives'. */
- insn_alternatives = (int *) oballoc (insn_code_number * sizeof (int));
+ insn_alternatives = oballoc (insn_code_number * sizeof (int));
for (id = defs; id; id = id->next)
if (id->insn_code >= 0)
insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1;
/* Make `insn_n_alternatives'. */
- insn_n_alternatives = (int *) oballoc (insn_code_number * sizeof (int));
+ insn_n_alternatives = oballoc (insn_code_number * sizeof (int));
for (id = defs; id; id = id->next)
if (id->insn_code >= 0)
insn_n_alternatives[id->insn_code] = id->num_alternatives;
diff -rup orig/egcc-CVS20030716/gcc/genautomata.c egcc-CVS20030716/gcc/genautomata.c
--- orig/egcc-CVS20030716/gcc/genautomata.c 2003-07-08 20:41:52.000000000 -0400
+++ egcc-CVS20030716/gcc/genautomata.c 2003-07-17 15:07:46.895423000 -0400
@@ -1922,15 +1922,15 @@ gen_automaton (rtx def)
void
gen_automata_option (rtx def)
{
- if (strcmp ((char *) XSTR (def, 0), NO_MINIMIZATION_OPTION + 1) == 0)
+ if (strcmp (XSTR (def, 0), NO_MINIMIZATION_OPTION + 1) == 0)
no_minimization_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), TIME_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), TIME_OPTION + 1) == 0)
time_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), V_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), V_OPTION + 1) == 0)
v_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), W_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), W_OPTION + 1) == 0)
w_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), NDFA_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), NDFA_OPTION + 1) == 0)
ndfa_flag = 1;
else
fatal ("invalid option `%s' in automata_option", XSTR (def, 0));
@@ -8842,8 +8842,7 @@ output_get_cpu_unit_code_func (void)
LOW_VARIABLE_NAME, MIDDLE_VARIABLE_NAME, HIGH_VARIABLE_NAME);
fprintf (output_file, " static struct %s %s [] =\n {\n",
NAME_CODE_STRUCT_NAME, NAME_CODE_TABLE_NAME);
- units = (unit_decl_t *) xmalloc (sizeof (unit_decl_t)
- * description->units_num);
+ units = xmalloc (sizeof (unit_decl_t) * description->units_num);
memcpy (units, units_array, sizeof (unit_decl_t) * description->units_num);
qsort (units, description->units_num, sizeof (unit_decl_t), units_cmp);
for (i = 0; i < description->units_num; i++)
@@ -8927,7 +8926,7 @@ output_dfa_start_func (void)
fprintf (output_file,
"void\n%s (void)\n{\n %s = get_max_uid ();\n",
DFA_START_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
- fprintf (output_file, " %s = (int *) xmalloc (%s * sizeof (int));\n",
+ fprintf (output_file, " %s = xmalloc (%s * sizeof (int));\n",
DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
fprintf (output_file, " %s ();\n}\n\n", DFA_CLEAN_INSN_CACHE_FUNC_NAME);
}
diff -rup orig/egcc-CVS20030716/gcc/genconditions.c egcc-CVS20030716/gcc/genconditions.c
--- orig/egcc-CVS20030716/gcc/genconditions.c 2003-07-05 01:24:50.000000000 -0400
+++ egcc-CVS20030716/gcc/genconditions.c 2003-07-17 12:38:30.955695000 -0400
@@ -57,7 +57,7 @@ add_condition (const char *expr)
if (expr[0] == 0)
return;
- test = (struct c_test *) xmalloc (sizeof (struct c_test));
+ test = xmalloc (sizeof (struct c_test));
test->expr = expr;
*(htab_find_slot (condition_table, test, INSERT)) = test;
diff -rup orig/egcc-CVS20030716/gcc/genemit.c egcc-CVS20030716/gcc/genemit.c
--- orig/egcc-CVS20030716/gcc/genemit.c 2003-07-06 20:01:09.000000000 -0400
+++ egcc-CVS20030716/gcc/genemit.c 2003-07-17 12:38:56.023382000 -0400
@@ -317,8 +317,7 @@ gen_insn (rtx insn, int lineno)
if (i != XVECLEN (insn, 1) - 1)
{
struct clobber_pat *p;
- struct clobber_ent *link
- = (struct clobber_ent *) xmalloc (sizeof (struct clobber_ent));
+ struct clobber_ent *link = xmalloc (sizeof (struct clobber_ent));
int j;
link->code_number = insn_code_number;
@@ -354,7 +353,7 @@ gen_insn (rtx insn, int lineno)
if (p == 0)
{
- p = (struct clobber_pat *) xmalloc (sizeof (struct clobber_pat));
+ p = xmalloc (sizeof (struct clobber_pat));
p->insns = 0;
p->pattern = insn;
diff -rup orig/egcc-CVS20030716/gcc/genextract.c egcc-CVS20030716/gcc/genextract.c
--- orig/egcc-CVS20030716/gcc/genextract.c 2003-07-07 20:01:50.000000000 -0400
+++ egcc-CVS20030716/gcc/genextract.c 2003-07-17 12:40:19.605624000 -0400
@@ -129,7 +129,7 @@ gen_insn (rtx insn)
walk_rtx (XVECEXP (insn, 1, i), path);
}
- link = (struct code_ptr *) xmalloc (sizeof (struct code_ptr));
+ link = xmalloc (sizeof (struct code_ptr));
link->insn_code = insn_code_number;
/* See if we find something that already had this extraction method. */
@@ -164,7 +164,7 @@ gen_insn (rtx insn)
/* Otherwise, make a new extraction method. */
- p = (struct extraction *) xmalloc (sizeof (struct extraction));
+ p = xmalloc (sizeof (struct extraction));
p->op_count = op_count;
p->dup_count = dup_count;
p->next = extractions;
@@ -220,7 +220,7 @@ walk_rtx (rtx x, const char *path)
dupnums[dup_count] = XINT (x, 0);
dup_count++;
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -236,7 +236,7 @@ walk_rtx (rtx x, const char *path)
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -252,7 +252,7 @@ walk_rtx (rtx x, const char *path)
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -272,7 +272,7 @@ walk_rtx (rtx x, const char *path)
break;
}
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
@@ -412,8 +412,7 @@ from the machine description file `md'.
else if (GET_CODE (desc) == DEFINE_PEEPHOLE)
{
- struct code_ptr *link
- = (struct code_ptr *) xmalloc (sizeof (struct code_ptr));
+ struct code_ptr *link = xmalloc (sizeof (struct code_ptr));
link->insn_code = insn_code_number;
link->next = peepholes;
@@ -509,8 +508,7 @@ record_insn_name (int code, const char *
{
int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
- insn_name_ptr =
- (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
+ insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
diff -rup orig/egcc-CVS20030716/gcc/genoutput.c egcc-CVS20030716/gcc/genoutput.c
--- orig/egcc-CVS20030716/gcc/genoutput.c 2003-07-05 01:24:50.000000000 -0400
+++ egcc-CVS20030716/gcc/genoutput.c 2003-07-17 12:41:13.560559000 -0400
@@ -782,7 +782,7 @@ validate_insn_operands (struct data *d)
static void
gen_insn (rtx insn, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
@@ -823,7 +823,7 @@ gen_insn (rtx insn, int lineno)
static void
gen_peephole (rtx peep, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
@@ -861,7 +861,7 @@ gen_peephole (rtx peep, int lineno)
static void
gen_expand (rtx insn, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
@@ -904,7 +904,7 @@ gen_expand (rtx insn, int lineno)
static void
gen_split (rtx split, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
diff -rup orig/egcc-CVS20030716/gcc/genrecog.c egcc-CVS20030716/gcc/genrecog.c
--- orig/egcc-CVS20030716/gcc/genrecog.c 2003-07-05 01:24:50.000000000 -0400
+++ egcc-CVS20030716/gcc/genrecog.c 2003-07-17 12:41:58.546360000 -0400
@@ -316,8 +316,7 @@ extern void debug_decision_list
static struct decision *
new_decision (const char *position, struct decision_head *last)
{
- struct decision *new
- = (struct decision *) xmalloc (sizeof (struct decision));
+ struct decision *new = xmalloc (sizeof (struct decision));
memset (new, 0, sizeof (*new));
new->success = *last;
@@ -336,7 +335,7 @@ new_decision_test (enum decision_type ty
struct decision_test **place = *pplace;
struct decision_test *test;
- test = (struct decision_test *) xmalloc (sizeof (*test));
+ test = xmalloc (sizeof (*test));
test->next = *place;
test->type = type;
*place = test;
@@ -770,7 +769,7 @@ add_to_sequence (rtx pattern, struct dec
if (depth > max_depth)
max_depth = depth;
- subpos = (char *) xmalloc (depth + 2);
+ subpos = xmalloc (depth + 2);
strcpy (subpos, position);
subpos[depth + 1] = 0;
@@ -2667,8 +2666,7 @@ record_insn_name (int code, const char *
{
int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
- insn_name_ptr =
- (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
+ insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
diff -rup orig/egcc-CVS20030716/gcc/gensupport.c egcc-CVS20030716/gcc/gensupport.c
--- orig/egcc-CVS20030716/gcc/gensupport.c 2003-07-03 09:17:13.000000000 -0400
+++ egcc-CVS20030716/gcc/gensupport.c 2003-07-17 12:42:33.323146000 -0400
@@ -140,7 +140,7 @@ static void
queue_pattern (rtx pattern, struct queue_elem ***list_tail,
const char *filename, int lineno)
{
- struct queue_elem *e = (struct queue_elem *) xmalloc (sizeof (*e));
+ struct queue_elem *e = xmalloc (sizeof (*e));
e->data = pattern;
e->filename = filename;
e->lineno = lineno;
@@ -583,7 +583,7 @@ alter_predicate_for_insn (rtx pattern, i
{
size_t c_len = strlen (c);
size_t len = alt * (c_len + 1);
- char *new_c = (char *) xmalloc (len);
+ char *new_c = xmalloc (len);
memcpy (new_c, c, c_len);
for (i = 1; i < alt; ++i)
@@ -876,8 +876,7 @@ init_md_reader_args (int argc, char **ar
{
struct file_name_list *dirtmp;
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ dirtmp = xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
if (first_dir_md_include == 0)
first_dir_md_include = dirtmp;
@@ -1078,7 +1077,7 @@ maybe_eval_c_test (const char *expr)
return -1;
dummy.expr = expr;
- test = (const struct c_test *) htab_find (condition_table, &dummy);
+ test = htab_find (condition_table, &dummy);
if (!test)
abort ();
diff -rup orig/egcc-CVS20030716/gcc/ggc-page.c egcc-CVS20030716/gcc/ggc-page.c
--- orig/egcc-CVS20030716/gcc/ggc-page.c 2003-07-14 13:41:52.000000000 -0400
+++ egcc-CVS20030716/gcc/ggc-page.c 2003-07-17 12:50:11.181517000 -0400
@@ -478,8 +478,7 @@ push_depth (unsigned int i)
if (G.depth_in_use >= G.depth_max)
{
G.depth_max *= 2;
- G.depth = (unsigned int *) xrealloc ((char *) G.depth,
- G.depth_max * sizeof (unsigned int));
+ G.depth = xrealloc (G.depth, G.depth_max * sizeof (unsigned int));
}
G.depth[G.depth_in_use++] = i;
}
@@ -492,10 +491,10 @@ push_by_depth (page_entry *p, unsigned l
if (G.by_depth_in_use >= G.by_depth_max)
{
G.by_depth_max *= 2;
- G.by_depth = (page_entry **) xrealloc ((char *) G.by_depth,
- G.by_depth_max * sizeof (page_entry *));
- G.save_in_use = (unsigned long **) xrealloc ((char *) G.save_in_use,
- G.by_depth_max * sizeof (unsigned long *));
+ G.by_depth = xrealloc (G.by_depth,
+ G.by_depth_max * sizeof (page_entry *));
+ G.save_in_use = xrealloc (G.save_in_use,
+ G.by_depth_max * sizeof (unsigned long *));
}
G.by_depth[G.by_depth_in_use] = p;
G.save_in_use[G.by_depth_in_use++] = s;
@@ -587,7 +586,7 @@ set_page_table_entry (void *p, page_entr
goto found;
/* Not found -- allocate a new table. */
- table = (page_table) xcalloc (1, sizeof(*table));
+ table = xcalloc (1, sizeof(*table));
table->next = G.lookup;
table->high_bits = high_bits;
G.lookup = table;
@@ -600,7 +599,7 @@ found:
L2 = LOOKUP_L2 (p);
if (base[L1] == NULL)
- base[L1] = (page_entry **) xcalloc (PAGE_L2_SIZE, sizeof (page_entry *));
+ base[L1] = xcalloc (PAGE_L2_SIZE, sizeof (page_entry *));
base[L1][L2] = entry;
}
@@ -748,7 +747,7 @@ alloc_page (unsigned order)
memory order. */
for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--)
{
- e = (struct page_entry *) xcalloc (1, page_entry_size);
+ e = xcalloc (1, page_entry_size);
e->order = order;
e->bytes = G.pagesize;
e->page = page + (i << G.lg_pagesize);
@@ -820,7 +819,7 @@ alloc_page (unsigned order)
struct page_entry *e, *f = G.free_pages;
for (a = enda - G.pagesize; a != page; a -= G.pagesize)
{
- e = (struct page_entry *) xcalloc (1, page_entry_size);
+ e = xcalloc (1, page_entry_size);
e->order = order;
e->bytes = G.pagesize;
e->page = a;
@@ -834,7 +833,7 @@ alloc_page (unsigned order)
#endif
if (entry == NULL)
- entry = (struct page_entry *) xcalloc (1, page_entry_size);
+ entry = xcalloc (1, page_entry_size);
entry->bytes = entry_size;
entry->page = page;
@@ -1327,7 +1326,7 @@ init_ggc (void)
}
/* We have a good page, might as well hold onto it... */
- e = (struct page_entry *) xcalloc (1, sizeof (struct page_entry));
+ e = xcalloc (1, sizeof (struct page_entry));
e->bytes = G.pagesize;
e->page = p;
e->next = G.free_pages;
@@ -1373,12 +1372,12 @@ init_ggc (void)
G.depth_in_use = 0;
G.depth_max = 10;
- G.depth = (unsigned int *) xmalloc (G.depth_max * sizeof (unsigned int));
+ G.depth = xmalloc (G.depth_max * sizeof (unsigned int));
G.by_depth_in_use = 0;
G.by_depth_max = INITIAL_PTE_COUNT;
- G.by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *));
- G.save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *));
+ G.by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
+ G.save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
}
/* Increment the `GC context'. Objects allocated in an outer context
@@ -2017,8 +2016,8 @@ move_ptes_to_front (int count_old_page_t
page_entry **new_by_depth;
unsigned long **new_save_in_use;
- new_by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *));
- new_save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *));
+ new_by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
+ new_save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
memcpy (&new_by_depth[0],
&G.by_depth[count_old_page_tables],
diff -rup orig/egcc-CVS20030716/gcc/ggc-simple.c egcc-CVS20030716/gcc/ggc-simple.c
--- orig/egcc-CVS20030716/gcc/ggc-simple.c 2003-06-17 10:05:22.000000000 -0400
+++ egcc-CVS20030716/gcc/ggc-simple.c 2003-07-17 12:50:36.449129000 -0400
@@ -166,7 +166,7 @@ ggc_alloc (size_t size)
{
struct ggc_mem *x;
- x = (struct ggc_mem *) xmalloc (offsetof (struct ggc_mem, u) + size);
+ x = xmalloc (offsetof (struct ggc_mem, u) + size);
x->sub[0] = NULL;
x->sub[1] = NULL;
x->mark = 0;
diff -rup orig/egcc-CVS20030716/gcc/global.c egcc-CVS20030716/gcc/global.c
--- orig/egcc-CVS20030716/gcc/global.c 2003-07-06 20:01:09.000000000 -0400
+++ egcc-CVS20030716/gcc/global.c 2003-07-17 12:52:42.157791000 -0400
@@ -398,14 +398,14 @@ global_alloc (FILE *file)
/* Establish mappings from register number to allocation number
and vice versa. In the process, count the allocnos. */
- reg_allocno = (int *) xmalloc (max_regno * sizeof (int));
+ reg_allocno = xmalloc (max_regno * sizeof (int));
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
reg_allocno[i] = -1;
/* Initialize the shared-hard-reg mapping
from the list of pairs that may share. */
- reg_may_share = (int *) xcalloc (max_regno, sizeof (int));
+ reg_may_share = xcalloc (max_regno, sizeof (int));
for (x = regs_may_share; x; x = XEXP (XEXP (x, 1), 1))
{
int r1 = REGNO (XEXP (x, 0));
@@ -436,7 +436,7 @@ global_alloc (FILE *file)
else
reg_allocno[i] = -1;
- allocno = (struct allocno *) xcalloc (max_allocno, sizeof (struct allocno));
+ allocno = xcalloc (max_allocno, sizeof (struct allocno));
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_allocno[i] >= 0)
@@ -454,9 +454,9 @@ global_alloc (FILE *file)
/* Calculate amount of usage of each hard reg by pseudos
allocated by local-alloc. This is to see if we want to
override it. */
- memset ((char *) local_reg_live_length, 0, sizeof local_reg_live_length);
- memset ((char *) local_reg_n_refs, 0, sizeof local_reg_n_refs);
- memset ((char *) local_reg_freq, 0, sizeof local_reg_freq);
+ memset (local_reg_live_length, 0, sizeof local_reg_live_length);
+ memset (local_reg_n_refs, 0, sizeof local_reg_n_refs);
+ memset (local_reg_freq, 0, sizeof local_reg_freq);
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_renumber[i] >= 0)
{
@@ -482,10 +482,9 @@ global_alloc (FILE *file)
/* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. Some examples were > 2Mb in size. */
- conflicts = (INT_TYPE *) xcalloc (max_allocno * allocno_row_words,
- sizeof (INT_TYPE));
+ conflicts = xcalloc (max_allocno * allocno_row_words, sizeof (INT_TYPE));
- allocnos_live = (INT_TYPE *) xmalloc (allocno_row_words * sizeof (INT_TYPE));
+ allocnos_live = xmalloc (allocno_row_words * sizeof (INT_TYPE));
/* If there is work to be done (at least one reg to allocate),
perform global conflict analysis and allocate the regs. */
@@ -522,7 +521,7 @@ global_alloc (FILE *file)
/* Determine the order to allocate the remaining pseudo registers. */
- allocno_order = (int *) xmalloc (max_allocno * sizeof (int));
+ allocno_order = xmalloc (max_allocno * sizeof (int));
for (i = 0; i < (size_t) max_allocno; i++)
allocno_order[i] = i;
@@ -633,13 +632,13 @@ global_conflicts (void)
int *block_start_allocnos;
/* Make a vector that mark_reg_{store,clobber} will store in. */
- regs_set = (rtx *) xmalloc (max_parallel * sizeof (rtx) * 2);
+ regs_set = xmalloc (max_parallel * sizeof (rtx) * 2);
- block_start_allocnos = (int *) xmalloc (max_allocno * sizeof (int));
+ block_start_allocnos = xmalloc (max_allocno * sizeof (int));
FOR_EACH_BB (b)
{
- memset ((char *) allocnos_live, 0, allocno_row_words * sizeof (INT_TYPE));
+ memset (allocnos_live, 0, allocno_row_words * sizeof (INT_TYPE));
/* Initialize table of registers currently live
to the state at the beginning of this basic block.
@@ -903,7 +902,7 @@ prune_preferences (void)
{
int i;
int num;
- int *allocno_to_order = (int *) xmalloc (max_allocno * sizeof (int));
+ int *allocno_to_order = xmalloc (max_allocno * sizeof (int));
/* Scan least most important to most important.
For each allocno, remove from preferences registers that cannot be used,
diff -rup orig/egcc-CVS20030716/gcc/graph.c egcc-CVS20030716/gcc/graph.c
--- orig/egcc-CVS20030716/gcc/graph.c 2003-07-06 20:01:09.000000000 -0400
+++ egcc-CVS20030716/gcc/graph.c 2003-07-17 12:57:30.571495000 -0400
@@ -225,7 +225,7 @@ print_rtl_graph_with_bb (const char *bas
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + suffixlen + extlen);
+ char *buf = alloca (namelen + suffixlen + extlen);
FILE *fp;
if (basic_block_info == NULL)
@@ -245,10 +245,9 @@ print_rtl_graph_with_bb (const char *bas
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
- int *start = (int *) xmalloc (max_uid * sizeof (int));
- int *end = (int *) xmalloc (max_uid * sizeof (int));
- enum bb_state *in_bb_p = (enum bb_state *)
- xmalloc (max_uid * sizeof (enum bb_state));
+ int *start = xmalloc (max_uid * sizeof (int));
+ int *end = xmalloc (max_uid * sizeof (int));
+ enum bb_state *in_bb_p = xmalloc (max_uid * sizeof (enum bb_state));
basic_block bb;
int i;
@@ -390,7 +389,7 @@ clean_graph_dump_file (const char *base,
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + extlen + suffixlen);
+ char *buf = alloca (namelen + extlen + suffixlen);
FILE *fp;
memcpy (buf, base, namelen);
@@ -422,7 +421,7 @@ finish_graph_dump_file (const char *base
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + suffixlen + extlen);
+ char *buf = alloca (namelen + suffixlen + extlen);
FILE *fp;
memcpy (buf, base, namelen);
diff -rup orig/egcc-CVS20030716/gcc/haifa-sched.c egcc-CVS20030716/gcc/haifa-sched.c
--- orig/egcc-CVS20030716/gcc/haifa-sched.c 2003-07-06 20:01:10.000000000 -0400
+++ egcc-CVS20030716/gcc/haifa-sched.c 2003-07-17 12:58:41.975008000 -0400
@@ -658,9 +658,9 @@ get_unit_last_insn (int instance)
static void
clear_units (void)
{
- memset ((char *) unit_last_insn, 0, sizeof (unit_last_insn));
- memset ((char *) unit_tick, 0, sizeof (unit_tick));
- memset ((char *) unit_n_insns, 0, sizeof (unit_n_insns));
+ memset (unit_last_insn, 0, sizeof (unit_last_insn));
+ memset (unit_tick, 0, sizeof (unit_tick));
+ memset (unit_n_insns, 0, sizeof (unit_n_insns));
}
/* Return the issue-delay of an insn. The scheduler using only DFA
@@ -2130,7 +2130,7 @@ schedule_block (int b, int rgn_n_insns)
/* Allocate the ready list. */
ready.veclen = rgn_n_insns + 1 + issue_rate;
ready.first = ready.veclen - 1;
- ready.vec = (rtx *) xmalloc (ready.veclen * sizeof (rtx));
+ ready.vec = xmalloc (ready.veclen * sizeof (rtx));
ready.n_ready = 0;
if (targetm.sched.use_dfa_pipeline_interface
@@ -2138,13 +2138,12 @@ schedule_block (int b, int rgn_n_insns)
{
/* It is used for first cycle multipass scheduling. */
temp_state = alloca (dfa_state_size);
- ready_try = (char *) xmalloc ((rgn_n_insns + 1) * sizeof (char));
+ ready_try = xmalloc ((rgn_n_insns + 1) * sizeof (char));
memset (ready_try, 0, (rgn_n_insns + 1) * sizeof (char));
- choice_stack
- = (struct choice_entry *) xmalloc ((rgn_n_insns + 1)
- * sizeof (struct choice_entry));
+ choice_stack = xmalloc ((rgn_n_insns + 1)
+ * sizeof (struct choice_entry));
for (i = 0; i <= rgn_n_insns; i++)
- choice_stack[i].state = (state_t) xmalloc (dfa_state_size);
+ choice_stack[i].state = xmalloc (dfa_state_size);
}
(*current_sched_info->init_ready_list) (&ready);
@@ -2166,8 +2165,8 @@ schedule_block (int b, int rgn_n_insns)
else
max_insn_queue_index_macro_value = max_insn_queue_index;
- insn_queue = (rtx *) alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
- memset ((char *) insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
+ insn_queue = alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
+ memset (insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
last_clock_var = -1;
/* Start just before the beginning of time. */
@@ -2582,7 +2581,7 @@ sched_init (FILE *dump_file)
pseudos which do not cross calls. */
old_max_uid = get_max_uid () + 1;
- h_i_d = (struct haifa_insn_data *) xcalloc (old_max_uid, sizeof (*h_i_d));
+ h_i_d = xcalloc (old_max_uid, sizeof (*h_i_d));
for (i = 0; i < old_max_uid; i++)
h_i_d [i].cost = -1;
@@ -2632,7 +2631,7 @@ sched_init (FILE *dump_file)
{
rtx line;
- line_note_head = (rtx *) xcalloc (last_basic_block, sizeof (rtx));
+ line_note_head = xcalloc (last_basic_block, sizeof (rtx));
/* Save-line-note-head:
Determine the line-number at the start of each basic block.
diff -rup orig/egcc-CVS20030716/gcc/hashtable.c egcc-CVS20030716/gcc/hashtable.c
--- orig/egcc-CVS20030716/gcc/hashtable.c 2003-07-13 20:02:28.000000000 -0400
+++ egcc-CVS20030716/gcc/hashtable.c 2003-07-17 12:59:23.611183000 -0400
@@ -57,7 +57,7 @@ ht_create (unsigned int order)
unsigned int nslots = 1 << order;
hash_table *table;
- table = (hash_table *) xmalloc (sizeof (hash_table));
+ table = xmalloc (sizeof (hash_table));
memset (table, 0, sizeof (hash_table));
/* Strings need no alignment. */
@@ -67,7 +67,7 @@ ht_create (unsigned int order)
obstack_alignment_mask (&table->stack) = 0;
- table->entries = (hashnode *) xcalloc (nslots, sizeof (hashnode));
+ table->entries = xcalloc (nslots, sizeof (hashnode));
table->nslots = nslots;
return table;
}
@@ -158,7 +158,7 @@ ht_expand (hash_table *table)
unsigned int size, sizemask;
size = table->nslots * 2;
- nentries = (hashnode *) xcalloc (size, sizeof (hashnode));
+ nentries = xcalloc (size, sizeof (hashnode));
sizemask = size - 1;
p = table->entries;
diff -rup orig/egcc-CVS20030716/gcc/integrate.c egcc-CVS20030716/gcc/integrate.c
--- orig/egcc-CVS20030716/gcc/integrate.c 2003-07-15 20:01:43.000000000 -0400
+++ egcc-CVS20030716/gcc/integrate.c 2003-07-17 13:01:22.730357000 -0400
@@ -283,7 +283,7 @@ initialize_for_inline (tree fndecl)
tree parms;
/* Clear out PARMDECL_MAP. It was allocated in the caller's frame. */
- memset ((char *) parmdecl_map, 0, max_parm_reg * sizeof (tree));
+ memset (parmdecl_map, 0, max_parm_reg * sizeof (tree));
arg_vector = rtvec_alloc (list_length (DECL_ARGUMENTS (fndecl)));
for (parms = DECL_ARGUMENTS (fndecl), i = 0;
@@ -442,7 +442,7 @@ save_for_inline (tree fndecl)
for the parms, prior to elimination of virtual registers.
These values are needed for substituting parms properly. */
if (! flag_no_inline)
- parmdecl_map = (tree *) xmalloc (max_parm_reg * sizeof (tree));
+ parmdecl_map = xmalloc (max_parm_reg * sizeof (tree));
/* Make and emit a return-label if we have not already done so. */
@@ -724,8 +724,8 @@ expand_inline_function (tree fndecl, tre
/* Expand the function arguments. Do this first so that any
new registers get created before we allocate the maps. */
- arg_vals = (rtx *) xmalloc (nargs * sizeof (rtx));
- arg_trees = (tree *) xmalloc (nargs * sizeof (tree));
+ arg_vals = xmalloc (nargs * sizeof (rtx));
+ arg_trees = xmalloc (nargs * sizeof (tree));
for (formal = DECL_ARGUMENTS (fndecl), actual = parms, i = 0;
formal;
@@ -820,22 +820,21 @@ expand_inline_function (tree fndecl, tre
/* Allocate the structures we use to remap things. */
- map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
+ map = xcalloc (1, sizeof (struct inline_remap));
map->fndecl = fndecl;
VARRAY_TREE_INIT (map->block_map, 10, "block_map");
- map->reg_map = (rtx *) xcalloc (max_regno, sizeof (rtx));
+ map->reg_map = xcalloc (max_regno, sizeof (rtx));
/* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. */
- real_label_map
- = (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
+ real_label_map = xmalloc ((max_labelno) * sizeof (rtx));
map->label_map = real_label_map;
map->local_return_label = NULL_RTX;
inl_max_uid = (inl_f->emit->x_cur_insn_uid + 1);
- map->insn_map = (rtx *) xcalloc (inl_max_uid, sizeof (rtx));
+ map->insn_map = xcalloc (inl_max_uid, sizeof (rtx));
map->min_insnno = 0;
map->max_insnno = inl_max_uid;
@@ -1185,8 +1184,8 @@ expand_inline_function (tree fndecl, tre
/* Initialize label_map. get_label_from_map will actually make
the labels. */
- memset ((char *) &map->label_map[min_labelno], 0,
- (max_labelno - min_labelno) * sizeof (rtx));
+ memset (&map->label_map[min_labelno], 0,
+ (max_labelno - min_labelno) * sizeof (rtx));
/* Make copies of the decls of the symbols in the inline function, so that
the copies of the variables get declared in the current function. Set
@@ -3051,20 +3050,19 @@ get_func_hard_reg_initial_val (struct fu
if (ivs == 0)
{
- fun->hard_reg_initial_vals = (void *) ggc_alloc (sizeof (initial_value_struct));
+ fun->hard_reg_initial_vals = ggc_alloc (sizeof (initial_value_struct));
ivs = fun->hard_reg_initial_vals;
ivs->num_entries = 0;
ivs->max_entries = 5;
- ivs->entries = (initial_value_pair *) ggc_alloc (5 * sizeof (initial_value_pair));
+ ivs->entries = ggc_alloc (5 * sizeof (initial_value_pair));
}
if (ivs->num_entries >= ivs->max_entries)
{
ivs->max_entries += 5;
- ivs->entries =
- (initial_value_pair *) ggc_realloc (ivs->entries,
- ivs->max_entries
- * sizeof (initial_value_pair));
+ ivs->entries = ggc_realloc (ivs->entries,
+ ivs->max_entries
+ * sizeof (initial_value_pair));
}
ivs->entries[ivs->num_entries].hard_reg = reg;
diff -rup orig/egcc-CVS20030716/gcc/jump.c egcc-CVS20030716/gcc/jump.c
--- orig/egcc-CVS20030716/gcc/jump.c 2003-07-06 20:01:11.000000000 -0400
+++ egcc-CVS20030716/gcc/jump.c 2003-07-17 13:01:38.378872000 -0400
@@ -386,7 +386,7 @@ duplicate_loop_exit_test (rtx loop_start
/* We can do the replacement. Allocate reg_map if this is the
first replacement we found. */
if (reg_map == 0)
- reg_map = (rtx *) xcalloc (max_reg, sizeof (rtx));
+ reg_map = xcalloc (max_reg, sizeof (rtx));
REG_LOOP_TEST_P (reg) = 1;
diff -rup orig/egcc-CVS20030716/gcc/langhooks.c egcc-CVS20030716/gcc/langhooks.c
--- orig/egcc-CVS20030716/gcc/langhooks.c 2003-07-06 20:01:12.000000000 -0400
+++ egcc-CVS20030716/gcc/langhooks.c 2003-07-17 13:01:46.198305000 -0400
@@ -439,7 +439,7 @@ write_global_declarations (void)
tree globals = (*lang_hooks.decls.getdecls) ();
int len = list_length (globals);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ tree *vec = xmalloc (sizeof (tree) * len);
int i;
tree decl;
diff -rup orig/egcc-CVS20030716/gcc/lcm.c egcc-CVS20030716/gcc/lcm.c
--- orig/egcc-CVS20030716/gcc/lcm.c 2003-07-06 20:01:12.000000000 -0400
+++ egcc-CVS20030716/gcc/lcm.c 2003-07-17 14:43:39.493547000 -0400
@@ -106,8 +106,7 @@ compute_antinout_edge (sbitmap *antloc,
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution, so make an optimistic initialization of
ANTIN. */
@@ -259,7 +258,7 @@ compute_laterin (struct edge_list *edge_
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
/* Initialize a mapping from each edge to its index. */
for (i = 0; i < num_edges; i++)
@@ -480,8 +479,7 @@ compute_available (sbitmap *avloc, sbitm
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution. */
sbitmap_vector_ones (avout, last_basic_block);
@@ -608,8 +606,7 @@ compute_nearerout (struct edge_list *edg
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- tos = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
/* Initialize NEARER for each edge and build a mapping from an edge to
its index. */
@@ -717,8 +714,8 @@ pre_edge_rev_lcm (FILE *file ATTRIBUTE_U
edge_list = create_edge_list ();
num_edges = NUM_EDGES (edge_list);
- st_antin = (sbitmap *) sbitmap_vector_alloc (last_basic_block, n_exprs);
- st_antout = (sbitmap *) sbitmap_vector_alloc (last_basic_block, n_exprs);
+ st_antin = sbitmap_vector_alloc (last_basic_block, n_exprs);
+ st_antout = sbitmap_vector_alloc (last_basic_block, n_exprs);
sbitmap_vector_zero (st_antin, last_basic_block);
sbitmap_vector_zero (st_antout, last_basic_block);
compute_antinout_edge (st_antloc, transp, st_antin, st_antout);
@@ -997,8 +994,7 @@ optimize_mode_switching (FILE *file)
entry_exit_extra = 2;
#endif
bb_info[n_entities]
- = (struct bb_info *) xcalloc (last_basic_block + entry_exit_extra,
- sizeof **bb_info);
+ = xcalloc (last_basic_block + entry_exit_extra, sizeof **bb_info);
entity_map[n_entities++] = e;
if (num_modes[e] > max_num_modes)
max_num_modes = num_modes[e];
diff -rup orig/egcc-CVS20030716/gcc/line-map.c egcc-CVS20030716/gcc/line-map.c
--- orig/egcc-CVS20030716/gcc/line-map.c 2003-07-13 20:02:31.000000000 -0400
+++ egcc-CVS20030716/gcc/line-map.c 2003-07-17 01:43:58.900736000 -0400
@@ -80,8 +80,7 @@ add_line_map (struct line_maps *set, enu
if (set->used == set->allocated)
{
set->allocated = 2 * set->allocated + 256;
- set->maps = (struct line_map *)
- xrealloc (set->maps, set->allocated * sizeof (struct line_map));
+ set->maps = xrealloc (set->maps, set->allocated * sizeof (struct line_map));
}
map = &set->maps[set->used++];
diff -rup orig/egcc-CVS20030716/gcc/local-alloc.c egcc-CVS20030716/gcc/local-alloc.c
--- orig/egcc-CVS20030716/gcc/local-alloc.c 2003-07-06 20:01:12.000000000 -0400
+++ egcc-CVS20030716/gcc/local-alloc.c 2003-07-17 14:44:44.757564000 -0400
@@ -356,16 +356,15 @@ local_alloc (void)
See the declarations of these variables, above,
for what they mean. */
- qty = (struct qty *) xmalloc (max_qty * sizeof (struct qty));
- qty_phys_copy_sugg
- = (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET));
- qty_phys_num_copy_sugg = (short *) xmalloc (max_qty * sizeof (short));
- qty_phys_sugg = (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET));
- qty_phys_num_sugg = (short *) xmalloc (max_qty * sizeof (short));
-
- reg_qty = (int *) xmalloc (max_regno * sizeof (int));
- reg_offset = (char *) xmalloc (max_regno * sizeof (char));
- reg_next_in_qty = (int *) xmalloc (max_regno * sizeof (int));
+ qty = xmalloc (max_qty * sizeof (struct qty));
+ qty_phys_copy_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
+ qty_phys_num_copy_sugg = xmalloc (max_qty * sizeof (short));
+ qty_phys_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
+ qty_phys_num_sugg = xmalloc (max_qty * sizeof (short));
+
+ reg_qty = xmalloc (max_regno * sizeof (int));
+ reg_offset = xmalloc (max_regno * sizeof (char));
+ reg_next_in_qty = xmalloc (max_regno * sizeof (int));
/* Determine which pseudo-registers can be allocated by local-alloc.
In general, these are the registers used only in a single block and
@@ -409,7 +408,7 @@ local_alloc (void)
else
{
#define CLEAR(vector) \
- memset ((char *) (vector), 0, (sizeof (*(vector))) * next_qty);
+ memset ((vector), 0, (sizeof (*(vector))) * next_qty);
CLEAR (qty_phys_copy_sugg);
CLEAR (qty_phys_num_copy_sugg);
@@ -798,7 +797,7 @@ update_equiv_regs (void)
regset_head cleared_regs;
int clear_regnos = 0;
- reg_equiv = (struct equivalence *) xcalloc (max_regno, sizeof *reg_equiv);
+ reg_equiv = xcalloc (max_regno, sizeof *reg_equiv);
INIT_REG_SET (&cleared_regs);
init_alias_analysis ();
@@ -1218,8 +1217,7 @@ block_alloc (int b)
/* +2 to leave room for a post_mark_life at the last insn and for
the birth of a CLOBBER in the first insn. */
- regs_live_at = (HARD_REG_SET *) xcalloc ((2 * insn_count + 2),
- sizeof (HARD_REG_SET));
+ regs_live_at = xcalloc ((2 * insn_count + 2), sizeof (HARD_REG_SET));
/* Initialize table of hardware registers currently live. */
@@ -1475,7 +1473,7 @@ block_alloc (int b)
number of suggested registers they need so we allocate those with
the most restrictive needs first. */
- qty_order = (int *) xmalloc (next_qty * sizeof (int));
+ qty_order = xmalloc (next_qty * sizeof (int));
for (i = 0; i < next_qty; i++)
qty_order[i] = i;
diff -rup orig/egcc-CVS20030716/gcc/loop.c egcc-CVS20030716/gcc/loop.c
--- orig/egcc-CVS20030716/gcc/loop.c 2003-07-11 20:01:14.000000000 -0400
+++ egcc-CVS20030716/gcc/loop.c 2003-07-17 14:48:03.219263000 -0400
@@ -460,13 +460,11 @@ loop_optimize (rtx f, FILE *dumpfile, in
Leave some space for labels allocated by find_and_verify_loops. */
max_uid_for_loop = get_max_uid () + 1 + max_loop_num * 32;
- uid_luid = (int *) xcalloc (max_uid_for_loop, sizeof (int));
- uid_loop = (struct loop **) xcalloc (max_uid_for_loop,
- sizeof (struct loop *));
+ uid_luid = xcalloc (max_uid_for_loop, sizeof (int));
+ uid_loop = xcalloc (max_uid_for_loop, sizeof (struct loop *));
/* Allocate storage for array of loops. */
- loops->array = (struct loop *)
- xcalloc (loops->num, sizeof (struct loop));
+ loops->array = xcalloc (loops->num, sizeof (struct loop));
/* Find and process each loop.
First, find them, and record them in order of their beginnings. */
@@ -908,7 +906,7 @@ scan_loop (struct loop *loop, int flags)
continue;
}
- m = (struct movable *) xmalloc (sizeof (struct movable));
+ m = xmalloc (sizeof (struct movable));
m->next = 0;
m->insn = p;
m->set_src = src;
@@ -996,7 +994,7 @@ scan_loop (struct loop *loop, int flags)
if (regs->array[regno].set_in_loop == 2)
{
struct movable *m;
- m = (struct movable *) xmalloc (sizeof (struct movable));
+ m = xmalloc (sizeof (struct movable));
m->next = 0;
m->insn = p;
m->set_dest = SET_DEST (set);
@@ -1440,7 +1438,7 @@ static void
combine_movables (struct loop_movables *movables, struct loop_regs *regs)
{
struct movable *m;
- char *matched_regs = (char *) xmalloc (regs->num);
+ char *matched_regs = xmalloc (regs->num);
enum machine_mode mode;
/* Regs that are set more than once are not allowed to match
@@ -1775,8 +1773,8 @@ move_movables (struct loop *loop, struct
/* Map of pseudo-register replacements to handle combining
when we move several insns that load the same value
into different pseudo-registers. */
- rtx *reg_map = (rtx *) xcalloc (nregs, sizeof (rtx));
- char *already_moved = (char *) xcalloc (nregs, sizeof (char));
+ rtx *reg_map = xcalloc (nregs, sizeof (rtx));
+ char *already_moved = xcalloc (nregs, sizeof (char));
for (m = movables->head; m; m = m->next)
{
@@ -2120,8 +2118,8 @@ move_movables (struct loop *loop, struct
}
else if (m->insert_temp)
{
- rtx *reg_map2 = (rtx *) xcalloc (REGNO (newreg),
- sizeof(rtx));
+ rtx *reg_map2 = xcalloc (REGNO (newreg),
+ sizeof(rtx));
reg_map2 [m->regno] = newreg;
i1 = loop_insn_hoist (loop, copy_rtx (PATTERN (p)));
@@ -5068,7 +5066,7 @@ strength_reduce (struct loop *loop, int
addr_placeholder = gen_reg_rtx (Pmode);
ivs->n_regs = max_reg_before_loop;
- ivs->regs = (struct iv *) xcalloc (ivs->n_regs, sizeof (struct iv));
+ ivs->regs = xcalloc (ivs->n_regs, sizeof (struct iv));
/* Find all BIVs in loop. */
loop_bivs_find (loop);
@@ -5122,7 +5120,7 @@ strength_reduce (struct loop *loop, int
Some givs might have been made from biv increments, so look at
ivs->reg_iv_type for a suitable size. */
reg_map_size = ivs->n_regs;
- reg_map = (rtx *) xcalloc (reg_map_size, sizeof (rtx));
+ reg_map = xcalloc (reg_map_size, sizeof (rtx));
/* Examine each iv class for feasibility of strength reduction/induction
variable elimination. */
@@ -5385,8 +5383,7 @@ check_insn_for_bivs (struct loop *loop,
/* It is a possible basic induction variable.
Create and initialize an induction structure for it. */
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
record_biv (loop, v, p, dest_reg, inc_val, mult_val, location,
not_every_iteration, maybe_multiple);
@@ -5449,8 +5446,7 @@ check_insn_for_givs (struct loop *loop,
&add_val, &mult_val, &ext_val,
&last_consec_insn))))
{
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
/* If this is a library call, increase benefit. */
if (find_reg_note (p, REG_RETVAL, NULL_RTX))
@@ -5567,8 +5563,7 @@ find_mem_givs (const struct loop *loop,
GET_MODE (x)))
{
/* Found one; record it. */
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
record_giv (loop, v, insn, src_reg, addr_placeholder, mult_val,
add_val, ext_val, benefit, DEST_ADDR,
@@ -5641,7 +5636,7 @@ record_biv (struct loop *loop, struct in
{
/* Create and initialize new iv_class. */
- bl = (struct iv_class *) xmalloc (sizeof (struct iv_class));
+ bl = xmalloc (sizeof (struct iv_class));
bl->regno = REGNO (dest_reg);
bl->biv = 0;
@@ -6981,7 +6976,7 @@ consec_sets_giv (const struct loop *loop
if (REG_IV_TYPE (ivs, REGNO (dest_reg)) != UNKNOWN_INDUCT)
return 0;
- v = (struct induction *) alloca (sizeof (struct induction));
+ v = alloca (sizeof (struct induction));
v->src_reg = src_reg;
v->mult_val = *mult_val;
v->add_val = *add_val;
@@ -7507,15 +7502,14 @@ combine_givs (struct loop_regs *regs, st
if (!g1->ignore)
giv_count++;
- giv_array
- = (struct induction **) alloca (giv_count * sizeof (struct induction *));
+ giv_array = alloca (giv_count * sizeof (struct induction *));
i = 0;
for (g1 = bl->giv; g1; g1 = g1->next_iv)
if (!g1->ignore)
giv_array[i++] = g1;
- stats = (struct combine_givs_stats *) xcalloc (giv_count, sizeof (*stats));
- can_combine = (rtx *) xcalloc (giv_count, giv_count * sizeof (rtx));
+ stats = xcalloc (giv_count, sizeof (*stats));
+ can_combine = xcalloc (giv_count, giv_count * sizeof (rtx));
for (i = 0; i < giv_count; i++)
{
@@ -9463,9 +9457,8 @@ insert_loop_mem (rtx *mem, void *data AT
else
loop_info->mems_allocated = 32;
- loop_info->mems = (loop_mem_info *)
- xrealloc (loop_info->mems,
- loop_info->mems_allocated * sizeof (loop_mem_info));
+ loop_info->mems = xrealloc (loop_info->mems,
+ loop_info->mems_allocated * sizeof (loop_mem_info));
}
/* Actually insert the MEM. */
@@ -9516,8 +9509,7 @@ loop_regs_scan (const struct loop *loop,
{
regs->size = regs->num + extra_size;
- regs->array = (struct loop_reg *)
- xrealloc (regs->array, regs->size * sizeof (*regs->array));
+ regs->array = xrealloc (regs->array, regs->size * sizeof (*regs->array));
/* Zero the new elements. */
memset (regs->array + old_nregs, 0,
@@ -9532,7 +9524,7 @@ loop_regs_scan (const struct loop *loop,
regs->array[i].single_usage = NULL_RTX;
}
- last_set = (rtx *) xcalloc (regs->num, sizeof (rtx));
+ last_set = xcalloc (regs->num, sizeof (rtx));
/* Scan the loop, recording register usage. */
for (insn = loop->top ? loop->top : loop->start; insn != loop->end;
diff -rup orig/egcc-CVS20030716/gcc/mips-tdump.c egcc-CVS20030716/gcc/mips-tdump.c
--- orig/egcc-CVS20030716/gcc/mips-tdump.c 2003-07-07 14:09:32.000000000 -0400
+++ egcc-CVS20030716/gcc/mips-tdump.c 2003-07-17 14:51:38.079389000 -0400
@@ -884,7 +884,7 @@ print_symbol (SYMR *sym_ptr, int number,
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ scope_ptr = xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
@@ -938,7 +938,7 @@ print_symbol (SYMR *sym_ptr, int number,
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ scope_ptr = xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
@@ -1324,13 +1324,12 @@ read_tfile (void)
short magic;
off_t sym_hdr_offset = 0;
- (void) read_seek (&magic, sizeof (magic), (off_t) 0, "Magic number");
+ read_seek (&magic, sizeof (magic), 0, "Magic number");
if (!tfile)
{
/* Print out the global header, since this is not a T-file. */
- (void) read_seek (&global_hdr, sizeof (global_hdr), (off_t) 0,
- "Global file header");
+ read_seek (&global_hdr, sizeof (global_hdr), 0, "Global file header");
print_global_hdr (&global_hdr);
@@ -1343,70 +1342,45 @@ read_tfile (void)
sym_hdr_offset = global_hdr.f_symptr;
}
- (void) read_seek (&sym_hdr,
- sizeof (sym_hdr),
- sym_hdr_offset,
- "Symbolic header");
+ read_seek (&sym_hdr, sizeof (sym_hdr), sym_hdr_offset, "Symbolic header");
print_sym_hdr (&sym_hdr);
- lines = (LINER *) read_seek (NULL,
- sym_hdr.cbLine,
- sym_hdr.cbLineOffset,
- "Line numbers");
-
- dense_nums = (DNR *) read_seek (NULL,
- sym_hdr.idnMax * sizeof (DNR),
- sym_hdr.cbDnOffset,
- "Dense numbers");
-
- proc_desc = (PDR *) read_seek (NULL,
- sym_hdr.ipdMax * sizeof (PDR),
- sym_hdr.cbPdOffset,
- "Procedure tables");
-
- l_symbols = (SYMR *) read_seek (NULL,
- sym_hdr.isymMax * sizeof (SYMR),
- sym_hdr.cbSymOffset,
- "Local symbols");
-
- opt_symbols = (OPTR *) read_seek (NULL,
- sym_hdr.ioptMax * sizeof (OPTR),
- sym_hdr.cbOptOffset,
- "Optimization symbols");
-
- aux_symbols = (AUXU *) read_seek (NULL,
- sym_hdr.iauxMax * sizeof (AUXU),
- sym_hdr.cbAuxOffset,
- "Auxiliary symbols");
+ lines = read_seek (NULL, sym_hdr.cbLine, sym_hdr.cbLineOffset,
+ "Line numbers");
+
+ dense_nums = read_seek (NULL, sym_hdr.idnMax * sizeof (DNR),
+ sym_hdr.cbDnOffset, "Dense numbers");
+
+ proc_desc = read_seek (NULL, sym_hdr.ipdMax * sizeof (PDR),
+ sym_hdr.cbPdOffset, "Procedure tables");
+
+ l_symbols = read_seek (NULL, sym_hdr.isymMax * sizeof (SYMR),
+ sym_hdr.cbSymOffset, "Local symbols");
+
+ opt_symbols = read_seek (NULL, sym_hdr.ioptMax * sizeof (OPTR),
+ sym_hdr.cbOptOffset, "Optimization symbols");
+
+ aux_symbols = read_seek (NULL, sym_hdr.iauxMax * sizeof (AUXU),
+ sym_hdr.cbAuxOffset, "Auxiliary symbols");
if (sym_hdr.iauxMax > 0)
aux_used = xcalloc (sym_hdr.iauxMax, 1);
- l_strings = (char *) read_seek (NULL,
- sym_hdr.issMax,
- sym_hdr.cbSsOffset,
- "Local string table");
-
- e_strings = (char *) read_seek (NULL,
- sym_hdr.issExtMax,
- sym_hdr.cbSsExtOffset,
- "External string table");
-
- file_desc = (FDR *) read_seek (NULL,
- sym_hdr.ifdMax * sizeof (FDR),
- sym_hdr.cbFdOffset,
- "File tables");
-
- rfile_desc = (ulong *) read_seek (NULL,
- sym_hdr.crfd * sizeof (ulong),
- sym_hdr.cbRfdOffset,
- "Relative file tables");
-
- e_symbols = (EXTR *) read_seek (NULL,
- sym_hdr.iextMax * sizeof (EXTR),
- sym_hdr.cbExtOffset,
- "External symbols");
+ l_strings = read_seek (NULL, sym_hdr.issMax,
+ sym_hdr.cbSsOffset, "Local string table");
+
+ e_strings = read_seek (NULL, sym_hdr.issExtMax,
+ sym_hdr.cbSsExtOffset, "External string table");
+
+ file_desc = read_seek (NULL, sym_hdr.ifdMax * sizeof (FDR),
+ sym_hdr.cbFdOffset, "File tables");
+
+ rfile_desc = read_seek (NULL, sym_hdr.crfd * sizeof (ulong),
+ sym_hdr.cbRfdOffset, "Relative file tables");
+
+ e_symbols = read_seek (NULL, sym_hdr.iextMax * sizeof (EXTR),
+ sym_hdr.cbExtOffset, "External symbols");
}