summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-02-13 02:16:07 -0800
committerYamaArashi <shadow962@live.com>2016-02-13 02:16:07 -0800
commit87926b4bcc3046ac85fabda09178e9bf50dd8381 (patch)
tree5b5ed9076e0200c36f979e0f8baaa23f4406cfd8 /gcc
parent56d3f75d136e839223544f0495cceb098afa1d55 (diff)
remove use of strings.h
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/alias.c12
-rwxr-xr-xgcc/c-common.c40
-rwxr-xr-xgcc/c-decl.c2
-rwxr-xr-xgcc/c-lex.c4
-rwxr-xr-xgcc/calls.c20
-rwxr-xr-xgcc/combine.c24
-rwxr-xr-xgcc/cppexp.c2
-rwxr-xr-xgcc/cppfiles.c12
-rwxr-xr-xgcc/cpphash.c2
-rwxr-xr-xgcc/cpplib.c56
-rwxr-xr-xgcc/cse.c16
-rwxr-xr-xgcc/dwarf2out.c16
-rwxr-xr-xgcc/dwarf2out_020422.c16
-rwxr-xr-xgcc/emit-rtl.c24
-rwxr-xr-xgcc/expmed.c4
-rwxr-xr-xgcc/expr.c54
-rwxr-xr-xgcc/expr.h3
-rwxr-xr-xgcc/final.c10
-rwxr-xr-xgcc/flow.c34
-rwxr-xr-xgcc/fold-const.c10
-rwxr-xr-xgcc/function.c6
-rwxr-xr-xgcc/function_990206.c6
-rwxr-xr-xgcc/gcc.c34
-rwxr-xr-xgcc/gcse.c30
-rwxr-xr-xgcc/genattr.c2
-rwxr-xr-xgcc/genattrtab.c12
-rwxr-xr-xgcc/gengenrtl.c2
-rwxr-xr-xgcc/genrecog.c2
-rwxr-xr-xgcc/global.c28
-rwxr-xr-xgcc/integrate.c22
-rwxr-xr-xgcc/jump.c10
-rwxr-xr-xgcc/local-alloc.c12
-rwxr-xr-xgcc/loop.c36
-rwxr-xr-xgcc/loop_990401.c36
-rwxr-xr-xgcc/optabs.c16
-rwxr-xr-xgcc/prefix.c2
-rwxr-xr-xgcc/print-tree.c2
-rwxr-xr-xgcc/real.c977
-rwxr-xr-xgcc/real.h115
-rwxr-xr-xgcc/recog.c2
-rwxr-xr-xgcc/reg-stack.c12
-rwxr-xr-xgcc/regclass.c20
-rwxr-xr-xgcc/regmove.c6
-rwxr-xr-xgcc/reload.c12
-rwxr-xr-xgcc/reload1.c74
-rwxr-xr-xgcc/reorg.c4
-rwxr-xr-xgcc/resource.c4
-rwxr-xr-xgcc/sbitmap.c4
-rwxr-xr-xgcc/sched.c34
-rwxr-xr-xgcc/stmt.c8
-rwxr-xr-xgcc/stupid.c20
-rwxr-xr-xgcc/system.h65
-rwxr-xr-xgcc/testsuite/gcc.c-torture/unsorted/bcopy.c2
-rwxr-xr-xgcc/testsuite/gcc.c-torture/unsorted/memtst.c2
-rwxr-xr-xgcc/toplev.c4
-rwxr-xr-xgcc/tree.c16
-rwxr-xr-xgcc/unroll.c24
-rwxr-xr-xgcc/unroll_991002.c24
-rwxr-xr-xgcc/varasm.c34
-rwxr-xr-xgcc/varray.c2
60 files changed, 433 insertions, 1651 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index fc6b90b..6fc54cb 100755
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1348,9 +1348,9 @@ init_alias_analysis ()
- FIRST_PSEUDO_REGISTER;
reg_known_equiv_p =
oballoc (maxreg - FIRST_PSEUDO_REGISTER) - FIRST_PSEUDO_REGISTER;
- bzero ((char *) (reg_known_value + FIRST_PSEUDO_REGISTER),
+ zero_memory ((char *) (reg_known_value + FIRST_PSEUDO_REGISTER),
(maxreg-FIRST_PSEUDO_REGISTER) * sizeof (rtx));
- bzero (reg_known_equiv_p + FIRST_PSEUDO_REGISTER,
+ zero_memory (reg_known_equiv_p + FIRST_PSEUDO_REGISTER,
(maxreg - FIRST_PSEUDO_REGISTER) * sizeof (char));
/* Overallocate reg_base_value to allow some growth during loop
@@ -1360,12 +1360,12 @@ init_alias_analysis ()
reg_base_value = (rtx *)oballoc (reg_base_value_size * sizeof (rtx));
new_reg_base_value = (rtx *)alloca (reg_base_value_size * sizeof (rtx));
reg_seen = (char *)alloca (reg_base_value_size);
- bzero ((char *) reg_base_value, reg_base_value_size * sizeof (rtx));
+ zero_memory ((char *) reg_base_value, reg_base_value_size * sizeof (rtx));
if (! reload_completed && flag_unroll_loops)
{
alias_invariant = (rtx *)xrealloc (alias_invariant,
reg_base_value_size * sizeof (rtx));
- bzero ((char *)alias_invariant, reg_base_value_size * sizeof (rtx));
+ zero_memory ((char *)alias_invariant, reg_base_value_size * sizeof (rtx));
}
@@ -1403,10 +1403,10 @@ init_alias_analysis ()
copying_arguments = 1;
/* Wipe the potential alias information clean for this pass. */
- bzero ((char *) new_reg_base_value, reg_base_value_size * sizeof (rtx));
+ zero_memory ((char *) new_reg_base_value, reg_base_value_size * sizeof (rtx));
/* Wipe the reg_seen array clean. */
- bzero ((char *) reg_seen, reg_base_value_size);
+ zero_memory ((char *) reg_seen, reg_base_value_size);
/* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 5f56218..a3160a2 100755
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1462,12 +1462,12 @@ check_format_info (info, params)
}
else if (info->format_type == strftime_format_type)
{
- while (*format_chars != 0 && index ("_-0^#", *format_chars) != 0)
+ while (*format_chars != 0 && strchr ("_-0^#", *format_chars) != 0)
{
if (pedantic)
warning ("ANSI C does not support the strftime `%c' flag",
*format_chars);
- if (index (flag_chars, *format_chars) != 0)
+ if (strchr (flag_chars, *format_chars) != 0)
{
warning ("repeated `%c' flag in format",
*format_chars);
@@ -1530,9 +1530,9 @@ check_format_info (info, params)
}
}
- while (*format_chars != 0 && index (" +#0-", *format_chars) != 0)
+ while (*format_chars != 0 && strchr (" +#0-", *format_chars) != 0)
{
- if (index (flag_chars, *format_chars) != 0)
+ if (strchr (flag_chars, *format_chars) != 0)
warning ("repeated `%c' flag in format", *format_chars++);
else
{
@@ -1543,13 +1543,13 @@ check_format_info (info, params)
}
/* "If the space and + flags both appear,
the space flag will be ignored." */
- if (index (flag_chars, ' ') != 0
- && index (flag_chars, '+') != 0)
+ if (strchr (flag_chars, ' ') != 0
+ && strchr (flag_chars, '+') != 0)
warning ("use of both ` ' and `+' flags in format");
/* "If the 0 and - flags both appear,
the 0 flag will be ignored." */
- if (index (flag_chars, '0') != 0
- && index (flag_chars, '-') != 0)
+ if (strchr (flag_chars, '0') != 0
+ && strchr (flag_chars, '-') != 0)
warning ("use of both `0' and `-' flags in format");
if (*format_chars == '*')
{
@@ -1702,7 +1702,7 @@ check_format_info (info, params)
abort ();
}
while (fci->format_chars != 0
- && index (fci->format_chars, format_char) == 0)
+ && strchr (fci->format_chars, format_char) == 0)
++fci;
if (fci->format_chars == 0)
{
@@ -1716,22 +1716,22 @@ check_format_info (info, params)
}
if (pedantic)
{
- if (index (fci->flag_chars, 'G') != 0)
+ if (strchr (fci->flag_chars, 'G') != 0)
warning ("ANSI C does not support `%%%c'", format_char);
- if (index (fci->flag_chars, 'o') != 0
- && index (flag_chars, 'O') != 0)
+ if (strchr (fci->flag_chars, 'o') != 0
+ && strchr (flag_chars, 'O') != 0)
warning ("ANSI C does not support `%%O%c'", format_char);
}
- if (wide && index (fci->flag_chars, 'w') == 0)
+ if (wide && strchr (fci->flag_chars, 'w') == 0)
warning ("width used with `%c' format", format_char);
- if (index (fci->flag_chars, '2') != 0)
+ if (strchr (fci->flag_chars, '2') != 0)
warning ("`%%%c' yields only last 2 digits of year", format_char);
- else if (index (fci->flag_chars, '3') != 0)
+ else if (strchr (fci->flag_chars, '3') != 0)
warning ("`%%%c' yields only last 2 digits of year in some locales",
format_char);
- if (precise && index (fci->flag_chars, 'p') == 0)
+ if (precise && strchr (fci->flag_chars, 'p') == 0)
warning ("precision used with `%c' format", format_char);
- if (aflag && index (fci->flag_chars, 'a') == 0)
+ if (aflag && strchr (fci->flag_chars, 'a') == 0)
{
warning ("`a' flag used with `%c' format", format_char);
/* To simplify the following code. */
@@ -1757,19 +1757,19 @@ check_format_info (info, params)
}
if (suppressed)
{
- if (index (fci->flag_chars, '*') == 0)
+ if (strchr (fci->flag_chars, '*') == 0)
warning ("suppression of `%c' conversion in format", format_char);
continue;
}
for (i = 0; flag_chars[i] != 0; ++i)
{
- if (index (fci->flag_chars, flag_chars[i]) == 0)
+ if (strchr (fci->flag_chars, flag_chars[i]) == 0)
warning ("flag `%c' used with type `%c'",
flag_chars[i], format_char);
}
if (info->format_type == strftime_format_type)
continue;
- if (precise && index (flag_chars, '0') != 0
+ if (precise && strchr (flag_chars, '0') != 0
&& (format_char == 'd' || format_char == 'i'
|| format_char == 'o' || format_char == 'u'
|| format_char == 'x' || format_char == 'X'))
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index cf98fbd..edfd73a 100755
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2096,7 +2096,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
{
register unsigned olddecl_uid = DECL_UID (olddecl);
- bcopy ((char *) newdecl + sizeof (struct tree_common),
+ copy_memory ((char *) newdecl + sizeof (struct tree_common),
(char *) olddecl + sizeof (struct tree_common),
sizeof (struct tree_decl) - sizeof (struct tree_common));
DECL_UID (olddecl) = olddecl_uid;
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index a8b5d22..834f946 100755
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1432,7 +1432,7 @@ yylex ()
and not the suffixes; once we add `f' or `i',
REAL_VALUE_ATOF may not work any more. */
char *copy = (char *) alloca (p - token_buffer + 1);
- bcopy (token_buffer, copy, p - token_buffer + 1);
+ copy_memory (token_buffer, copy, p - token_buffer + 1);
set_float_handler (handler);
@@ -2014,7 +2014,7 @@ yylex ()
{
if (p + WCHAR_BYTES > token_buffer + maxtoken)
p = extend_token_buffer (p);
- bzero (p, WCHAR_BYTES);
+ zero_memory (p, WCHAR_BYTES);
p += WCHAR_BYTES;
}
else
diff --git a/gcc/calls.c b/gcc/calls.c
index 4c01729..e2a179e 100755
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1271,7 +1271,7 @@ expand_call (exp, target, ignore)
/* Make a vector to hold all the information about each arg. */
args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data));
- bzero ((char *) args, num_actuals * sizeof (struct arg_data));
+ zero_memory ((char *) args, num_actuals * sizeof (struct arg_data));
args_size.constant = 0;
args_size.var = 0;
@@ -1747,11 +1747,11 @@ expand_call (exp, target, ignore)
stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
- bcopy (initial_stack_usage_map, stack_usage_map,
+ copy_memory (initial_stack_usage_map, stack_usage_map,
initial_highest_arg_in_use);
if (initial_highest_arg_in_use != highest_outgoing_arg_in_use)
- bzero (&stack_usage_map[initial_highest_arg_in_use],
+ zero_memory (&stack_usage_map[initial_highest_arg_in_use],
highest_outgoing_arg_in_use - initial_highest_arg_in_use);
needed = 0;
@@ -1819,7 +1819,7 @@ expand_call (exp, target, ignore)
stack_arg_under_construction = 0;
/* Make a new map for the new argument list. */
stack_usage_map = (char *)alloca (highest_outgoing_arg_in_use);
- bzero (stack_usage_map, highest_outgoing_arg_in_use);
+ zero_memory (stack_usage_map, highest_outgoing_arg_in_use);
highest_outgoing_arg_in_use = 0;
}
allocate_dynamic_stack_space (push_size, NULL_RTX, BITS_PER_UNIT);
@@ -2416,7 +2416,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
library functions shouldn't have many args. */
argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
- bzero ((char *) argvec, nargs * sizeof (struct arg));
+ zero_memory ((char *) argvec, nargs * sizeof (struct arg));
INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0);
@@ -2553,11 +2553,11 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
- bcopy (initial_stack_usage_map, stack_usage_map,
+ copy_memory (initial_stack_usage_map, stack_usage_map,
initial_highest_arg_in_use);
if (initial_highest_arg_in_use != highest_outgoing_arg_in_use)
- bzero (&stack_usage_map[initial_highest_arg_in_use],
+ zero_memory (&stack_usage_map[initial_highest_arg_in_use],
highest_outgoing_arg_in_use - initial_highest_arg_in_use);
needed = 0;
@@ -2942,7 +2942,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
library functions shouldn't have many args. */
argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
- bzero ((char *) argvec, (nargs + 1) * sizeof (struct arg));
+ zero_memory ((char *) argvec, (nargs + 1) * sizeof (struct arg));
INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0);
@@ -3116,11 +3116,11 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
- bcopy (initial_stack_usage_map, stack_usage_map,
+ copy_memory (initial_stack_usage_map, stack_usage_map,
initial_highest_arg_in_use);
if (initial_highest_arg_in_use != highest_outgoing_arg_in_use)
- bzero (&stack_usage_map[initial_highest_arg_in_use],
+ zero_memory (&stack_usage_map[initial_highest_arg_in_use],
highest_outgoing_arg_in_use - initial_highest_arg_in_use);
needed = 0;
diff --git a/gcc/combine.c b/gcc/combine.c
index 3fd6fe9..93c1312 100755
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -479,8 +479,8 @@ combine_instructions (f, nregs)
= (unsigned HOST_WIDE_INT *) alloca (nregs * sizeof (HOST_WIDE_INT));
reg_sign_bit_copies = (char *) alloca (nregs * sizeof (char));
- bzero ((char *) reg_nonzero_bits, nregs * sizeof (HOST_WIDE_INT));
- bzero (reg_sign_bit_copies, nregs * sizeof (char));
+ zero_memory ((char *) reg_nonzero_bits, nregs * sizeof (HOST_WIDE_INT));
+ zero_memory (reg_sign_bit_copies, nregs * sizeof (char));
reg_last_death = (rtx *) alloca (nregs * sizeof (rtx));
reg_last_set = (rtx *) alloca (nregs * sizeof (rtx));
@@ -686,15 +686,15 @@ init_reg_last_arrays ()
{
int nregs = combine_max_regno;
- bzero ((char *) reg_last_death, nregs * sizeof (rtx));
- bzero ((char *) reg_last_set, nregs * sizeof (rtx));
- bzero ((char *) reg_last_set_value, nregs * sizeof (rtx));
- bzero ((char *) reg_last_set_table_tick, nregs * sizeof (int));
- bzero ((char *) reg_last_set_label, nregs * sizeof (int));
- bzero (reg_last_set_invalid, nregs * sizeof (char));
- bzero ((char *) reg_last_set_mode, nregs * sizeof (enum machine_mode));
- bzero ((char *) reg_last_set_nonzero_bits, nregs * sizeof (HOST_WIDE_INT));
- bzero (reg_last_set_sign_bit_copies, nregs * sizeof (char));
+ zero_memory ((char *) reg_last_death, nregs * sizeof (rtx));
+ zero_memory ((char *) reg_last_set, nregs * sizeof (rtx));
+ zero_memory ((char *) reg_last_set_value, nregs * sizeof (rtx));
+ zero_memory ((char *) reg_last_set_table_tick, nregs * sizeof (int));
+ zero_memory ((char *) reg_last_set_label, nregs * sizeof (int));
+ zero_memory (reg_last_set_invalid, nregs * sizeof (char));
+ zero_memory ((char *) reg_last_set_mode, nregs * sizeof (enum machine_mode));
+ zero_memory ((char *) reg_last_set_nonzero_bits, nregs * sizeof (HOST_WIDE_INT));
+ zero_memory (reg_last_set_sign_bit_copies, nregs * sizeof (char));
}
/* Set up any promoted values for incoming argument registers. */
@@ -1902,7 +1902,7 @@ try_combine (i3, i2, i1)
rtvec old = XVEC (newpat, 0);
total_sets = XVECLEN (newpat, 0) + added_sets_1 + added_sets_2;
newpat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total_sets));
- bcopy ((char *) &old->elem[0], (char *) XVEC (newpat, 0)->elem,
+ copy_memory ((char *) &old->elem[0], (char *) XVEC (newpat, 0)->elem,
sizeof (old->elem[0]) * old->num_elem);
}
else
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index bd8e663..65b9760 100755
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -994,7 +994,7 @@ cpp_parse_expr (pfile)
else
{
new_stack = (struct operation *) xmalloc (new_size);
- bcopy ((char *) stack, (char *) new_stack, old_size);
+ copy_memory ((char *) stack, (char *) new_stack, old_size);
}
stack = new_stack;
top = (struct operation *) ((char *) new_stack + old_size);
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 6ad672d..c6202f9 100755
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -431,7 +431,7 @@ find_include_file (pfile, fname, search_start, ihash, before)
for (l = search_start; l; l = l->next)
{
- bcopy (l->name, name, l->nlen);
+ copy_memory (l->name, name, l->nlen);
name[l->nlen] = '/';
strcpy (&name[l->nlen+1], fname);
simplify_pathname (name);
@@ -632,7 +632,7 @@ remap_filename (pfile, name, loc)
looking in. Thus #include <sys/types.h> will look up sys/types.h
in /usr/include/header.gcc and look up types.h in
/usr/include/sys/header.gcc. */
- p = rindex (name, '/');
+ p = strrchr (name, '/');
if (!p)
p = name;
if (loc && loc->name
@@ -649,7 +649,7 @@ remap_filename (pfile, name, loc)
else
{
char * newdir = (char *) alloca (p - name + 1);
- bcopy (name, newdir, p - name);
+ copy_memory (name, newdir, p - name);
newdir[p - name] = '\0';
dir = newdir;
from = p + 1;
@@ -796,7 +796,7 @@ actual_directory (pfile, fname)
struct file_name_list *x;
dir = xstrdup (fname);
- last_slash = rindex (dir, '/');
+ last_slash = strrchr (dir, '/');
if (last_slash)
{
if (last_slash == dir)
@@ -917,13 +917,13 @@ deps_output (pfile, string, spacer)
if (cr)
{
- bcopy (" \\\n ", &pfile->deps_buffer[pfile->deps_size], 5);
+ copy_memory (" \\\n ", &pfile->deps_buffer[pfile->deps_size], 5);
pfile->deps_size += 5;
}
if (spacer == ' ' && pfile->deps_column > 0)
pfile->deps_buffer[pfile->deps_size++] = ' ';
- bcopy (string, &pfile->deps_buffer[pfile->deps_size], size);
+ copy_memory (string, &pfile->deps_buffer[pfile->deps_size], size);
pfile->deps_size += size;
pfile->deps_column += size;
if (spacer == ':')
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 2ce8a3c..2ae3ad6 100755
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -182,7 +182,7 @@ install (name, len, type, ivalue, value, hash)
else
hp->value.cpval = value;
hp->name = ((U_CHAR *) hp) + sizeof (HASHNODE);
- bcopy (name, hp->name, len);
+ copy_memory (name, hp->name, len);
hp->name[len] = 0;
return hp;
}
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 705741f..dc0e555 100755
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -548,7 +548,7 @@ path_include (pfile, path)
} else {
/* Otherwise use the directory that is named. */
name = (char *) xmalloc (q - p + 1);
- bcopy (p, name, q - p);
+ copy_memory (p, name, q - p);
name[q - p] = 0;
}
@@ -568,7 +568,7 @@ void
cpp_options_init (opts)
cpp_options *opts;
{
- bzero ((char *) opts, sizeof *opts);
+ zero_memory ((char *) opts, sizeof *opts);
opts->in_fname = NULL;
opts->out_fname = NULL;
@@ -1357,7 +1357,7 @@ create_definition (buf, limit, pfile, predefinition)
struct arglist *temp;
int i = 0;
for (temp = arg_ptrs; temp; temp = temp->next) {
- bcopy (temp->name, &defn->args.argnames[i], temp->length);
+ copy_memory (temp->name, &defn->args.argnames[i], temp->length);
i += temp->length;
if (temp->next != 0) {
defn->args.argnames[i++] = ',';
@@ -1434,7 +1434,7 @@ check_macro_name (pfile, symname, usage)
else if (!is_idstart[*symname]) {
U_CHAR *msg; /* what pain... */
msg = (U_CHAR *) alloca (sym_length + 1);
- bcopy (symname, msg, sym_length);
+ copy_memory (symname, msg, sym_length);
msg[sym_length] = 0;
cpp_error (pfile, "invalid %s name `%s'", usage, msg);
} else {
@@ -1546,7 +1546,7 @@ do_define (pfile, keyword)
buf = pfile->token_buffer + here;
end = CPP_PWRITTEN (pfile);
macro = alloca (end - buf + 1);
- bcopy (buf, macro, end - buf + 1);
+ copy_memory (buf, macro, end - buf + 1);
end = macro + (end - buf);
CPP_SET_WRITTEN (pfile, here);
@@ -1587,7 +1587,7 @@ do_define (pfile, keyword)
msg = (U_CHAR *) alloca (mdef.symlen + 22);
*msg = '`';
- bcopy (mdef.symnam, msg + 1, mdef.symlen);
+ copy_memory (mdef.symnam, msg + 1, mdef.symlen);
strcpy ((char *) (msg + mdef.symlen + 1), "' redefined");
cpp_pedwarn (pfile, msg);
if (hp->type == T_MACRO)
@@ -1656,7 +1656,7 @@ cpp_push_buffer (pfile, buffer, length)
return NULL;
}
buf--;
- bzero ((char *) buf, sizeof (cpp_buffer));
+ zero_memory ((char *) buf, sizeof (cpp_buffer));
CPP_BUFFER (pfile) = buf;
buf->if_stack = pfile->if_stack;
buf->cleanup = null_cleanup;
@@ -2161,7 +2161,7 @@ special_symbol (hp, pfile)
sprintf (buf, "%d", hp->value.ival);
#ifdef STDC_0_IN_SYSTEM_HEADERS
if (ip->system_header_p
- && hp->length == 8 && bcmp (hp->name, "__STDC__", 8) == 0
+ && hp->length == 8 && memcmp (hp->name, "__STDC__", 8) == 0
&& ! cpp_lookup (pfile, (U_CHAR *) "__STRICT_ANSI__", -1, -1))
strcpy (buf, "0");
#endif
@@ -2684,7 +2684,7 @@ macroexpand (pfile, hp)
if (ap->stringify != 0)
{
- bcopy (ARG_BASE + arg->stringified,
+ copy_memory (ARG_BASE + arg->stringified,
xbuf + totlen, arg->stringified_length);
totlen += arg->stringified_length;
}
@@ -2737,7 +2737,7 @@ macroexpand (pfile, hp)
if (p1[0] == '@' && p1[1] == '-')
p1 += 2;
- bcopy (p1, xbuf + totlen, l1 - p1);
+ copy_memory (p1, xbuf + totlen, l1 - p1);
totlen += l1 - p1;
}
else
@@ -2751,7 +2751,7 @@ macroexpand (pfile, hp)
xbuf[totlen++] = ' ';
}
- bcopy (expanded, xbuf + totlen, arg->expand_length);
+ copy_memory (expanded, xbuf + totlen, arg->expand_length);
totlen += arg->expand_length;
if (!ap->raw_after && totlen > 0 && offset < defn->length
@@ -3264,7 +3264,7 @@ do_line (pfile, keyword)
hp->length = fname_length;
ip->nominal_fname = hp->value.cpval = ((char *) hp) + sizeof (HASHNODE);
- bcopy (fname, hp->value.cpval, fname_length);
+ copy_memory (fname, hp->value.cpval, fname_length);
}
}
else if (token != CPP_VSPACE && token != CPP_EOF) {
@@ -3313,7 +3313,7 @@ do_undef (pfile, keyword)
/* Copy out the token so we can pop the token buffer. */
name = alloca (limit - buf + 1);
- bcopy(buf, name, limit - buf);
+ copy_memory(buf, name, limit - buf);
name[limit - buf] = '\0';
token = get_directive_token (pfile);
@@ -3474,10 +3474,10 @@ do_pragma (pfile, keyword)
return 0;
fname = p + 1;
- p = (U_CHAR *) index (fname, '\"');
+ p = (U_CHAR *) strchr (fname, '\"');
fcopy = alloca (p - fname + 1);
- bcopy (fname, fcopy, p - fname);
+ copy_memory (fname, fcopy, p - fname);
fcopy[p-fname] = '\0';
ptr = include_hash (pfile, fcopy, 0);
@@ -3640,7 +3640,7 @@ do_xifdef (pfile, keyword)
if (start_of_file && !skip)
{
control_macro = (U_CHAR *) xmalloc (ident_length + 1);
- bcopy (ident, control_macro, ident_length + 1);
+ copy_memory (ident, control_macro, ident_length + 1);
}
}
else
@@ -4103,14 +4103,14 @@ cpp_get_token (pfile)
if (lintcmd != NULL) {
/* I believe it is always safe to emit this newline: */
obp[-1] = '\n';
- bcopy ("#pragma lint ", (char *) obp, 13);
+ copy_memory ("#pragma lint ", (char *) obp, 13);
obp += 13;
- bcopy (lintcmd, (char *) obp, cmdlen);
+ copy_memory (lintcmd, (char *) obp, cmdlen);
obp += cmdlen;
if (arglen != 0) {
*(obp++) = ' ';
- bcopy (argbp, (char *) obp, arglen);
+ copy_memory (argbp, (char *) obp, arglen);
obp += arglen;
}
@@ -4571,7 +4571,7 @@ cpp_get_token (pfile)
xbuf_len = CPP_WRITTEN (pfile) - before_name_written;
xbuf = (U_CHAR *) xmalloc (xbuf_len + 1);
CPP_SET_WRITTEN (pfile, before_name_written);
- bcopy (CPP_PWRITTEN (pfile), xbuf, xbuf_len + 1);
+ copy_memory (CPP_PWRITTEN (pfile), xbuf, xbuf_len + 1);
push_macro_expansion (pfile, xbuf, xbuf_len, hp);
}
else
@@ -4906,7 +4906,7 @@ cpp_start_read (pfile, fname)
endp++;
}
/* Put the usual defaults back in at the end. */
- bcopy ((char *) include_defaults_array,
+ copy_memory ((char *) include_defaults_array,
(char *) &include_defaults[num_dirs],
sizeof (include_defaults_array));
}
@@ -5017,7 +5017,7 @@ cpp_start_read (pfile, fname)
{
opts->deps_target = s + 1;
output_file = (char *) xmalloc (s - spec + 1);
- bcopy (spec, output_file, s - spec);
+ copy_memory (spec, output_file, s - spec);
output_file[s - spec] = 0;
}
else
@@ -5054,9 +5054,9 @@ cpp_start_read (pfile, fname)
};
/* Discard all directory prefixes from filename. */
- if ((q = rindex (opts->in_fname, '/')) != NULL
+ if ((q = strrchr (opts->in_fname, '/')) != NULL
#ifdef DIR_SEPARATOR
- && (q = rindex (opts->in_fname, DIR_SEPARATOR)) != NULL
+ && (q = strrchr (opts->in_fname, DIR_SEPARATOR)) != NULL
#endif
)
++q;
@@ -5071,7 +5071,7 @@ cpp_start_read (pfile, fname)
len = strlen (p);
q = p + len;
/* Point to the filename suffix. */
- r = rindex (p, '.');
+ r = strrchr (p, '.');
/* Compare against the known suffixes. */
x = 0;
while (known_suffixes[x] != 0)
@@ -5216,7 +5216,7 @@ void
cpp_reader_init (pfile)
cpp_reader *pfile;
{
- bzero ((char *) pfile, sizeof (cpp_reader));
+ zero_memory ((char *) pfile, sizeof (cpp_reader));
pfile->get_token = cpp_get_token;
pfile->token_buffer_size = 200;
@@ -6042,7 +6042,7 @@ do_assert (pfile, keyword)
}
thislen = strlen (sym);
- baselen = index (sym, '(') - sym;
+ baselen = strchr (sym, '(') - sym;
this = cpp_lookup (pfile, sym, thislen, -1);
if (this)
{
@@ -6118,7 +6118,7 @@ do_unassert (pfile, keyword)
}
else
{
- baselen = index (sym, '(') - sym;
+ baselen = strchr (sym, '(') - sym;
base = cpp_lookup (pfile, sym, baselen, -1);
if (! base) goto error;
this = cpp_lookup (pfile, sym, thislen, -1);
diff --git a/gcc/cse.c b/gcc/cse.c
index 95b56ea..1fed1cc 100755
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -797,11 +797,11 @@ new_basic_block ()
next_qty = max_reg;
- bzero ((char *) reg_tick, max_reg * sizeof (int));
+ zero_memory ((char *) reg_tick, max_reg * sizeof (int));
- bcopy ((char *) all_minus_one, (char *) reg_in_table,
+ copy_memory ((char *) all_minus_one, (char *) reg_in_table,
max_reg * sizeof (int));
- bcopy ((char *) consec_ints, (char *) reg_qty, max_reg * sizeof (int));
+ copy_memory ((char *) consec_ints, (char *) reg_qty, max_reg * sizeof (int));
CLEAR_HARD_REG_SET (hard_regs_in_table);
/* The per-quantity values used to be initialized here, but it is
@@ -817,7 +817,7 @@ new_basic_block ()
}
}
- bzero ((char *) table, sizeof table);
+ zero_memory ((char *) table, sizeof table);
prev_insn = 0;
@@ -4371,7 +4371,7 @@ simplify_plus_minus (code, mode, op0, op1)
int first = 1, negate = 0, changed;
int i, j;
- bzero ((char *) ops, sizeof ops);
+ zero_memory ((char *) ops, sizeof ops);
/* Set up the two operands and then expand them until nothing has been
changed. If we run out of room in our array, give up; this should
@@ -8584,7 +8584,7 @@ cse_main (f, nregs, after_loop, file)
/* Discard all the free elements of the previous function
since they are allocated in the temporarily obstack. */
- bzero ((char *) table, sizeof table);
+ zero_memory ((char *) table, sizeof table);
free_element_chain = 0;
n_elements_made = 0;
@@ -8592,7 +8592,7 @@ cse_main (f, nregs, after_loop, file)
max_uid = get_max_uid ();
uid_cuid = (int *) alloca ((max_uid + 1) * sizeof (int));
- bzero ((char *) uid_cuid, (max_uid + 1) * sizeof (int));
+ zero_memory ((char *) uid_cuid, (max_uid + 1) * sizeof (int));
/* Compute the mapping from uids to cuids.
CUIDs are numbers assigned to insns, like uids,
@@ -9056,7 +9056,7 @@ delete_trivially_dead_insns (insns, nreg)
int in_libcall = 0, dead_libcall = 0;
/* First count the number of times each register is used. */
- bzero ((char *) counts, sizeof (int) * nreg);
+ zero_memory ((char *) counts, sizeof (int) * nreg);
for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
count_reg_usage (insn, counts, NULL_RTX, 1);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9329c71..b51159b 100755
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1955,7 +1955,7 @@ dwarf2out_frame_init ()
/* Allocate the initial hunk of the fde_table. */
fde_table
= (dw_fde_ref) xmalloc (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
- bzero ((char *) fde_table, FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
+ zero_memory ((char *) fde_table, FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
fde_table_allocated = FDE_TABLE_INCREMENT;
fde_table_in_use = 0;
@@ -4188,7 +4188,7 @@ equate_decl_number_to_die (decl, decl_die)
= (dw_die_ref *) xrealloc (decl_die_table,
sizeof (dw_die_ref) * num_allocated);
- bzero ((char *) &decl_die_table[decl_die_table_allocated],
+ zero_memory ((char *) &decl_die_table[decl_die_table_allocated],
(num_allocated - decl_die_table_allocated) * sizeof (dw_die_ref));
decl_die_table_allocated = num_allocated;
}
@@ -4460,7 +4460,7 @@ build_abbrev_table (die)
= (dw_die_ref *) xrealloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
- bzero ((char *) &abbrev_die_table[abbrev_die_table_allocated],
+ zero_memory ((char *) &abbrev_die_table[abbrev_die_table_allocated],
(n_alloc - abbrev_die_table_allocated) * sizeof (dw_die_ref));
abbrev_die_table_allocated = n_alloc;
}
@@ -9773,7 +9773,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
/* Allocate the initial hunk of the file_table. */
file_table = (char **) xmalloc (FILE_TABLE_INCREMENT * sizeof (char *));
- bzero ((char *) file_table, FILE_TABLE_INCREMENT * sizeof (char *));
+ zero_memory ((char *) file_table, FILE_TABLE_INCREMENT * sizeof (char *));
file_table_allocated = FILE_TABLE_INCREMENT;
/* Skip the first entry - file numbers begin at 1. */
@@ -9782,7 +9782,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
/* Allocate the initial hunk of the decl_die_table. */
decl_die_table
= (dw_die_ref *) xmalloc (DECL_DIE_TABLE_INCREMENT * sizeof (dw_die_ref));
- bzero ((char *) decl_die_table,
+ zero_memory ((char *) decl_die_table,
DECL_DIE_TABLE_INCREMENT * sizeof (dw_die_ref));
decl_die_table_allocated = DECL_DIE_TABLE_INCREMENT;
decl_die_table_in_use = 0;
@@ -9791,7 +9791,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
decl_scope_table
= (decl_scope_node *) xmalloc (DECL_SCOPE_TABLE_INCREMENT
* sizeof (decl_scope_node));
- bzero ((char *) decl_scope_table,
+ zero_memory ((char *) decl_scope_table,
DECL_SCOPE_TABLE_INCREMENT * sizeof (decl_scope_node));
decl_scope_table_allocated = DECL_SCOPE_TABLE_INCREMENT;
decl_scope_depth = 0;
@@ -9800,7 +9800,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
abbrev_die_table
= (dw_die_ref *) xmalloc (ABBREV_DIE_TABLE_INCREMENT
* sizeof (dw_die_ref));
- bzero ((char *) abbrev_die_table,
+ zero_memory ((char *) abbrev_die_table,
ABBREV_DIE_TABLE_INCREMENT * sizeof (dw_die_ref));
abbrev_die_table_allocated = ABBREV_DIE_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
@@ -9810,7 +9810,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
line_info_table
= (dw_line_info_ref) xmalloc (LINE_INFO_TABLE_INCREMENT
* sizeof (dw_line_info_entry));
- bzero ((char *) line_info_table,
+ zero_memory ((char *) line_info_table,
LINE_INFO_TABLE_INCREMENT * sizeof (dw_line_info_entry));
line_info_table_allocated = LINE_INFO_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
diff --git a/gcc/dwarf2out_020422.c b/gcc/dwarf2out_020422.c
index d5d85e9..64a4968 100755
--- a/gcc/dwarf2out_020422.c
+++ b/gcc/dwarf2out_020422.c
@@ -1950,7 +1950,7 @@ dwarf2out_frame_init ()
/* Allocate the initial hunk of the fde_table. */
fde_table
= (dw_fde_ref) xmalloc (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
- bzero ((char *) fde_table, FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
+ zero_memory ((char *) fde_table, FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
fde_table_allocated = FDE_TABLE_INCREMENT;
fde_table_in_use = 0;
@@ -4179,7 +4179,7 @@ equate_decl_number_to_die (decl, decl_die)
= (dw_die_ref *) xrealloc (decl_die_table,
sizeof (dw_die_ref) * num_allocated);
- bzero ((char *) &decl_die_table[decl_die_table_allocated],
+ zero_memory ((char *) &decl_die_table[decl_die_table_allocated],
(num_allocated - decl_die_table_allocated) * sizeof (dw_die_ref));
decl_die_table_allocated = num_allocated;
}
@@ -4451,7 +4451,7 @@ build_abbrev_table (die)
= (dw_die_ref *) xrealloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
- bzero ((char *) &abbrev_die_table[abbrev_die_table_allocated],
+ zero_memory ((char *) &abbrev_die_table[abbrev_die_table_allocated],
(n_alloc - abbrev_die_table_allocated) * sizeof (dw_die_ref));
abbrev_die_table_allocated = n_alloc;
}
@@ -9764,7 +9764,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
/* Allocate the initial hunk of the file_table. */
file_table = (char **) xmalloc (FILE_TABLE_INCREMENT * sizeof (char *));
- bzero ((char *) file_table, FILE_TABLE_INCREMENT * sizeof (char *));
+ zero_memory ((char *) file_table, FILE_TABLE_INCREMENT * sizeof (char *));
file_table_allocated = FILE_TABLE_INCREMENT;
/* Skip the first entry - file numbers begin at 1. */
@@ -9773,7 +9773,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
/* Allocate the initial hunk of the decl_die_table. */
decl_die_table
= (dw_die_ref *) xmalloc (DECL_DIE_TABLE_INCREMENT * sizeof (dw_die_ref));
- bzero ((char *) decl_die_table,
+ zero_memory ((char *) decl_die_table,
DECL_DIE_TABLE_INCREMENT * sizeof (dw_die_ref));
decl_die_table_allocated = DECL_DIE_TABLE_INCREMENT;
decl_die_table_in_use = 0;
@@ -9782,7 +9782,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
decl_scope_table
= (decl_scope_node *) xmalloc (DECL_SCOPE_TABLE_INCREMENT
* sizeof (decl_scope_node));
- bzero ((char *) decl_scope_table,
+ zero_memory ((char *) decl_scope_table,
DECL_SCOPE_TABLE_INCREMENT * sizeof (decl_scope_node));
decl_scope_table_allocated = DECL_SCOPE_TABLE_INCREMENT;
decl_scope_depth = 0;
@@ -9791,7 +9791,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
abbrev_die_table
= (dw_die_ref *) xmalloc (ABBREV_DIE_TABLE_INCREMENT
* sizeof (dw_die_ref));
- bzero ((char *) abbrev_die_table,
+ zero_memory ((char *) abbrev_die_table,
ABBREV_DIE_TABLE_INCREMENT * sizeof (dw_die_ref));
abbrev_die_table_allocated = ABBREV_DIE_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
@@ -9801,7 +9801,7 @@ dwarf2out_init (asm_out_file, main_input_filename)
line_info_table
= (dw_line_info_ref) xmalloc (LINE_INFO_TABLE_INCREMENT
* sizeof (dw_line_info_entry));
- bzero ((char *) line_info_table,
+ zero_memory ((char *) line_info_table,
LINE_INFO_TABLE_INCREMENT * sizeof (dw_line_info_entry));
line_info_table_allocated = LINE_INFO_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index fcfc931..f429c77 100755
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -539,19 +539,19 @@ gen_reg_rtx (mode)
rtx *new1;
char *new =
(char *) savealloc (regno_pointer_flag_length * 2);
- bcopy (regno_pointer_flag, new, regno_pointer_flag_length);
- bzero (&new[regno_pointer_flag_length], regno_pointer_flag_length);
+ copy_memory (regno_pointer_flag, new, regno_pointer_flag_length);
+ zero_memory (&new[regno_pointer_flag_length], regno_pointer_flag_length);
regno_pointer_flag = new;
new = (char *) savealloc (regno_pointer_flag_length * 2);
- bcopy (regno_pointer_align, new, regno_pointer_flag_length);
- bzero (&new[regno_pointer_flag_length], regno_pointer_flag_length);
+ copy_memory (regno_pointer_align, new, regno_pointer_flag_length);
+ zero_memory (&new[regno_pointer_flag_length], regno_pointer_flag_length);
regno_pointer_align = new;
new1 = (rtx *) savealloc (regno_pointer_flag_length * 2 * sizeof (rtx));
- bcopy ((char *) regno_reg_rtx, (char *) new1,
+ copy_memory ((char *) regno_reg_rtx, (char *) new1,
regno_pointer_flag_length * sizeof (rtx));
- bzero ((char *) &new1[regno_pointer_flag_length],
+ zero_memory ((char *) &new1[regno_pointer_flag_length],
regno_pointer_flag_length * sizeof (rtx));
regno_reg_rtx = new1;
@@ -1767,7 +1767,7 @@ copy_rtx_if_shared (orig)
register rtx copy;
copy = rtx_alloc (code);
- bcopy ((char *) x, (char *) copy,
+ copy_memory ((char *) x, (char *) copy,
(sizeof (*copy) - sizeof (copy->fld)
+ sizeof (copy->fld[0]) * GET_RTX_LENGTH (code)));
x = copy;
@@ -3408,15 +3408,15 @@ init_emit ()
regno_pointer_flag
= (char *) savealloc (regno_pointer_flag_length);
- bzero (regno_pointer_flag, regno_pointer_flag_length);
+ zero_memory (regno_pointer_flag, regno_pointer_flag_length);
regno_pointer_align
= (char *) savealloc (regno_pointer_flag_length);
- bzero (regno_pointer_align, regno_pointer_flag_length);
+ zero_memory (regno_pointer_align, regno_pointer_flag_length);
regno_reg_rtx
= (rtx *) savealloc (regno_pointer_flag_length * sizeof (rtx));
- bzero ((char *) regno_reg_rtx, regno_pointer_flag_length * sizeof (rtx));
+ zero_memory ((char *) regno_reg_rtx, regno_pointer_flag_length * sizeof (rtx));
/* Put copies of all the virtual register rtx into regno_reg_rtx. */
init_virtual_regs ();
@@ -3532,10 +3532,10 @@ init_emit_once (line_numbers)
rtx tem = rtx_alloc (CONST_DOUBLE);
union real_extract u;
- bzero ((char *) &u, sizeof u); /* Zero any holes in a structure. */
+ zero_memory ((char *) &u, sizeof u); /* Zero any holes in a structure. */
u.d = i == 0 ? dconst0 : i == 1 ? dconst1 : dconst2;
- bcopy ((char *) &u, (char *) &CONST_DOUBLE_LOW (tem), sizeof u);
+ copy_memory ((char *) &u, (char *) &CONST_DOUBLE_LOW (tem), sizeof u);
CONST_DOUBLE_MEM (tem) = cc0_rtx;
PUT_MODE (tem, mode);
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 716a7e5..2cfcfa9 100755
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2289,9 +2289,9 @@ synth_mult (alg_out, t, cost_limit)
best_alg is normally undefined, and this is a critical function. */
alg_out->ops = best_alg->ops + 1;
alg_out->cost = cost_limit;
- bcopy ((char *) best_alg->op, (char *) alg_out->op,
+ copy_memory ((char *) best_alg->op, (char *) alg_out->op,
alg_out->ops * sizeof *alg_out->op);
- bcopy ((char *) best_alg->log, (char *) alg_out->log,
+ copy_memory ((char *) best_alg->log, (char *) alg_out->log,
alg_out->ops * sizeof *alg_out->log);
}
diff --git a/gcc/expr.c b/gcc/expr.c
index 29fea7f..5d9ff6a 100755
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1652,10 +1652,8 @@ emit_block_move (x, y, size, align)
int align;
{
rtx retval = 0;
-#ifdef TARGET_MEM_FUNCTIONS
static tree fn;
tree call_expr, arg_list;
-#endif
if (GET_MODE (x) != BLKmode)
abort ();
@@ -1727,7 +1725,6 @@ emit_block_move (x, y, size, align)
}
}
-#ifdef TARGET_MEM_FUNCTIONS
/* It is incorrect to use the libcall calling conventions to call
memcpy in this context.
@@ -1782,14 +1779,6 @@ emit_block_move (x, y, size, align)
TREE_SIDE_EFFECTS (call_expr) = 1;
retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
-#else
- emit_library_call (bcopy_libfunc, 0,
- VOIDmode, 3, XEXP (y, 0), Pmode,
- XEXP (x, 0), Pmode,
- convert_to_mode (TYPE_MODE (integer_type_node), size,
- TREE_UNSIGNED (integer_type_node)),
- TYPE_MODE (integer_type_node));
-#endif
}
return retval;
@@ -2395,10 +2384,8 @@ clear_storage (object, size, align)
rtx size;
int align;
{
-#ifdef TARGET_MEM_FUNCTIONS
static tree fn;
tree call_expr, arg_list;
-#endif
rtx retval = 0;
if (GET_MODE (object) == BLKmode)
@@ -2462,7 +2449,6 @@ clear_storage (object, size, align)
}
-#ifdef TARGET_MEM_FUNCTIONS
/* It is incorrect to use the libcall calling conventions to call
memset in this context.
@@ -2517,15 +2503,6 @@ clear_storage (object, size, align)
TREE_SIDE_EFFECTS (call_expr) = 1;
retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
-#else
- emit_library_call (bzero_libfunc, 0,
- VOIDmode, 2,
- XEXP (object, 0), Pmode,
- convert_to_mode
- (TYPE_MODE (integer_type_node), size,
- TREE_UNSIGNED (integer_type_node)),
- TYPE_MODE (integer_type_node));
-#endif
}
}
else
@@ -3085,20 +3062,11 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
/* Make inhibit_defer_pop nonzero around the library call
to force it to pop the bcopy-arguments right away. */
NO_DEFER_POP;
-#ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcpy_libfunc, 0,
VOIDmode, 3, temp, Pmode, XEXP (xinner, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype),
size, TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
-#else
- emit_library_call (bcopy_libfunc, 0,
- VOIDmode, 3, XEXP (xinner, 0), Pmode, temp, Pmode,
- convert_to_mode (TYPE_MODE (integer_type_node),
- size,
- TREE_UNSIGNED (integer_type_node)),
- TYPE_MODE (integer_type_node));
-#endif
OK_DEFER_POP;
}
}
@@ -3496,21 +3464,12 @@ expand_assignment (to, from, want_value, suggest_reg)
size, TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
-#ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcpy_libfunc, 0,
VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
XEXP (from_rtx, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype),
size, TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
-#else
- emit_library_call (bcopy_libfunc, 0,
- VOIDmode, 3, XEXP (from_rtx, 0), Pmode,
- XEXP (to_rtx, 0), Pmode,
- convert_to_mode (TYPE_MODE (integer_type_node),
- size, TREE_UNSIGNED (integer_type_node)),
- TYPE_MODE (integer_type_node));
-#endif
preserve_temp_slots (to_rtx);
free_temp_slots ();
@@ -3831,7 +3790,6 @@ store_expr (exp, target, want_value)
size, TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_WO),
TYPE_MODE (integer_type_node));
-#ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memset_libfunc, 0, VOIDmode, 3,
addr, ptr_mode,
const0_rtx, TYPE_MODE (integer_type_node),
@@ -3839,14 +3797,6 @@ store_expr (exp, target, want_value)
size,
TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
-#else
- emit_library_call (bzero_libfunc, 0, VOIDmode, 2,
- addr, ptr_mode,
- convert_to_mode (TYPE_MODE (integer_type_node),
- size,
- TREE_UNSIGNED (integer_type_node)),
- TYPE_MODE (integer_type_node));
-#endif
}
if (label)
@@ -4487,9 +4437,7 @@ store_constructor (exp, target, cleared)
tree startbit = TREE_PURPOSE (elt);
/* end of range of element, or element value */
tree endbit = TREE_VALUE (elt);
-#ifdef TARGET_MEM_FUNCTIONS
HOST_WIDE_INT startb, endb;
-#endif
rtx bitlength_rtx, startbit_rtx, endbit_rtx, targetx;
bitlength_rtx = expand_expr (bitlength,
@@ -4525,7 +4473,6 @@ store_constructor (exp, target, cleared)
else
abort ();
-#ifdef TARGET_MEM_FUNCTIONS
/* Optimization: If startbit and endbit are
constants divisible by BITS_PER_UNIT,
call memset instead. */
@@ -4544,7 +4491,6 @@ store_constructor (exp, target, cleared)
TYPE_MODE (sizetype));
}
else
-#endif
{
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"),
0, VOIDmode, 4, XEXP (targetx, 0), Pmode,
diff --git a/gcc/expr.h b/gcc/expr.h
index 7825a52..7df6386 100755
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -457,11 +457,8 @@ extern rtx truncxfdf2_libfunc;
extern rtx trunctfdf2_libfunc;
extern rtx memcpy_libfunc;
-extern rtx bcopy_libfunc;
extern rtx memcmp_libfunc;
-extern rtx bcmp_libfunc;
extern rtx memset_libfunc;
-extern rtx bzero_libfunc;
extern rtx throw_libfunc;
extern rtx rethrow_libfunc;
diff --git a/gcc/final.c b/gcc/final.c
index 96836ed..8e1cc7e 100755
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -734,7 +734,7 @@ shorten_branches (first)
min_labelno = get_first_label_num ();
label_align = (struct label_alignment *) xmalloc (
(max_labelno - min_labelno + 1) * sizeof (struct label_alignment));
- bzero ((char *) label_align,
+ zero_memory ((char *) label_align,
(max_labelno - min_labelno + 1) * sizeof (struct label_alignment));
uid_shuid = (int *) xmalloc (max_uid * sizeof *uid_shuid);
@@ -859,12 +859,12 @@ shorten_branches (first)
insn_lengths_max_uid = max_uid;
/* Syntax errors can lead to labels being outside of the main insn stream.
Initialize insn_addresses, so that we get reproducible results. */
- bzero ((char *)insn_addresses, max_uid * sizeof *insn_addresses);
+ zero_memory ((char *)insn_addresses, max_uid * sizeof *insn_addresses);
uid_align = (rtx *) xmalloc (max_uid * sizeof *uid_align);
varying_length = (char *) xmalloc (max_uid * sizeof (char));
- bzero (varying_length, max_uid);
+ zero_memory (varying_length, max_uid);
/* Initialize uid_align. We scan instructions
from end to start, and keep in align_tab[n] the last seen insn
@@ -872,7 +872,7 @@ shorten_branches (first)
in the alignment chain for an insn that does / has a known
alignment of n. */
- bzero ((char *) uid_align, max_uid * sizeof *uid_align);
+ zero_memory ((char *) uid_align, max_uid * sizeof *uid_align);
for (i = MAX_CODE_ALIGN; --i >= 0; )
align_tab[i] = NULL_RTX;
@@ -1427,7 +1427,7 @@ final (first, file, optimize, prescan)
max_line = NOTE_LINE_NUMBER (insn);
line_note_exists = (char *) oballoc (max_line + 1);
- bzero (line_note_exists, max_line + 1);
+ zero_memory (line_note_exists, max_line + 1);
for (insn = first; insn; insn = NEXT_INSN (insn))
{
diff --git a/gcc/flow.c b/gcc/flow.c
index a9dc272..495523f 100755
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -400,14 +400,14 @@ find_basic_blocks (f, nregs, file)
x_basic_block_end = XNMALLOC (rtx, n_basic_blocks);
basic_block_succ = XNMALLOC (int_list_ptr, n_basic_blocks);
basic_block_pred = XNMALLOC (int_list_ptr, n_basic_blocks);
- bzero ((char *)basic_block_succ, n_basic_blocks * sizeof (int_list_ptr));
- bzero ((char *)basic_block_pred, n_basic_blocks * sizeof (int_list_ptr));
+ zero_memory ((char *)basic_block_succ, n_basic_blocks * sizeof (int_list_ptr));
+ zero_memory ((char *)basic_block_pred, n_basic_blocks * sizeof (int_list_ptr));
basic_block_computed_jump_target = (char *) oballoc (n_basic_blocks);
basic_block_loop_depth = XNMALLOC (short, n_basic_blocks);
uid_block_number = XNMALLOC (int, (max_uid_for_flow + 1));
uid_volatile = XNMALLOC (char, (max_uid_for_flow + 1));
- bzero (uid_volatile, max_uid_for_flow + 1);
+ zero_memory (uid_volatile, max_uid_for_flow + 1);
find_basic_blocks_1 (f, nonlocal_label_list);
}
@@ -458,11 +458,11 @@ find_basic_blocks_1 (f, nonlocal_labels)
label_value_list = 0;
block_live_static = block_live;
- bzero (block_live, n_basic_blocks);
- bzero (block_marked, n_basic_blocks);
- bzero (basic_block_computed_jump_target, n_basic_blocks);
- bzero ((char *) active_eh_region, (max_uid_for_flow + 1) * sizeof (int));
- bzero ((char *) nested_eh_region, (max_label_num () + 1) * sizeof (int));
+ zero_memory (block_live, n_basic_blocks);
+ zero_memory (block_marked, n_basic_blocks);
+ zero_memory (basic_block_computed_jump_target, n_basic_blocks);
+ zero_memory ((char *) active_eh_region, (max_uid_for_flow + 1) * sizeof (int));
+ zero_memory ((char *) nested_eh_region, (max_label_num () + 1) * sizeof (int));
current_function_has_computed_jump = 0;
/* Initialize with just block 0 reachable and no blocks marked. */
@@ -1415,9 +1415,9 @@ life_analysis_1 (f, nregs)
Reload will make some registers as live even though they do not appear
in the rtl. */
if (reload_completed)
- bcopy (regs_ever_live, save_regs_ever_live, (sizeof (regs_ever_live)));
+ copy_memory (regs_ever_live, save_regs_ever_live, (sizeof (regs_ever_live)));
- bzero (regs_ever_live, sizeof regs_ever_live);
+ zero_memory (regs_ever_live, sizeof regs_ever_live);
/* Allocate and zero out many data structures
that will record the data from lifetime analysis. */
@@ -1425,7 +1425,7 @@ life_analysis_1 (f, nregs)
allocate_for_life_analysis ();
reg_next_use = (rtx *) alloca (nregs * sizeof (rtx));
- bzero ((char *) reg_next_use, nregs * sizeof (rtx));
+ zero_memory ((char *) reg_next_use, nregs * sizeof (rtx));
/* Set up several regset-vectors used internally within this function.
Their meanings are documented above, with their declarations. */
@@ -1634,7 +1634,7 @@ life_analysis_1 (f, nregs)
/* Restore regs_ever_live that was provided by reload. */
if (reload_completed)
- bcopy (save_regs_ever_live, regs_ever_live, (sizeof (regs_ever_live)));
+ copy_memory (save_regs_ever_live, regs_ever_live, (sizeof (regs_ever_live)));
free_regset_vector (basic_block_live_at_end, n_basic_blocks);
free_regset_vector (basic_block_new_live_at_end, n_basic_blocks);
@@ -3570,10 +3570,10 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs, split_edges)
int bb;
int changed = 0;
- bzero ((char *) s_preds, n_basic_blocks * sizeof (int_list_ptr));
- bzero ((char *) s_succs, n_basic_blocks * sizeof (int_list_ptr));
- bzero ((char *) num_preds, n_basic_blocks * sizeof (int));
- bzero ((char *) num_succs, n_basic_blocks * sizeof (int));
+ zero_memory ((char *) s_preds, n_basic_blocks * sizeof (int_list_ptr));
+ zero_memory ((char *) s_succs, n_basic_blocks * sizeof (int_list_ptr));
+ zero_memory ((char *) num_preds, n_basic_blocks * sizeof (int));
+ zero_memory ((char *) num_succs, n_basic_blocks * sizeof (int));
/* It's somewhat stupid to simply copy the information. The passes
which use this function ought to be changed to refer directly to
@@ -3611,7 +3611,7 @@ compute_preds_succs (s_preds, s_succs, num_preds, num_succs, split_edges)
to any given block from being split. */
char *split_edge_to_block = (char *) alloca (n_basic_blocks);
- bzero (split_edge_to_block, n_basic_blocks);
+ zero_memory (split_edge_to_block, n_basic_blocks);
for (bb = 0; bb < n_basic_blocks; bb++)
{
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 378bbfe..45ac066 100755
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -305,7 +305,7 @@ mul_double (l1, h1, l2, h2, lv, hv)
encode (arg1, l1, h1);
encode (arg2, l2, h2);
- bzero ((char *) prod, sizeof prod);
+ zero_memory ((char *) prod, sizeof prod);
for (i = 0; i < 4; i++)
{
@@ -528,10 +528,10 @@ div_and_round_double (code, uns,
goto finish_up;
}
- bzero ((char *) quo, sizeof quo);
+ zero_memory ((char *) quo, sizeof quo);
- bzero ((char *) num, sizeof num); /* to zero 9th element */
- bzero ((char *) den, sizeof den);
+ zero_memory ((char *) num, sizeof num); /* to zero 9th element */
+ zero_memory ((char *) den, sizeof den);
encode (num, lnum, hnum);
encode (den, lden, hden);
@@ -4317,7 +4317,7 @@ reduce_expression_tree_depth (code, type, arg0, arg1)
int n_ops;
int i, j, changed;
- bzero ((char *)ops, sizeof ops);
+ zero_memory ((char *)ops, sizeof ops);
/* Place our operands into the expression array. */
ops[0] = arg0;
diff --git a/gcc/function.c b/gcc/function.c
index d55149d..0b9701b 100755
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3980,7 +3980,7 @@ assign_parms (fndecl, second_time)
max_parm_reg = LAST_VIRTUAL_REGISTER + 1;
parm_reg_stack_loc = (rtx *) savealloc (max_parm_reg * sizeof (rtx));
- bzero ((char *) parm_reg_stack_loc, max_parm_reg * sizeof (rtx));
+ zero_memory ((char *) parm_reg_stack_loc, max_parm_reg * sizeof (rtx));
#ifdef INIT_CUMULATIVE_INCOMING_ARGS
INIT_CUMULATIVE_INCOMING_ARGS (args_so_far, fntype, NULL_RTX);
@@ -4558,9 +4558,9 @@ assign_parms (fndecl, second_time)
precisely correct. */
max_parm_reg = regno + 1;
new = (rtx *) savealloc (max_parm_reg * sizeof (rtx));
- bcopy ((char *) parm_reg_stack_loc, (char *) new,
+ copy_memory ((char *) parm_reg_stack_loc, (char *) new,
old_max_parm_reg * sizeof (rtx));
- bzero ((char *) (new + old_max_parm_reg),
+ zero_memory ((char *) (new + old_max_parm_reg),
(max_parm_reg - old_max_parm_reg) * sizeof (rtx));
parm_reg_stack_loc = new;
}
diff --git a/gcc/function_990206.c b/gcc/function_990206.c
index bee8f12..064ea3d 100755
--- a/gcc/function_990206.c
+++ b/gcc/function_990206.c
@@ -3980,7 +3980,7 @@ assign_parms (fndecl, second_time)
max_parm_reg = LAST_VIRTUAL_REGISTER + 1;
parm_reg_stack_loc = (rtx *) savealloc (max_parm_reg * sizeof (rtx));
- bzero ((char *) parm_reg_stack_loc, max_parm_reg * sizeof (rtx));
+ zero_memory ((char *) parm_reg_stack_loc, max_parm_reg * sizeof (rtx));
#ifdef INIT_CUMULATIVE_INCOMING_ARGS
INIT_CUMULATIVE_INCOMING_ARGS (args_so_far, fntype, NULL_RTX);
@@ -4558,9 +4558,9 @@ assign_parms (fndecl, second_time)
precisely correct. */
max_parm_reg = regno + 1;
new = (rtx *) savealloc (max_parm_reg * sizeof (rtx));
- bcopy ((char *) parm_reg_stack_loc, (char *) new,
+ copy_memory ((char *) parm_reg_stack_loc, (char *) new,
old_max_parm_reg * sizeof (rtx));
- bzero ((char *) (new + old_max_parm_reg),
+ zero_memory ((char *) (new + old_max_parm_reg),
(max_parm_reg - old_max_parm_reg) * sizeof (rtx));
parm_reg_stack_loc = new;
}
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 4d62dab..c956c2d 100755
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1058,7 +1058,7 @@ translate_options (argcp, argvp)
/* If this mapping requires extra text at end of name,
accept that as "argument". */
- else if (index (arginfo, '*') != 0)
+ else if (strchr (arginfo, '*') != 0)
arg = argv[i] + optlen;
/* Otherwise, extra text at end means mismatch.
@@ -1067,14 +1067,14 @@ translate_options (argcp, argvp)
continue;
}
- else if (index (arginfo, '*') != 0)
+ else if (strchr (arginfo, '*') != 0)
{
error ("Incomplete `%s' option", option_map[j].name);
break;
}
/* Handle arguments. */
- if (index (arginfo, 'a') != 0)
+ if (strchr (arginfo, 'a') != 0)
{
if (arg == 0)
{
@@ -1088,9 +1088,9 @@ translate_options (argcp, argvp)
arg = argv[++i];
}
}
- else if (index (arginfo, '*') != 0)
+ else if (strchr (arginfo, '*') != 0)
;
- else if (index (arginfo, 'o') == 0)
+ else if (strchr (arginfo, 'o') == 0)
{
if (arg != 0)
error ("Extraneous argument to `%s' option",
@@ -1099,7 +1099,7 @@ translate_options (argcp, argvp)
}
/* Store the translation as one argv elt or as two. */
- if (arg != 0 && index (arginfo, 'j') != 0)
+ if (arg != 0 && strchr (arginfo, 'j') != 0)
newv[newindex++] = concat (option_map[j].equivalent, arg,
NULL_PTR);
else if (arg != 0)
@@ -1286,7 +1286,7 @@ init_spec ()
extra_specs = (struct spec_list *)
xmalloc (sizeof(struct spec_list) *
(sizeof(extra_specs_1)/sizeof(extra_specs_1[0])));
- bzero ((PTR) extra_specs, sizeof(struct spec_list) *
+ zero_memory ((PTR) extra_specs, sizeof(struct spec_list) *
(sizeof(extra_specs_1)/sizeof(extra_specs_1[0])));
for (i = (sizeof(extra_specs_1) / sizeof(extra_specs_1[0])) - 1; i >= 0; i--)
@@ -1786,11 +1786,11 @@ read_specs (filename, main_p)
(n_compilers + 2) * sizeof (struct compiler)));
compilers[n_compilers].suffix = suffix;
- bzero ((char *) compilers[n_compilers].spec,
+ zero_memory ((char *) compilers[n_compilers].spec,
sizeof compilers[n_compilers].spec);
compilers[n_compilers].spec[0] = spec;
n_compilers++;
- bzero ((char *) &compilers[n_compilers],
+ zero_memory ((char *) &compilers[n_compilers],
sizeof compilers[n_compilers]);
}
@@ -3593,7 +3593,7 @@ process_command (argc, argv)
/* Null-terminate the vector. */
switches[n_switches].args[j] = 0;
}
- else if (index (switches_need_spaces, c))
+ else if (strchr (switches_need_spaces, c))
{
/* On some systems, ld cannot handle some options without
a space. So split the option from its argument. */
@@ -5076,7 +5076,7 @@ main (argc, argv)
first_time = FALSE;
obstack_grow (&collect_obstack, "'-", 2);
q = switches[i].part1;
- while ((p = index (q,'\'')))
+ while ((p = strchr (q,'\'')))
{
obstack_grow (&collect_obstack, q, p-q);
obstack_grow (&collect_obstack, "'\\''", 4);
@@ -5089,7 +5089,7 @@ main (argc, argv)
{
obstack_grow (&collect_obstack, " '", 2);
q = *args;
- while ((p = index (q,'\'')))
+ while ((p = strchr (q,'\'')))
{
obstack_grow (&collect_obstack, q, p-q);
obstack_grow (&collect_obstack, "'\\''", 4);
@@ -5107,7 +5107,7 @@ main (argc, argv)
This means one element containing 0s, as a terminator. */
compilers = (struct compiler *) xmalloc (sizeof default_compilers);
- bcopy ((char *) default_compilers, (char *) compilers,
+ copy_memory ((char *) default_compilers, (char *) compilers,
sizeof default_compilers);
n_compilers = n_default_compilers;
@@ -5339,12 +5339,12 @@ main (argc, argv)
i += lang_specific_extra_outfiles;
#endif
outfiles = (char **) xmalloc (i * sizeof (char *));
- bzero ((char *) outfiles, i * sizeof (char *));
+ zero_memory ((char *) outfiles, i * sizeof (char *));
/* Record which files were specified explicitly as link input. */
explicit_link_files = xmalloc (n_infiles);
- bzero (explicit_link_files, n_infiles);
+ zero_memory (explicit_link_files, n_infiles);
for (i = 0; (int)i < n_infiles; i++)
{
@@ -5540,7 +5540,7 @@ lookup_compiler (name, length, language)
language = cp->spec[0] + 1;
new = (struct compiler *) xmalloc (sizeof (struct compiler));
new->suffix = cp->suffix;
- bcopy ((char *) lookup_compiler (NULL_PTR, 0, language)->spec,
+ copy_memory ((char *) lookup_compiler (NULL_PTR, 0, language)->spec,
(char *) new->spec, sizeof new->spec);
return new;
}
@@ -5585,7 +5585,7 @@ save_string (s, len)
{
register char *result = xmalloc (len + 1);
- bcopy (s, result, len);
+ copy_memory (s, result, len);
result[len] = 0;
return result;
}
diff --git a/gcc/gcse.c b/gcc/gcse.c
index a91068a..e8864ef 100755
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -829,7 +829,7 @@ compute_can_copy ()
rtx reg,insn;
char *free_point = (char *) oballoc (1);
- bzero (can_copy_p, NUM_MACHINE_MODES);
+ zero_memory (can_copy_p, NUM_MACHINE_MODES);
start_sequence ();
for (i = 0; i < NUM_MACHINE_MODES; i++)
@@ -909,7 +909,7 @@ alloc_gcse_mem (f)
max_uid = get_max_uid ();
n = (max_uid + 1) * sizeof (int);
uid_cuid = (int *) gmalloc (n);
- bzero ((char *) uid_cuid, n);
+ zero_memory ((char *) uid_cuid, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
@@ -923,7 +923,7 @@ alloc_gcse_mem (f)
max_cuid = i;
n = (max_cuid + 1) * sizeof (rtx);
cuid_insn = (rtx *) gmalloc (n);
- bzero ((char *) cuid_insn, n);
+ zero_memory ((char *) cuid_insn, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
@@ -1085,7 +1085,7 @@ alloc_reg_set_mem (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);
- bzero ((char *) reg_set_table, n);
+ zero_memory ((char *) reg_set_table, n);
gcc_obstack_init (&reg_set_obstack);
}
@@ -1114,7 +1114,7 @@ record_one_set (regno, insn)
reg_set_table = (struct reg_set **)
grealloc ((char *) reg_set_table,
new_size * sizeof (struct reg_set *));
- bzero ((char *) (reg_set_table + reg_set_table_size),
+ zero_memory ((char *) (reg_set_table + reg_set_table_size),
(new_size - reg_set_table_size) * sizeof (struct reg_set *));
reg_set_table_size = new_size;
}
@@ -2078,7 +2078,7 @@ dump_hash_table (file, name, table, table_size, total_size)
struct expr **flat_table = (struct expr **) alloca (total_size * sizeof (struct expr *));
unsigned int *hash_val = (unsigned int *) alloca (total_size * sizeof (unsigned int));
- bzero ((char *) flat_table, total_size * sizeof (struct expr *));
+ zero_memory ((char *) flat_table, total_size * sizeof (struct expr *));
for (i = 0; i < table_size; i++)
{
struct expr *expr;
@@ -2188,7 +2188,7 @@ compute_hash_table (set_p)
??? This isn't needed during const/copy propagation, but it's cheap to
compute. Later. */
sbitmap_vector_zero (reg_set_in_block, n_basic_blocks);
- bzero ((rtx *) modify_mem_list, n_basic_blocks * sizeof (rtx *));
+ zero_memory ((rtx *) modify_mem_list, n_basic_blocks * sizeof (rtx *));
/* Some working arrays used to track first and last set in each block. */
/* ??? One could use alloca here, but at some size a threshold is crossed
@@ -2313,7 +2313,7 @@ compute_set_hash_table ()
{
/* Initialize count of number of entries in hash table. */
n_sets = 0;
- bzero ((char *) set_hash_table, set_hash_table_size * sizeof (struct expr *));
+ zero_memory ((char *) set_hash_table, set_hash_table_size * sizeof (struct expr *));
compute_hash_table (1);
}
@@ -2355,7 +2355,7 @@ compute_expr_hash_table ()
{
/* Initialize count of number of entries in hash table. */
n_exprs = 0;
- bzero ((char *) expr_hash_table, expr_hash_table_size * sizeof (struct expr *));
+ zero_memory ((char *) expr_hash_table, expr_hash_table_size * sizeof (struct expr *));
compute_hash_table (0);
}
@@ -2439,7 +2439,7 @@ reset_opr_set_tables ()
/* Also keep a record of the last instruction to modify memory.
For now this is very trivial, we only record whether any memory
location has been modified. */
- bzero ((char *)modify_mem_list, n_basic_blocks * sizeof (rtx *));
+ zero_memory ((char *)modify_mem_list, n_basic_blocks * sizeof (rtx *));
}
/* Return non-zero if the operands of X are not set before INSN in
@@ -3002,7 +3002,7 @@ expr_reaches_here_p (occr, expr, bb, check_self_loop, visited)
if (visited == NULL)
{
visited = (char *) alloca (n_basic_blocks);
- bzero (visited, n_basic_blocks);
+ zero_memory (visited, n_basic_blocks);
}
for (pred = s_preds[bb]; pred != NULL; pred = pred->next)
@@ -4183,7 +4183,7 @@ pre_expr_reaches_here_p (occr_bb, expr, bb, check_pre_comp, visited)
if (visited == NULL)
{
visited = (char *) alloca (n_basic_blocks);
- bzero (visited, n_basic_blocks);
+ zero_memory (visited, n_basic_blocks);
}
for (pred = s_preds[bb]; pred != NULL; pred = pred->next)
@@ -4636,7 +4636,7 @@ pre_gcse ()
hash table entry. */
index_map = (struct expr **) alloca (n_exprs * sizeof (struct expr *));
- bzero ((char *) index_map, n_exprs * sizeof (struct expr *));
+ zero_memory ((char *) index_map, n_exprs * sizeof (struct expr *));
for (i = 0; i < expr_hash_table_size; i++)
{
struct expr *expr;
@@ -4887,7 +4887,7 @@ hoist_expr_reaches_here_p (expr_bb, expr_index, bb, visited)
if (visited == NULL)
{
visited = (char *) alloca (n_basic_blocks);
- bzero (visited, n_basic_blocks);
+ zero_memory (visited, n_basic_blocks);
}
visited[expr_bb] = 1;
@@ -4930,7 +4930,7 @@ hoist_code ()
hash table entry. */
index_map = (struct expr **) alloca (n_exprs * sizeof (struct expr *));
- bzero ((char *) index_map, n_exprs * sizeof (struct expr *));
+ zero_memory ((char *) index_map, n_exprs * sizeof (struct expr *));
for (i = 0; i < expr_hash_table_size; i++)
{
struct expr *expr;
diff --git a/gcc/genattr.c b/gcc/genattr.c
index 1157389..7686492 100755
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -361,7 +361,7 @@ from the machine description file `md'. */\n\n");
unit = (struct function_unit *)
alloca (sizeof (struct function_unit));
unit->name = (char *) alloca (len);
- bcopy (name, unit->name, len);
+ copy_memory (name, unit->name, len);
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
unit->ready_cost.min = unit->ready_cost.max = ready_cost;
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 523d073..a86a739 100755
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -800,7 +800,7 @@ attr_string (str, len)
/* Not found; create a permanent copy and add it to the hash table. */
new_str = (char *) obstack_alloc (hash_obstack, len + 1);
- bcopy (str, new_str, len);
+ copy_memory (str, new_str, len);
new_str[len] = '\0';
attr_hash_add_string (hashcode, new_str);
@@ -1939,7 +1939,7 @@ expand_units ()
* sizeof (struct function_unit_op *));
for (unit = units, i = 0; unit; i += unit->num_opclasses, unit = unit->next)
- bcopy ((char *) unit_ops[unit->num], (char *) &op_array[i],
+ copy_memory ((char *) unit_ops[unit->num], (char *) &op_array[i],
unit->num_opclasses * sizeof (struct function_unit_op *));
/* Compute the ready cost function for each unit by computing the
@@ -2507,7 +2507,7 @@ simplify_cond (exp, insn_code, insn_index)
/* This lets us free all storage allocated below, if appropriate. */
first_spacer = (char *) obstack_finish (rtl_obstack);
- bcopy ((char *) XVEC (exp, 0)->elem, (char *) tests, len * sizeof (rtunion));
+ copy_memory ((char *) XVEC (exp, 0)->elem, (char *) tests, len * sizeof (rtunion));
/* See if default value needs simplification. */
if (GET_CODE (defval) == COND)
@@ -2599,7 +2599,7 @@ simplify_cond (exp, insn_code, insn_index)
rtx newexp = rtx_alloc (COND);
XVEC (newexp, 0) = rtvec_alloc (len);
- bcopy ((char *) tests, (char *) XVEC (newexp, 0)->elem,
+ copy_memory ((char *) tests, (char *) XVEC (newexp, 0)->elem,
len * sizeof (rtunion));
XEXP (newexp, 1) = new_defval;
return newexp;
@@ -3416,7 +3416,7 @@ optimize_attrs ()
insn_code_values
= (struct attr_value_list **) alloca ((insn_code_number + 2)
* sizeof (struct attr_value_list *));
- bzero ((char *) insn_code_values,
+ zero_memory ((char *) insn_code_values,
(insn_code_number + 2) * sizeof (struct attr_value_list *));
/* Offset the table address so we can index by -2 or -1. */
@@ -5811,7 +5811,7 @@ copy_rtx_unchanging (orig)
PUT_MODE (copy, GET_MODE (orig));
RTX_UNCHANGING_P (copy) = 1;
- bcopy ((char *) &XEXP (orig, 0), (char *) &XEXP (copy, 0),
+ copy_memory ((char *) &XEXP (orig, 0), (char *) &XEXP (copy, 0),
GET_RTX_LENGTH (GET_CODE (copy)) * sizeof (rtx));
return copy;
#endif
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c
index 8f811fc..fc94cc7 100755
--- a/gcc/gengenrtl.c
+++ b/gcc/gengenrtl.c
@@ -268,7 +268,7 @@ gencode (f)
fputs ("static rtx obstack_alloc_rtx (length)\n", f);
fputs (" register int length;\n{\n", f);
fputs (" rtx rt = (rtx) obstack_alloc (rtl_obstack, length);\n\n", f);
- fputs (" bzero((char *) rt, sizeof(struct rtx_def) - sizeof(rtunion));\n\n", f);
+ fputs (" zero_memory((char *) rt, sizeof(struct rtx_def) - sizeof(rtunion));\n\n", f);
fputs (" return rt;\n}\n\n", f);
for (fmt = formats; *fmt; ++fmt)
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 5c4f0e0..4b8c9c2 100755
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -225,7 +225,7 @@ make_insn_sequence (insn, type)
int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
- bzero (insn_name_ptr + insn_name_ptr_size,
+ zero_memory (insn_name_ptr + insn_name_ptr_size,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
}
diff --git a/gcc/global.c b/gcc/global.c
index 9255b36..d31f615 100755
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -346,7 +346,7 @@ global_init (FILE *file)
from the list of pairs that may share. */
reg_may_share = (int *) obstack_alloc (&global_obstack, max_regno * sizeof (int));
- bzero ((char *) reg_may_share, max_regno * sizeof (int));
+ zero_memory ((char *) reg_may_share, max_regno * sizeof (int));
for (x = regs_may_share; x; x = XEXP (XEXP (x, 1), 1))
{
int r1 = REGNO (XEXP (x, 0));
@@ -383,10 +383,10 @@ global_init (FILE *file)
allocno_n_refs = (int *) obstack_alloc (&global_obstack, max_allocno * sizeof (int));
allocno_live_length = (int *) obstack_alloc (&global_obstack, max_allocno * sizeof (int));
- bzero ((char *) allocno_size, max_allocno * sizeof (int));
- bzero ((char *) allocno_calls_crossed, max_allocno * sizeof (int));
- bzero ((char *) allocno_n_refs, max_allocno * sizeof (int));
- bzero ((char *) allocno_live_length, max_allocno * sizeof (int));
+ zero_memory ((char *) allocno_size, max_allocno * sizeof (int));
+ zero_memory ((char *) allocno_calls_crossed, max_allocno * sizeof (int));
+ zero_memory ((char *) allocno_n_refs, max_allocno * sizeof (int));
+ zero_memory ((char *) allocno_live_length, max_allocno * sizeof (int));
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_allocno[i] >= 0)
@@ -403,8 +403,8 @@ global_init (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. */
- bzero ((char *) local_reg_live_length, sizeof local_reg_live_length);
- bzero ((char *) local_reg_n_refs, sizeof local_reg_n_refs);
+ zero_memory ((char *) local_reg_live_length, sizeof local_reg_live_length);
+ zero_memory ((char *) local_reg_n_refs, sizeof local_reg_n_refs);
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_renumber[i] >= 0)
{
@@ -460,14 +460,14 @@ global_init (FILE *file)
(allocno_row_words
* sizeof (INT_TYPE)));
- bzero ((char *) hard_reg_conflicts, max_allocno * sizeof (HARD_REG_SET));
- bzero ((char *) hard_reg_preferences, max_allocno * sizeof (HARD_REG_SET));
- bzero ((char *) hard_reg_copy_preferences,
+ zero_memory ((char *) hard_reg_conflicts, max_allocno * sizeof (HARD_REG_SET));
+ zero_memory ((char *) hard_reg_preferences, max_allocno * sizeof (HARD_REG_SET));
+ zero_memory ((char *) hard_reg_copy_preferences,
max_allocno * sizeof (HARD_REG_SET));
- bzero ((char *) hard_reg_full_preferences,
+ zero_memory ((char *) hard_reg_full_preferences,
max_allocno * sizeof (HARD_REG_SET));
- bzero ((char *) regs_someone_prefers, max_allocno * sizeof (HARD_REG_SET));
- bzero ((char *) conflicts,
+ zero_memory ((char *) regs_someone_prefers, max_allocno * sizeof (HARD_REG_SET));
+ zero_memory ((char *) conflicts,
max_allocno * allocno_row_words * sizeof (INT_TYPE));
/* If there is work to be done (at least one reg to allocate),
@@ -651,7 +651,7 @@ global_conflicts ()
for (b = 0; b < n_basic_blocks; b++)
{
- bzero ((char *) allocnos_live, allocno_row_words * sizeof (INT_TYPE));
+ zero_memory ((char *) allocnos_live, allocno_row_words * sizeof (INT_TYPE));
/* Initialize table of registers currently live
to the state at the beginning of this basic block.
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 8186ace..65e6011 100755
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -300,7 +300,7 @@ initialize_for_inline (fndecl, min_labelno, max_labelno, max_reg, copy)
+ current_function_uses_pic_offset_table * FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE);
/* Clear out PARMDECL_MAP. It was allocated in the caller's frame. */
- bzero ((char *) parmdecl_map, max_parm_reg * sizeof (tree));
+ zero_memory ((char *) parmdecl_map, max_parm_reg * sizeof (tree));
arg_vector = rtvec_alloc (list_length (DECL_ARGUMENTS (fndecl)));
for (parms = DECL_ARGUMENTS (fndecl), i = 0;
@@ -589,7 +589,7 @@ save_for_inline_copying (fndecl)
/* Record the mapping of old insns to copied insns. */
insn_map = (rtx *) alloca (max_uid * sizeof (rtx));
- bzero ((char *) insn_map, max_uid * sizeof (rtx));
+ zero_memory ((char *) insn_map, max_uid * sizeof (rtx));
/* Get the insn which signals the end of parameter setup code. */
first_nonparm_insn = get_first_nonparm_insn ();
@@ -607,7 +607,7 @@ save_for_inline_copying (fndecl)
/* Copy the parm_reg_stack_loc array, and substitute for all of the rtx
contained in it. */
new2 = (rtx *) savealloc (max_parm_reg * sizeof (rtx));
- bcopy ((char *) parm_reg_stack_loc, (char *) new2,
+ copy_memory ((char *) parm_reg_stack_loc, (char *) new2,
max_parm_reg * sizeof (rtx));
parm_reg_stack_loc = new2;
for (i = LAST_VIRTUAL_REGISTER + 1; i < max_parm_reg; ++i)
@@ -732,9 +732,9 @@ save_for_inline_copying (fndecl)
/* Make new versions of the register tables. */
new = (char *) savealloc (regno_pointer_flag_length);
- bcopy (regno_pointer_flag, new, regno_pointer_flag_length);
+ copy_memory (regno_pointer_flag, new, regno_pointer_flag_length);
new1 = (char *) savealloc (regno_pointer_flag_length);
- bcopy (regno_pointer_align, new1, regno_pointer_flag_length);
+ copy_memory (regno_pointer_align, new1, regno_pointer_flag_length);
regno_pointer_flag = new;
regno_pointer_align = new1;
@@ -1242,7 +1242,7 @@ copy_for_inline (orig)
/* Replace this rtx with a copy of itself. */
x = rtx_alloc (code);
- bcopy ((char *) orig, (char *) x,
+ copy_memory ((char *) orig, (char *) x,
(sizeof (*x) - sizeof (x->fld)
+ sizeof (x->fld[0]) * GET_RTX_LENGTH (code)));
@@ -1532,7 +1532,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
map->fndecl = fndecl;
map->reg_map = (rtx *) alloca (max_regno * sizeof (rtx));
- bzero ((char *) map->reg_map, max_regno * sizeof (rtx));
+ zero_memory ((char *) map->reg_map, 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
@@ -1542,7 +1542,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
map->label_map = real_label_map;
map->insn_map = (rtx *) alloca (INSN_UID (header) * sizeof (rtx));
- bzero ((char *) map->insn_map, INSN_UID (header) * sizeof (rtx));
+ zero_memory ((char *) map->insn_map, INSN_UID (header) * sizeof (rtx));
map->min_insnno = 0;
map->max_insnno = INSN_UID (header);
@@ -1565,12 +1565,12 @@ expand_inline_function (fndecl, parms, target, ignore, type,
map->const_equiv_map
= (rtx *)alloca (map->const_equiv_map_size * sizeof (rtx));
- bzero ((char *) map->const_equiv_map,
+ zero_memory ((char *) map->const_equiv_map,
map->const_equiv_map_size * sizeof (rtx));
map->const_age_map
= (unsigned *)alloca (map->const_equiv_map_size * sizeof (unsigned));
- bzero ((char *) map->const_age_map,
+ zero_memory ((char *) map->const_age_map,
map->const_equiv_map_size * sizeof (unsigned));
map->const_age = 0;
@@ -1834,7 +1834,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* Initialize label_map. get_label_from_map will actually make
the labels. */
- bzero ((char *) &map->label_map [min_labelno],
+ zero_memory ((char *) &map->label_map [min_labelno],
(max_labelno - min_labelno) * sizeof (rtx));
/* Perform postincrements before actually calling the function. */
diff --git a/gcc/jump.c b/gcc/jump.c
index 2e6b289..a3de04e 100755
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -208,7 +208,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
we make. */
max_jump_chain = max_uid * 14 / 10;
jump_chain = (rtx *) alloca (max_jump_chain * sizeof (rtx));
- bzero ((char *) jump_chain, max_jump_chain * sizeof (rtx));
+ zero_memory ((char *) jump_chain, max_jump_chain * sizeof (rtx));
mark_all_labels (f, cross_jump);
@@ -2666,7 +2666,7 @@ duplicate_loop_exit_test (loop_start)
if (reg_map == 0)
{
reg_map = (rtx *) alloca (max_reg * sizeof (rtx));
- bzero ((char *) reg_map, max_reg * sizeof (rtx));
+ zero_memory ((char *) reg_map, max_reg * sizeof (rtx));
}
REG_LOOP_TEST_P (reg) = 1;
@@ -4726,10 +4726,10 @@ thread_jumps (f, max_reg, flag_before_loop)
|| JUMP_LABEL (b1) == 0)
continue;
- bzero (modified_regs, max_reg * sizeof (char));
+ zero_memory (modified_regs, max_reg * sizeof (char));
modified_mem = 0;
- bcopy ((char *) all_reset, (char *) same_regs,
+ copy_memory ((char *) all_reset, (char *) same_regs,
max_reg * sizeof (int));
num_same_regs = 0;
@@ -5240,7 +5240,7 @@ conditional_execution (insn)
rtx seq;
fix_insns = (cexec *) alloca (sizeof (cexec) * max);
- bzero ((char *)fix_insns, sizeof (cexec) * max);
+ zero_memory ((char *)fix_insns, sizeof (cexec) * max);
true_false = (XEXP (SET_SRC (PATTERN (insn)), 1) != pc_rtx);
for (p = next_nonnote_insn (insn); ; p = next_nonnote_insn (p))
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index d063aac..101f16d 100755
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -375,7 +375,7 @@ local_alloc ()
vectors might need to be initialized because they were used
for the previous block; it is set to the entire array before
block 0. Initialize those, with explicit loop if there are few,
- else with bzero and bcopy. Do not initialize vectors that are
+ else with zero_memory and bcopy. Do not initialize vectors that are
explicit set by `alloc_qty'. */
if (next_qty < 6)
@@ -391,7 +391,7 @@ local_alloc ()
else
{
#define CLEAR(vector) \
- bzero ((char *) (vector), (sizeof (*(vector))) * next_qty);
+ zero_memory ((char *) (vector), (sizeof (*(vector))) * next_qty);
CLEAR (qty_phys_copy_sugg);
CLEAR (qty_phys_num_copy_sugg);
@@ -667,9 +667,9 @@ update_equiv_regs ()
reg_equiv_init_insns = (rtx *) alloca (max_regno * sizeof (rtx));
reg_equiv_replacement = (rtx *) alloca (max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_init_insns, max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_replacement, max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_replace, max_regno * sizeof *reg_equiv_replace);
+ zero_memory ((char *) reg_equiv_init_insns, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_equiv_replacement, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_equiv_replace, max_regno * sizeof *reg_equiv_replace);
init_alias_analysis ();
@@ -1035,7 +1035,7 @@ block_alloc (b)
the birth of a CLOBBER in the first insn. */
regs_live_at = (HARD_REG_SET *) alloca ((2 * insn_count + 2)
* sizeof (HARD_REG_SET));
- bzero ((char *) regs_live_at, (2 * insn_count + 2) * sizeof (HARD_REG_SET));
+ zero_memory ((char *) regs_live_at, (2 * insn_count + 2) * sizeof (HARD_REG_SET));
/* Initialize table of hardware registers currently live. */
diff --git a/gcc/loop.c b/gcc/loop.c
index 764b236..4f97a96 100755
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -471,7 +471,7 @@ loop_optimize (f, dumpfile, unroll_p, bct_p)
max_reg_before_loop = max_reg_num ();
moved_once = (char *) alloca (max_reg_before_loop);
- bzero (moved_once, max_reg_before_loop);
+ zero_memory (moved_once, max_reg_before_loop);
regs_may_share = 0;
@@ -496,8 +496,8 @@ loop_optimize (f, dumpfile, unroll_p, bct_p)
uid_luid = (int *) alloca (max_uid_for_loop * sizeof (int));
uid_loop_num = (int *) alloca (max_uid_for_loop * sizeof (int));
- bzero ((char *) uid_luid, max_uid_for_loop * sizeof (int));
- bzero ((char *) uid_loop_num, max_uid_for_loop * sizeof (int));
+ zero_memory ((char *) uid_luid, max_uid_for_loop * sizeof (int));
+ zero_memory ((char *) uid_loop_num, max_uid_for_loop * sizeof (int));
/* Allocate tables for recording each loop. We set each entry, so they need
not be zeroed. */
@@ -513,7 +513,7 @@ loop_optimize (f, dumpfile, unroll_p, bct_p)
#ifdef HAVE_decrement_and_branch_on_count
/* Allocate for BCT optimization */
loop_used_count_register = (int *) alloca (max_loop_num * sizeof (int));
- bzero ((char *) loop_used_count_register, max_loop_num * sizeof (int));
+ zero_memory ((char *) loop_used_count_register, max_loop_num * sizeof (int));
#endif /* HAVE_decrement_and_branch_on_count */
/* Find and process each loop.
@@ -776,7 +776,7 @@ scan_loop (loop_start, end, loop_cont, unroll_p, bct_p)
VARRAY_CHAR (may_not_optimize, i) = 1;
#endif
- bcopy ((char *) &set_in_loop->data,
+ copy_memory ((char *) &set_in_loop->data,
(char *) &n_times_set->data, nregs * sizeof (int));
if (loop_dump_stream)
@@ -1458,7 +1458,7 @@ combine_movables (movables, nregs)
register struct movable *m1;
int regno = m->regno;
- bzero (matched_regs, nregs);
+ zero_memory (matched_regs, nregs);
matched_regs[regno] = 1;
/* We want later insns to match the first one. Don't make the first
@@ -1752,8 +1752,8 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
rtx *reg_map = (rtx *) alloca (nregs * sizeof (rtx));
char *already_moved = (char *) alloca (nregs);
- bzero (already_moved, nregs);
- bzero ((char *) reg_map, nregs * sizeof (rtx));
+ zero_memory (already_moved, nregs);
+ zero_memory ((char *) reg_map, nregs * sizeof (rtx));
num_movables = 0;
@@ -3506,7 +3506,7 @@ count_loop_regs_set (from, to, may_not_move, single_usage, count_ptr, nregs)
register rtx insn;
register int count = 0;
- bzero ((char *) last_set, nregs * sizeof (rtx));
+ zero_memory ((char *) last_set, nregs * sizeof (rtx));
for (insn = from; insn != to; insn = NEXT_INSN (insn))
{
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
@@ -3536,7 +3536,7 @@ count_loop_regs_set (from, to, may_not_move, single_usage, count_ptr, nregs)
}
if (GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == JUMP_INSN)
- bzero ((char *) last_set, nregs * sizeof (rtx));
+ zero_memory ((char *) last_set, nregs * sizeof (rtx));
}
*count_ptr = count;
}
@@ -3710,7 +3710,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
VARRAY_GENERIC_PTR_INIT (reg_iv_info, max_reg_before_loop, "reg_iv_info");
reg_biv_class = (struct iv_class **)
alloca (max_reg_before_loop * sizeof (struct iv_class *));
- bzero ((char *) reg_biv_class, (max_reg_before_loop
+ zero_memory ((char *) reg_biv_class, (max_reg_before_loop
* sizeof (struct iv_class *)));
loop_iv_list = 0;
@@ -4463,7 +4463,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
reg_iv_type for a suitable size. */
reg_map_size = reg_iv_type->num_elements;
reg_map = (rtx *) alloca (reg_map_size * sizeof (rtx));
- bzero ((char *) reg_map, reg_map_size * sizeof (rtx));
+ zero_memory ((char *) reg_map, reg_map_size * sizeof (rtx));
/* Examine each iv class for feasibility of strength reduction/induction
variable elimination. */
@@ -6845,10 +6845,10 @@ combine_givs (bl)
giv_array[i++] = g1;
stats = (struct combine_givs_stats *) alloca (giv_count * sizeof (*stats));
- bzero ((char *) stats, giv_count * sizeof (*stats));
+ zero_memory ((char *) stats, giv_count * sizeof (*stats));
can_combine = (rtx *) alloca (giv_count * giv_count * sizeof(rtx));
- bzero ((char *) can_combine, giv_count * giv_count * sizeof(rtx));
+ zero_memory ((char *) can_combine, giv_count * giv_count * sizeof(rtx));
for (i = 0; i < giv_count; i++)
{
@@ -9259,10 +9259,10 @@ load_mems_and_recount_loop_regs_set (scan_start, end, loop_top, start,
VARRAY_GROW (reg_single_usage, nregs);
}
/* Clear the arrays */
- bzero ((char *) &set_in_loop->data, nregs * sizeof (int));
- bzero ((char *) &may_not_optimize->data, nregs * sizeof (char));
+ zero_memory ((char *) &set_in_loop->data, nregs * sizeof (int));
+ zero_memory ((char *) &may_not_optimize->data, nregs * sizeof (char));
if (reg_single_usage)
- bzero ((char *) &reg_single_usage->data, nregs * sizeof (rtx));
+ zero_memory ((char *) &reg_single_usage->data, nregs * sizeof (rtx));
count_loop_regs_set (loop_top ? loop_top : start, end,
may_not_optimize, reg_single_usage,
@@ -9283,7 +9283,7 @@ load_mems_and_recount_loop_regs_set (scan_start, end, loop_top, start,
#endif
/* Set n_times_set for the new registers. */
- bcopy ((char *) (&set_in_loop->data.i[0] + old_nregs),
+ copy_memory ((char *) (&set_in_loop->data.i[0] + old_nregs),
(char *) (&n_times_set->data.i[0] + old_nregs),
(nregs - old_nregs) * sizeof (int));
}
diff --git a/gcc/loop_990401.c b/gcc/loop_990401.c
index 9c46c5c..c671727 100755
--- a/gcc/loop_990401.c
+++ b/gcc/loop_990401.c
@@ -471,7 +471,7 @@ loop_optimize (f, dumpfile, unroll_p, bct_p)
max_reg_before_loop = max_reg_num ();
moved_once = (char *) alloca (max_reg_before_loop);
- bzero (moved_once, max_reg_before_loop);
+ zero_memory (moved_once, max_reg_before_loop);
regs_may_share = 0;
@@ -496,8 +496,8 @@ loop_optimize (f, dumpfile, unroll_p, bct_p)
uid_luid = (int *) alloca (max_uid_for_loop * sizeof (int));
uid_loop_num = (int *) alloca (max_uid_for_loop * sizeof (int));
- bzero ((char *) uid_luid, max_uid_for_loop * sizeof (int));
- bzero ((char *) uid_loop_num, max_uid_for_loop * sizeof (int));
+ zero_memory ((char *) uid_luid, max_uid_for_loop * sizeof (int));
+ zero_memory ((char *) uid_loop_num, max_uid_for_loop * sizeof (int));
/* Allocate tables for recording each loop. We set each entry, so they need
not be zeroed. */
@@ -513,7 +513,7 @@ loop_optimize (f, dumpfile, unroll_p, bct_p)
#ifdef HAVE_decrement_and_branch_on_count
/* Allocate for BCT optimization */
loop_used_count_register = (int *) alloca (max_loop_num * sizeof (int));
- bzero ((char *) loop_used_count_register, max_loop_num * sizeof (int));
+ zero_memory ((char *) loop_used_count_register, max_loop_num * sizeof (int));
#endif /* HAVE_decrement_and_branch_on_count */
/* Find and process each loop.
@@ -776,7 +776,7 @@ scan_loop (loop_start, end, loop_cont, unroll_p, bct_p)
VARRAY_CHAR (may_not_optimize, i) = 1;
#endif
- bcopy ((char *) &set_in_loop->data,
+ copy_memory ((char *) &set_in_loop->data,
(char *) &n_times_set->data, nregs * sizeof (int));
if (loop_dump_stream)
@@ -1458,7 +1458,7 @@ combine_movables (movables, nregs)
register struct movable *m1;
int regno = m->regno;
- bzero (matched_regs, nregs);
+ zero_memory (matched_regs, nregs);
matched_regs[regno] = 1;
/* We want later insns to match the first one. Don't make the first
@@ -1752,8 +1752,8 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
rtx *reg_map = (rtx *) alloca (nregs * sizeof (rtx));
char *already_moved = (char *) alloca (nregs);
- bzero (already_moved, nregs);
- bzero ((char *) reg_map, nregs * sizeof (rtx));
+ zero_memory (already_moved, nregs);
+ zero_memory ((char *) reg_map, nregs * sizeof (rtx));
num_movables = 0;
@@ -3506,7 +3506,7 @@ count_loop_regs_set (from, to, may_not_move, single_usage, count_ptr, nregs)
register rtx insn;
register int count = 0;
- bzero ((char *) last_set, nregs * sizeof (rtx));
+ zero_memory ((char *) last_set, nregs * sizeof (rtx));
for (insn = from; insn != to; insn = NEXT_INSN (insn))
{
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
@@ -3536,7 +3536,7 @@ count_loop_regs_set (from, to, may_not_move, single_usage, count_ptr, nregs)
}
if (GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == JUMP_INSN)
- bzero ((char *) last_set, nregs * sizeof (rtx));
+ zero_memory ((char *) last_set, nregs * sizeof (rtx));
}
*count_ptr = count;
}
@@ -3710,7 +3710,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
VARRAY_GENERIC_PTR_INIT (reg_iv_info, max_reg_before_loop, "reg_iv_info");
reg_biv_class = (struct iv_class **)
alloca (max_reg_before_loop * sizeof (struct iv_class *));
- bzero ((char *) reg_biv_class, (max_reg_before_loop
+ zero_memory ((char *) reg_biv_class, (max_reg_before_loop
* sizeof (struct iv_class *)));
loop_iv_list = 0;
@@ -4463,7 +4463,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
reg_iv_type for a suitable size. */
reg_map_size = reg_iv_type->num_elements;
reg_map = (rtx *) alloca (reg_map_size * sizeof (rtx));
- bzero ((char *) reg_map, reg_map_size * sizeof (rtx));
+ zero_memory ((char *) reg_map, reg_map_size * sizeof (rtx));
/* Examine each iv class for feasibility of strength reduction/induction
variable elimination. */
@@ -6845,10 +6845,10 @@ combine_givs (bl)
giv_array[i++] = g1;
stats = (struct combine_givs_stats *) alloca (giv_count * sizeof (*stats));
- bzero ((char *) stats, giv_count * sizeof (*stats));
+ zero_memory ((char *) stats, giv_count * sizeof (*stats));
can_combine = (rtx *) alloca (giv_count * giv_count * sizeof(rtx));
- bzero ((char *) can_combine, giv_count * giv_count * sizeof(rtx));
+ zero_memory ((char *) can_combine, giv_count * giv_count * sizeof(rtx));
for (i = 0; i < giv_count; i++)
{
@@ -9258,10 +9258,10 @@ load_mems_and_recount_loop_regs_set (scan_start, end, loop_top, start,
VARRAY_GROW (reg_single_usage, nregs);
}
/* Clear the arrays */
- bzero ((char *) &set_in_loop->data, nregs * sizeof (int));
- bzero ((char *) &may_not_optimize->data, nregs * sizeof (char));
+ zero_memory ((char *) &set_in_loop->data, nregs * sizeof (int));
+ zero_memory ((char *) &may_not_optimize->data, nregs * sizeof (char));
if (reg_single_usage)
- bzero ((char *) &reg_single_usage->data, nregs * sizeof (rtx));
+ zero_memory ((char *) &reg_single_usage->data, nregs * sizeof (rtx));
count_loop_regs_set (loop_top ? loop_top : start, end,
may_not_optimize, reg_single_usage,
@@ -9282,7 +9282,7 @@ load_mems_and_recount_loop_regs_set (scan_start, end, loop_top, start,
#endif
/* Set n_times_set for the new registers. */
- bcopy ((char *) (&set_in_loop->data.i[0] + old_nregs),
+ copy_memory ((char *) (&set_in_loop->data.i[0] + old_nregs),
(char *) (&n_times_set->data.i[0] + old_nregs),
(nregs - old_nregs) * sizeof (int));
}
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 474a37a..ce96e91 100755
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -116,11 +116,8 @@ rtx truncxfdf2_libfunc;
rtx trunctfdf2_libfunc;
rtx memcpy_libfunc;
-rtx bcopy_libfunc;
rtx memcmp_libfunc;
-rtx bcmp_libfunc;
rtx memset_libfunc;
-rtx bzero_libfunc;
rtx throw_libfunc;
rtx rethrow_libfunc;
@@ -2809,22 +2806,12 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
{
rtx result;
-#ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcmp_libfunc, 0,
TYPE_MODE (integer_type_node), 3,
XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype), size,
TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
-#else
- emit_library_call (bcmp_libfunc, 0,
- TYPE_MODE (integer_type_node), 3,
- XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
- convert_to_mode (TYPE_MODE (integer_type_node),
- size,
- TREE_UNSIGNED (integer_type_node)),
- TYPE_MODE (integer_type_node));
-#endif
/* Immediately move the result of the libcall into a pseudo
register so reload doesn't clobber the value if it needs
@@ -4365,11 +4352,8 @@ init_optabs ()
trunctfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__trunctfdf2");
memcpy_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memcpy");
- bcopy_libfunc = gen_rtx_SYMBOL_REF (Pmode, "bcopy");
memcmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memcmp");
- bcmp_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__gcc_bcmp");
memset_libfunc = gen_rtx_SYMBOL_REF (Pmode, "memset");
- bzero_libfunc = gen_rtx_SYMBOL_REF (Pmode, "bzero");
throw_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__throw");
rethrow_libfunc = gen_rtx_SYMBOL_REF (Pmode, "__rethrow");
diff --git a/gcc/prefix.c b/gcc/prefix.c
index e5ca923..6a98437 100755
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -171,7 +171,7 @@ save_string (s, len)
{
register char *result = xmalloc (len + 1);
- bcopy (s, result, len);
+ copy_memory (s, result, len);
result[len] = 0;
return result;
}
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index bee4663..1f5af9c 100755
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -52,7 +52,7 @@ debug_tree (node)
char *object = (char *) oballoc (0);
table = (struct bucket **) oballoc (HASH_SIZE * sizeof (struct bucket *));
- bzero ((char *) table, HASH_SIZE * sizeof (struct bucket *));
+ zero_memory ((char *) table, HASH_SIZE * sizeof (struct bucket *));
print_node (stderr, "", node, 0);
table = 0;
obfree (object);
diff --git a/gcc/real.c b/gcc/real.c
index 7c67f4e..4ad5cda 100755
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -111,59 +111,11 @@ netlib.att.com: netlib/cephes. */
/* REAL_ARITHMETIC defined means that macros in real.h are
defined to call emulator functions. */
-#ifdef REAL_ARITHMETIC
-
-#if TARGET_FLOAT_FORMAT == VAX_FLOAT_FORMAT
-/* PDP-11, Pro350, VAX: */
-#define DEC 1
-#else /* it's not VAX */
-#if TARGET_FLOAT_FORMAT == IBM_FLOAT_FORMAT
-/* IBM System/370 style */
-#define IBM 1
-#else /* it's also not an IBM */
-#if TARGET_FLOAT_FORMAT == C4X_FLOAT_FORMAT
-/* TMS320C3x/C4x style */
-#define C4X 1
-#else /* it's also not a C4X */
-#if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
-#define IEEE
-#else /* it's not IEEE either */
-/* UNKnown arithmetic. We don't support this and can't go on. */
-unknown arithmetic type
-#define UNK 1
-#endif /* not IEEE */
-#endif /* not C4X */
-#endif /* not IBM */
-#endif /* not VAX */
-
-#define REAL_WORDS_BIG_ENDIAN FLOAT_WORDS_BIG_ENDIAN
-#else
-/* REAL_ARITHMETIC not defined means that the *host's* data
- structure will be used. It may differ by endian-ness from the
- target machine's structure and will get its ends swapped
- accordingly (but not here). Probably only the decimal <-> binary
- functions in this file will actually be used in this case. */
-
-#if HOST_FLOAT_FORMAT == VAX_FLOAT_FORMAT
-#define DEC 1
-#else /* it's not VAX */
-#if HOST_FLOAT_FORMAT == IBM_FLOAT_FORMAT
-/* IBM System/370 style */
-#define IBM 1
-#else /* it's also not an IBM */
-#if HOST_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
#define IEEE
-#else /* it's not IEEE either */
-unknown arithmetic type
-#define UNK 1
-#endif /* not IEEE */
-#endif /* not IBM */
-#endif /* not VAX */
-#define REAL_WORDS_BIG_ENDIAN HOST_FLOAT_WORDS_BIG_ENDIAN
+#define REAL_WORDS_BIG_ENDIAN FLOAT_WORDS_BIG_ENDIAN
-#endif /* REAL_ARITHMETIC not defined */
/* Define INFINITY for support of infinity.
Define NANS for support of Not-a-Number's (NaN's). */
@@ -242,35 +194,9 @@ unknown arithmetic type
A REAL_VALUE_TYPE is guaranteed to occupy contiguous locations
in memory, with no holes. */
-#if LONG_DOUBLE_TYPE_SIZE == 96
-/* Number of 16 bit words in external e type format */
#define NE 6
#define MAXDECEXP 4932
#define MINDECEXP -4956
-#define GET_REAL(r,e) bcopy ((char *) r, (char *) e, 2*NE)
-#define PUT_REAL(e,r) \
-do { \
- if (2*NE < sizeof(*r)) \
- bzero((char *)r, sizeof(*r)); \
- bcopy ((char *) e, (char *) r, 2*NE); \
-} while (0)
-#else /* no XFmode */
-#if LONG_DOUBLE_TYPE_SIZE == 128
-#define NE 10
-#define MAXDECEXP 4932
-#define MINDECEXP -4977
-#define GET_REAL(r,e) bcopy ((char *) r, (char *) e, 2*NE)
-#define PUT_REAL(e,r) \
-do { \
- if (2*NE < sizeof(*r)) \
- bzero((char *)r, sizeof(*r)); \
- bcopy ((char *) e, (char *) r, 2*NE); \
-} while (0)
-#else
-#define NE 6
-#define MAXDECEXP 4932
-#define MINDECEXP -4956
-#ifdef REAL_ARITHMETIC
/* Emulator uses target format internally
but host stores it in host endian-ness. */
@@ -304,15 +230,6 @@ do { \
} \
} while (0)
-#else /* not REAL_ARITHMETIC */
-
-/* emulator uses host format */
-#define GET_REAL(r,e) e53toe ((unsigned EMUSHORT *) (r), (e))
-#define PUT_REAL(e,r) etoe53 ((e), (unsigned EMUSHORT *) (r))
-
-#endif /* not REAL_ARITHMETIC */
-#endif /* not TFmode */
-#endif /* not XFmode */
/* Number of 16 bit words in internal format */
@@ -343,9 +260,6 @@ static void endian PROTO((unsigned EMUSHORT *, long *,
enum machine_mode));
static void eclear PROTO((unsigned EMUSHORT *));
static void emov PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-#if 0
-static void eabs PROTO((unsigned EMUSHORT *));
-#endif
static void eneg PROTO((unsigned EMUSHORT *));
static int eisneg PROTO((unsigned EMUSHORT *));
static int eisinf PROTO((unsigned EMUSHORT *));
@@ -360,9 +274,6 @@ static void emovz PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void einan PROTO((unsigned EMUSHORT *));
static int eiisnan PROTO((unsigned EMUSHORT *));
static int eiisneg PROTO((unsigned EMUSHORT *));
-#if 0
-static void eiinfin PROTO((unsigned EMUSHORT *));
-#endif
static int eiisinf PROTO((unsigned EMUSHORT *));
static int ecmpm PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void eshdn1 PROTO((unsigned EMUSHORT *));
@@ -401,9 +312,6 @@ static void toe53 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void etoe24 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void toe24 PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static int ecmp PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-#if 0
-static void eround PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-#endif
static void ltoe PROTO((HOST_WIDE_INT *, unsigned EMUSHORT *));
static void ultoe PROTO((unsigned HOST_WIDE_INT *, unsigned EMUSHORT *));
static void eifrac PROTO((unsigned EMUSHORT *, HOST_WIDE_INT *,
@@ -412,12 +320,6 @@ static void euifrac PROTO((unsigned EMUSHORT *, unsigned HOST_WIDE_INT *,
unsigned EMUSHORT *));
static int eshift PROTO((unsigned EMUSHORT *, int));
static int enormlz PROTO((unsigned EMUSHORT *));
-#if 0
-static void e24toasc PROTO((unsigned EMUSHORT *, char *, int));
-static void e53toasc PROTO((unsigned EMUSHORT *, char *, int));
-static void e64toasc PROTO((unsigned EMUSHORT *, char *, int));
-static void e113toasc PROTO((unsigned EMUSHORT *, char *, int));
-#endif /* 0 */
static void etoasc PROTO((unsigned EMUSHORT *, char *, int));
static void asctoe24 PROTO((char *, unsigned EMUSHORT *));
static void asctoe53 PROTO((char *, unsigned EMUSHORT *));
@@ -426,15 +328,7 @@ static void asctoe113 PROTO((char *, unsigned EMUSHORT *));
static void asctoe PROTO((char *, unsigned EMUSHORT *));
static void asctoeg PROTO((char *, unsigned EMUSHORT *, int));
static void efloor PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-#if 0
-static void efrexp PROTO((unsigned EMUSHORT *, int *,
- unsigned EMUSHORT *));
-#endif
static void eldexp PROTO((unsigned EMUSHORT *, int, unsigned EMUSHORT *));
-#if 0
-static void eremain PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
- unsigned EMUSHORT *));
-#endif
static void eiremain PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
static void mtherr PROTO((char *, int));
#ifdef DEC
@@ -459,13 +353,6 @@ static void toc4x PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *,
enum machine_mode));
#endif
static void make_nan PROTO((unsigned EMUSHORT *, int, enum machine_mode));
-#if 0
-static void uditoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-static void ditoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-static void etoudi PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-static void etodi PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-static void esqrt PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *));
-#endif
/* Copy 32-bit numbers obtained from array containing 16-bit numbers,
swapping ends if required, into output array of longs. The
@@ -1009,7 +896,6 @@ ereal_ldexp (x, n)
/* These routines are conditionally compiled because functions
of the same names may be defined in fold-const.c. */
-#ifdef REAL_ARITHMETIC
/* Check for infinity in a REAL_VALUE_TYPE. */
@@ -1181,7 +1067,6 @@ exact_real_inverse (mode, r)
PUT_REAL (einv, r);
return 1;
}
-#endif /* REAL_ARITHMETIC defined */
/* Used for debugging--print the value of R in human-readable format
on stderr. */
@@ -1490,56 +1375,6 @@ ereal_isneg (x)
/* e type constants used by high precision check routines */
-#if LONG_DOUBLE_TYPE_SIZE == 128
-/* 0.0 */
-unsigned EMUSHORT ezero[NE] =
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,};
-extern unsigned EMUSHORT ezero[];
-
-/* 5.0E-1 */
-unsigned EMUSHORT ehalf[NE] =
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3ffe,};
-extern unsigned EMUSHORT ehalf[];
-
-/* 1.0E0 */
-unsigned EMUSHORT eone[NE] =
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3fff,};
-extern unsigned EMUSHORT eone[];
-
-/* 2.0E0 */
-unsigned EMUSHORT etwo[NE] =
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x4000,};
-extern unsigned EMUSHORT etwo[];
-
-/* 3.2E1 */
-unsigned EMUSHORT e32[NE] =
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x4004,};
-extern unsigned EMUSHORT e32[];
-
-/* 6.93147180559945309417232121458176568075500134360255E-1 */
-unsigned EMUSHORT elog2[NE] =
- {0x40f3, 0xf6af, 0x03f2, 0xb398,
- 0xc9e3, 0x79ab, 0150717, 0013767, 0130562, 0x3ffe,};
-extern unsigned EMUSHORT elog2[];
-
-/* 1.41421356237309504880168872420969807856967187537695E0 */
-unsigned EMUSHORT esqrt2[NE] =
- {0x1d6f, 0xbe9f, 0x754a, 0x89b3,
- 0x597d, 0x6484, 0174736, 0171463, 0132404, 0x3fff,};
-extern unsigned EMUSHORT esqrt2[];
-
-/* 3.14159265358979323846264338327950288419716939937511E0 */
-unsigned EMUSHORT epi[NE] =
- {0x2902, 0x1cd1, 0x80dc, 0x628b,
- 0xc4c6, 0xc234, 0020550, 0155242, 0144417, 0040000,};
-extern unsigned EMUSHORT epi[];
-
-#else
/* LONG_DOUBLE_TYPE_SIZE is other than 128 */
unsigned EMUSHORT ezero[NE] =
{0, 0000000, 0000000, 0000000, 0000000, 0000000,};
@@ -1557,7 +1392,6 @@ unsigned EMUSHORT esqrt2[NE] =
{0x597e, 0x6484, 0174736, 0171463, 0132404, 0x3fff,};
unsigned EMUSHORT epi[NE] =
{0xc4c6, 0xc234, 0020550, 0155242, 0144417, 0040000,};
-#endif
/* Control register for rounding precision.
This can be set to 113 (if NE=10), 80 (if NE=6), 64, 56, 53, or 24 bits. */
@@ -1590,17 +1424,6 @@ emov (a, b)
}
-#if 0
-/* Absolute value of e-type X. */
-
-static void
-eabs (x)
- unsigned EMUSHORT x[];
-{
- /* sign is top bit of last word of external format */
- x[NE - 1] &= 0x7fff;
-}
-#endif /* 0 */
/* Negate the e-type number X. */
@@ -1893,19 +1716,6 @@ eiisneg (x)
return x[0] != 0;
}
-#if 0
-/* Fill exploded e-type X with infinity pattern.
- This has maximum exponent and significand all zeros. */
-
-static void
-eiinfin (x)
- unsigned EMUSHORT x[];
-{
-
- ecleaz (x);
- x[E] = 0x7fff;
-}
-#endif /* 0 */
/* Return nonzero if exploded e-type X is infinite. */
@@ -2137,156 +1947,6 @@ esubm (x, y)
static unsigned EMUSHORT equot[NI];
-#if 0
-/* Radix 2 shift-and-add versions of multiply and divide */
-
-
-/* Divide significands */
-
-int
-edivm (den, num)
- unsigned EMUSHORT den[], num[];
-{
- int i;
- register unsigned EMUSHORT *p, *q;
- unsigned EMUSHORT j;
-
- p = &equot[0];
- *p++ = num[0];
- *p++ = num[1];
-
- for (i = M; i < NI; i++)
- {
- *p++ = 0;
- }
-
- /* Use faster compare and subtraction if denominator has only 15 bits of
- significance. */
-
- p = &den[M + 2];
- if (*p++ == 0)
- {
- for (i = M + 3; i < NI; i++)
- {
- if (*p++ != 0)
- goto fulldiv;
- }
- if ((den[M + 1] & 1) != 0)
- goto fulldiv;
- eshdn1 (num);
- eshdn1 (den);
-
- p = &den[M + 1];
- q = &num[M + 1];
-
- for (i = 0; i < NBITS + 2; i++)
- {
- if (*p <= *q)
- {
- *q -= *p;
- j = 1;
- }
- else
- {
- j = 0;
- }
- eshup1 (equot);
- equot[NI - 2] |= j;
- eshup1 (num);
- }
- goto divdon;
- }
-
- /* The number of quotient bits to calculate is NBITS + 1 scaling guard
- bit + 1 roundoff bit. */
-
- fulldiv:
-
- p = &equot[NI - 2];
- for (i = 0; i < NBITS + 2; i++)
- {
- if (ecmpm (den, num) <= 0)
- {
- esubm (den, num);
- j = 1; /* quotient bit = 1 */
- }
- else
- j = 0;
- eshup1 (equot);
- *p |= j;
- eshup1 (num);
- }
-
- divdon:
-
- eshdn1 (equot);
- eshdn1 (equot);
-
- /* test for nonzero remainder after roundoff bit */
- p = &num[M];
- j = 0;
- for (i = M; i < NI; i++)
- {
- j |= *p++;
- }
- if (j)
- j = 1;
-
-
- for (i = 0; i < NI; i++)
- num[i] = equot[i];
- return ((int) j);
-}
-
-
-/* Multiply significands */
-
-int
-emulm (a, b)
- unsigned EMUSHORT a[], b[];
-{
- unsigned EMUSHORT *p, *q;
- int i, j, k;
-
- equot[0] = b[0];
- equot[1] = b[1];
- for (i = M; i < NI; i++)
- equot[i] = 0;
-
- p = &a[NI - 2];
- k = NBITS;
- while (*p == 0) /* significand is not supposed to be zero */
- {
- eshdn6 (a);
- k -= 16;
- }
- if ((*p & 0xff) == 0)
- {
- eshdn8 (a);
- k -= 8;
- }
-
- q = &equot[NI - 1];
- j = 0;
- for (i = 0; i < k; i++)
- {
- if (*p & 1)
- eaddm (b, equot);
- /* remember if there were any nonzero bits shifted out */
- if (*q & 1)
- j |= 1;
- eshdn1 (a);
- eshdn1 (equot);
- }
-
- for (i = 0; i < NI; i++)
- b[i] = equot[i];
-
- /* return flag for lost nonzero bits */
- return (j);
-}
-
-#else
/* Radix 65536 versions of multiply and divide. */
@@ -2440,7 +2100,6 @@ emulm (a, b)
/* return flag for lost nonzero bits */
return ((int)j);
}
-#endif
/* Normalize and round off.
@@ -2963,9 +2622,6 @@ ediv (a, b, c)
divsign:
if (sign
-#ifndef IEEE
- && (ecmp (c, ezero) != 0)
-#endif
)
*(c+(NE-1)) |= 0x8000;
else
@@ -3059,9 +2715,6 @@ emul (a, b, c)
mulsign:
if (sign
-#ifndef IEEE
- && (ecmp (c, ezero) != 0)
-#endif
)
*(c+(NE-1)) |= 0x8000;
else
@@ -3147,7 +2800,6 @@ e53toe (pe, y)
r += EXONE - 01777;
yy[E] = r;
p = &yy[M + 1];
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
{
*p++ = *(--e);
@@ -3161,7 +2813,6 @@ e53toe (pe, y)
*p++ = *e++;
*p++ = *e++;
}
-#endif
eshift (yy, -5);
if (denorm)
{
@@ -3203,7 +2854,6 @@ e64toe (pe, y)
for (i = 0; i < 5; i++)
*p-- = *e++;
#endif
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
{
for (i = 0; i < 5; i++)
@@ -3236,7 +2886,6 @@ e64toe (pe, y)
for (i = 0; i < 4; i++)
*p-- = *e++;
}
-#endif
#ifdef INFINITY
/* Point to the exponent field and check max exponent cases. */
p = &yy[NE - 1];
@@ -3313,10 +2962,8 @@ e113toe (pe, y)
e = pe;
denorm = 0;
ecleaz (yy);
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
e += 7;
-#endif
r = *e;
yy[0] = 0;
if (r & 0x8000)
@@ -3358,7 +3005,6 @@ e113toe (pe, y)
#endif /* INFINITY */
yy[E] = r;
p = &yy[M + 1];
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
{
for (i = 0; i < 7; i++)
@@ -3370,7 +3016,6 @@ e113toe (pe, y)
for (i = 0; i < 7; i++)
*p++ = *e++;
}
-#endif
/* If denormal, remove the implied bit; else shift down 1. */
if (r == 0)
{
@@ -3410,10 +3055,8 @@ e24toe (pe, y)
e = pe;
denorm = 0; /* flag if denormalized number */
ecleaz (yy);
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
e += 1;
-#endif
#ifdef DEC
e += 1;
#endif
@@ -3465,7 +3108,6 @@ e24toe (pe, y)
#ifdef DEC
*p++ = *(--e);
#endif
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
*p++ = *(--e);
else
@@ -3473,7 +3115,6 @@ e24toe (pe, y)
++e;
*p++ = *e++;
}
-#endif
eshift (yy, -8);
if (denorm)
{ /* if zero exponent, then normalize the significand */
@@ -3638,18 +3279,12 @@ toe64 (a, b)
#ifdef DEC
q = b + 4;
#endif
-#ifdef IEEE
if (REAL_WORDS_BIG_ENDIAN)
q = b;
else
{
q = b + 4; /* point to output exponent */
-#if LONG_DOUBLE_TYPE_SIZE == 96
- /* Clear the last two bytes of 12-byte Intel format */
- *(q+1) = 0;
-#endif
}
-#endif
/* combine sign and exponent */
i = *p++;
@@ -3666,7 +3301,6 @@ toe64 (a, b)
else
*q-- = *p++;
#endif
-#ifdef IEEE
if (REAL_WORDS_BIG_ENDIAN)
{
#ifdef ARM_EXTENDED_IEEE_FORMAT
@@ -3688,7 +3322,6 @@ toe64 (a, b)
else
*q-- = *p++;
}
-#endif
/* skip over guard word */
++p;
/* move the significand */
@@ -3700,7 +3333,6 @@ toe64 (a, b)
for (i = 0; i < 4; i++)
*q-- = *p++;
#endif
-#ifdef IEEE
if (REAL_WORDS_BIG_ENDIAN)
{
for (i = 0; i < 4; i++)
@@ -3722,7 +3354,6 @@ toe64 (a, b)
for (i = 0; i < 4; i++)
*q-- = *p++;
}
-#endif
}
/* e type to double precision. */
@@ -3842,10 +3473,8 @@ toe53 (x, y)
}
#endif
p = &x[0];
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
y += 3;
-#endif
*y = 0; /* output high order */
if (*p++)
*y = 0x8000; /* output sign bit */
@@ -4016,10 +3645,8 @@ toe24 (x, y)
}
#endif
p = &x[0];
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
y += 1;
-#endif
#ifdef DEC
y += 1;
#endif
@@ -4036,7 +3663,6 @@ toe24 (x, y)
#ifdef DEC
*(--y) = 0;
#endif
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
*(--y) = 0;
else
@@ -4044,13 +3670,11 @@ toe24 (x, y)
++y;
*y = 0;
}
-#endif
#else /* no INFINITY */
*y |= (unsigned EMUSHORT) 0x7f7f;
#ifdef DEC
*(--y) = 0xffff;
#endif
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
*(--y) = 0xffff;
else
@@ -4058,7 +3682,6 @@ toe24 (x, y)
++y;
*y = 0xffff;
}
-#endif
#ifdef ERANGE
errno = ERANGE;
#endif
@@ -4080,7 +3703,6 @@ toe24 (x, y)
#ifdef DEC
*(--y) = *p;
#endif
-#ifdef IEEE
if (! REAL_WORDS_BIG_ENDIAN)
*(--y) = *p;
else
@@ -4088,7 +3710,6 @@ toe24 (x, y)
++y;
*y = *p;
}
-#endif
}
#endif /* not C4X */
#endif /* not IBM */
@@ -4159,17 +3780,6 @@ ecmp (a, b)
return (-msign); /* p is littler */
}
-#if 0
-/* Find e-type nearest integer to X, as floor (X + 0.5). */
-
-static void
-eround (x, y)
- unsigned EMUSHORT *x, *y;
-{
- eadd (ehalf, x, y);
- efloor (y, y);
-}
-#endif /* 0 */
/* Convert HOST_WIDE_INT LP to e type Y. */
@@ -4544,67 +4154,6 @@ enormlz (x)
#define NTEN 12
#define MAXP 4096
-#if LONG_DOUBLE_TYPE_SIZE == 128
-static unsigned EMUSHORT etens[NTEN + 1][NE] =
-{
- {0x6576, 0x4a92, 0x804a, 0x153f,
- 0xc94c, 0x979a, 0x8a20, 0x5202, 0xc460, 0x7525,}, /* 10**4096 */
- {0x6a32, 0xce52, 0x329a, 0x28ce,
- 0xa74d, 0x5de4, 0xc53d, 0x3b5d, 0x9e8b, 0x5a92,}, /* 10**2048 */
- {0x526c, 0x50ce, 0xf18b, 0x3d28,
- 0x650d, 0x0c17, 0x8175, 0x7586, 0xc976, 0x4d48,},
- {0x9c66, 0x58f8, 0xbc50, 0x5c54,
- 0xcc65, 0x91c6, 0xa60e, 0xa0ae, 0xe319, 0x46a3,},
- {0x851e, 0xeab7, 0x98fe, 0x901b,
- 0xddbb, 0xde8d, 0x9df9, 0xebfb, 0xaa7e, 0x4351,},
- {0x0235, 0x0137, 0x36b1, 0x336c,
- 0xc66f, 0x8cdf, 0x80e9, 0x47c9, 0x93ba, 0x41a8,},
- {0x50f8, 0x25fb, 0xc76b, 0x6b71,
- 0x3cbf, 0xa6d5, 0xffcf, 0x1f49, 0xc278, 0x40d3,},
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0xf020, 0xb59d, 0x2b70, 0xada8, 0x9dc5, 0x4069,},
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0400, 0xc9bf, 0x8e1b, 0x4034,},
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x2000, 0xbebc, 0x4019,},
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x9c40, 0x400c,},
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0xc800, 0x4005,},
- {0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0xa000, 0x4002,}, /* 10**1 */
-};
-
-static unsigned EMUSHORT emtens[NTEN + 1][NE] =
-{
- {0x2030, 0xcffc, 0xa1c3, 0x8123,
- 0x2de3, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */
- {0x8264, 0xd2cb, 0xf2ea, 0x12d4,
- 0x4925, 0x2de4, 0x3436, 0x534f, 0xceae, 0x256b,}, /* 10**-2048 */
- {0xf53f, 0xf698, 0x6bd3, 0x0158,
- 0x87a6, 0xc0bd, 0xda57, 0x82a5, 0xa2a6, 0x32b5,},
- {0xe731, 0x04d4, 0xe3f2, 0xd332,
- 0x7132, 0xd21c, 0xdb23, 0xee32, 0x9049, 0x395a,},
- {0xa23e, 0x5308, 0xfefb, 0x1155,
- 0xfa91, 0x1939, 0x637a, 0x4325, 0xc031, 0x3cac,},
- {0xe26d, 0xdbde, 0xd05d, 0xb3f6,
- 0xac7c, 0xe4a0, 0x64bc, 0x467c, 0xddd0, 0x3e55,},
- {0x2a20, 0x6224, 0x47b3, 0x98d7,
- 0x3f23, 0xe9a5, 0xa539, 0xea27, 0xa87f, 0x3f2a,},
- {0x0b5b, 0x4af2, 0xa581, 0x18ed,
- 0x67de, 0x94ba, 0x4539, 0x1ead, 0xcfb1, 0x3f94,},
- {0xbf71, 0xa9b3, 0x7989, 0xbe68,
- 0x4c2e, 0xe15b, 0xc44d, 0x94be, 0xe695, 0x3fc9,},
- {0x3d4d, 0x7c3d, 0x36ba, 0x0d2b,
- 0xfdc2, 0xcefc, 0x8461, 0x7711, 0xabcc, 0x3fe4,},
- {0xc155, 0xa4a8, 0x404e, 0x6113,
- 0xd3c3, 0x652b, 0xe219, 0x1758, 0xd1b7, 0x3ff1,},
- {0xd70a, 0x70a3, 0x0a3d, 0xa3d7,
- 0x3d70, 0xd70a, 0x70a3, 0x0a3d, 0xa3d7, 0x3ff8,},
- {0xcccd, 0xcccc, 0xcccc, 0xcccc,
- 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0x3ffb,}, /* 10**-1 */
-};
-#else
/* LONG_DOUBLE_TYPE_SIZE is other than 128 */
static unsigned EMUSHORT etens[NTEN + 1][NE] =
{
@@ -4639,69 +4188,7 @@ static unsigned EMUSHORT emtens[NTEN + 1][NE] =
{0x3d71, 0xd70a, 0x70a3, 0x0a3d, 0xa3d7, 0x3ff8,},
{0xcccd, 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0x3ffb,}, /* 10**-1 */
};
-#endif
-
-#if 0
-/* Convert float value X to ASCII string STRING with NDIG digits after
- the decimal point. */
-
-static void
-e24toasc (x, string, ndigs)
- unsigned EMUSHORT x[];
- char *string;
- int ndigs;
-{
- unsigned EMUSHORT w[NI];
-
- e24toe (x, w);
- etoasc (w, string, ndigs);
-}
-
-/* Convert double value X to ASCII string STRING with NDIG digits after
- the decimal point. */
-
-static void
-e53toasc (x, string, ndigs)
- unsigned EMUSHORT x[];
- char *string;
- int ndigs;
-{
- unsigned EMUSHORT w[NI];
-
- e53toe (x, w);
- etoasc (w, string, ndigs);
-}
-
-/* Convert double extended value X to ASCII string STRING with NDIG digits
- after the decimal point. */
-
-static void
-e64toasc (x, string, ndigs)
- unsigned EMUSHORT x[];
- char *string;
- int ndigs;
-{
- unsigned EMUSHORT w[NI];
-
- e64toe (x, w);
- etoasc (w, string, ndigs);
-}
-/* Convert 128-bit long double value X to ASCII string STRING with NDIG digits
- after the decimal point. */
-
-static void
-e113toasc (x, string, ndigs)
- unsigned EMUSHORT x[];
- char *string;
- int ndigs;
-{
- unsigned EMUSHORT w[NI];
-
- e113toe (x, w);
- etoasc (w, string, ndigs);
-}
-#endif /* 0 */
/* Convert e-type X to ASCII string STRING with NDIGS digits after
the decimal point. */
@@ -5546,32 +5033,6 @@ efloor (x, y)
}
-#if 0
-/* Return S and EXP such that S * 2^EXP = X and .5 <= S < 1.
- For example, 1.1 = 0.55 * 2^1. */
-
-static void
-efrexp (x, exp, s)
- unsigned EMUSHORT x[];
- int *exp;
- unsigned EMUSHORT s[];
-{
- unsigned EMUSHORT xi[NI];
- EMULONG li;
-
- emovi (x, xi);
- /* Handle denormalized numbers properly using long integer exponent. */
- li = (EMULONG) ((EMUSHORT) xi[1]);
-
- if (li == 0)
- {
- li -= enormlz (xi);
- }
- xi[1] = 0x3ffe;
- emovo (xi, s);
- *exp = (int) (li - 0x3ffe);
-}
-#endif
/* Return e type Y = X * 2^PWR2. */
@@ -5594,43 +5055,6 @@ eldexp (x, pwr2, y)
}
-#if 0
-/* C = remainder after dividing B by A, all e type values.
- Least significant integer quotient bits left in EQUOT. */
-
-static void
-eremain (a, b, c)
- unsigned EMUSHORT a[], b[], c[];
-{
- unsigned EMUSHORT den[NI], num[NI];
-
-#ifdef NANS
- if (eisinf (b)
- || (ecmp (a, ezero) == 0)
- || eisnan (a)
- || eisnan (b))
- {
- enan (c, 0);
- return;
- }
-#endif
- if (ecmp (a, ezero) == 0)
- {
- mtherr ("eremain", SING);
- eclear (c);
- return;
- }
- emovi (a, den);
- emovi (b, num);
- eiremain (den, num);
- /* Sign of remainder = sign of quotient */
- if (a[0] == b[0])
- num[0] = 0;
- else
- num[0] = 0xffff;
- emovo (num, c);
-}
-#endif
/* Return quotient of exploded e-types NUM / DEN in EQUOT,
remainder in NUM. */
@@ -6216,40 +5640,32 @@ toc4x (x, y, mode)
#ifdef TFMODE_NAN
TFMODE_NAN;
#else
-#ifdef IEEE
unsigned EMUSHORT TFbignan[8] =
{0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff};
unsigned EMUSHORT TFlittlenan[8] = {0, 0, 0, 0, 0, 0, 0x8000, 0xffff};
#endif
-#endif
#ifdef XFMODE_NAN
XFMODE_NAN;
#else
-#ifdef IEEE
unsigned EMUSHORT XFbignan[6] =
{0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff};
unsigned EMUSHORT XFlittlenan[6] = {0, 0, 0, 0xc000, 0xffff, 0};
#endif
-#endif
#ifdef DFMODE_NAN
DFMODE_NAN;
#else
-#ifdef IEEE
unsigned EMUSHORT DFbignan[4] = {0x7fff, 0xffff, 0xffff, 0xffff};
unsigned EMUSHORT DFlittlenan[4] = {0, 0, 0, 0xfff8};
#endif
-#endif
#ifdef SFMODE_NAN
SFMODE_NAN;
#else
-#ifdef IEEE
unsigned EMUSHORT SFbignan[2] = {0x7fff, 0xffff};
unsigned EMUSHORT SFlittlenan[2] = {0, 0xffc0};
#endif
-#endif
static void
@@ -6463,378 +5879,6 @@ ereal_from_double (d)
}
-#if 0
-/* Convert target computer unsigned 64-bit integer to e-type.
- The endian-ness of DImode follows the convention for integers,
- so we use WORDS_BIG_ENDIAN here, not REAL_WORDS_BIG_ENDIAN. */
-
-static void
-uditoe (di, e)
- unsigned EMUSHORT *di; /* Address of the 64-bit int. */
- unsigned EMUSHORT *e;
-{
- unsigned EMUSHORT yi[NI];
- int k;
-
- ecleaz (yi);
- if (WORDS_BIG_ENDIAN)
- {
- for (k = M; k < M + 4; k++)
- yi[k] = *di++;
- }
- else
- {
- for (k = M + 3; k >= M; k--)
- yi[k] = *di++;
- }
- yi[E] = EXONE + 47; /* exponent if normalize shift count were 0 */
- if ((k = enormlz (yi)) > NBITS)/* normalize the significand */
- ecleaz (yi); /* it was zero */
- else
- yi[E] -= (unsigned EMUSHORT) k;/* subtract shift count from exponent */
- emovo (yi, e);
-}
-
-/* Convert target computer signed 64-bit integer to e-type. */
-
-static void
-ditoe (di, e)
- unsigned EMUSHORT *di; /* Address of the 64-bit int. */
- unsigned EMUSHORT *e;
-{
- unsigned EMULONG acc;
- unsigned EMUSHORT yi[NI];
- unsigned EMUSHORT carry;
- int k, sign;
-
- ecleaz (yi);
- if (WORDS_BIG_ENDIAN)
- {
- for (k = M; k < M + 4; k++)
- yi[k] = *di++;
- }
- else
- {
- for (k = M + 3; k >= M; k--)
- yi[k] = *di++;
- }
- /* Take absolute value */
- sign = 0;
- if (yi[M] & 0x8000)
- {
- sign = 1;
- carry = 0;
- for (k = M + 3; k >= M; k--)
- {
- acc = (unsigned EMULONG) (~yi[k] & 0xffff) + carry;
- yi[k] = acc;
- carry = 0;
- if (acc & 0x10000)
- carry = 1;
- }
- }
- yi[E] = EXONE + 47; /* exponent if normalize shift count were 0 */
- if ((k = enormlz (yi)) > NBITS)/* normalize the significand */
- ecleaz (yi); /* it was zero */
- else
- yi[E] -= (unsigned EMUSHORT) k;/* subtract shift count from exponent */
- emovo (yi, e);
- if (sign)
- eneg (e);
-}
-
-
-/* Convert e-type to unsigned 64-bit int. */
-
-static void
-etoudi (x, i)
- unsigned EMUSHORT *x;
- unsigned EMUSHORT *i;
-{
- unsigned EMUSHORT xi[NI];
- int j, k;
-
- emovi (x, xi);
- if (xi[0])
- {
- xi[M] = 0;
- goto noshift;
- }
- k = (int) xi[E] - (EXONE - 1);
- if (k <= 0)
- {
- for (j = 0; j < 4; j++)
- *i++ = 0;
- return;
- }
- if (k > 64)
- {
- for (j = 0; j < 4; j++)
- *i++ = 0xffff;
- if (extra_warnings)
- warning ("overflow on truncation to integer");
- return;
- }
- if (k > 16)
- {
- /* Shift more than 16 bits: first shift up k-16 mod 16,
- then shift up by 16's. */
- j = k - ((k >> 4) << 4);
- if (j == 0)
- j = 16;
- eshift (xi, j);
- if (WORDS_BIG_ENDIAN)
- *i++ = xi[M];
- else
- {
- i += 3;
- *i-- = xi[M];
- }
- k -= j;
- do
- {
- eshup6 (xi);
- if (WORDS_BIG_ENDIAN)
- *i++ = xi[M];
- else
- *i-- = xi[M];
- }
- while ((k -= 16) > 0);
- }
- else
- {
- /* shift not more than 16 bits */
- eshift (xi, k);
-
-noshift:
-
- if (WORDS_BIG_ENDIAN)
- {
- i += 3;
- *i-- = xi[M];
- *i-- = 0;
- *i-- = 0;
- *i = 0;
- }
- else
- {
- *i++ = xi[M];
- *i++ = 0;
- *i++ = 0;
- *i = 0;
- }
- }
-}
-
-
-/* Convert e-type to signed 64-bit int. */
-
-static void
-etodi (x, i)
- unsigned EMUSHORT *x;
- unsigned EMUSHORT *i;
-{
- unsigned EMULONG acc;
- unsigned EMUSHORT xi[NI];
- unsigned EMUSHORT carry;
- unsigned EMUSHORT *isave;
- int j, k;
-
- emovi (x, xi);
- k = (int) xi[E] - (EXONE - 1);
- if (k <= 0)
- {
- for (j = 0; j < 4; j++)
- *i++ = 0;
- return;
- }
- if (k > 64)
- {
- for (j = 0; j < 4; j++)
- *i++ = 0xffff;
- if (extra_warnings)
- warning ("overflow on truncation to integer");
- return;
- }
- isave = i;
- if (k > 16)
- {
- /* Shift more than 16 bits: first shift up k-16 mod 16,
- then shift up by 16's. */
- j = k - ((k >> 4) << 4);
- if (j == 0)
- j = 16;
- eshift (xi, j);
- if (WORDS_BIG_ENDIAN)
- *i++ = xi[M];
- else
- {
- i += 3;
- *i-- = xi[M];
- }
- k -= j;
- do
- {
- eshup6 (xi);
- if (WORDS_BIG_ENDIAN)
- *i++ = xi[M];
- else
- *i-- = xi[M];
- }
- while ((k -= 16) > 0);
- }
- else
- {
- /* shift not more than 16 bits */
- eshift (xi, k);
-
- if (WORDS_BIG_ENDIAN)
- {
- i += 3;
- *i = xi[M];
- *i-- = 0;
- *i-- = 0;
- *i = 0;
- }
- else
- {
- *i++ = xi[M];
- *i++ = 0;
- *i++ = 0;
- *i = 0;
- }
- }
- /* Negate if negative */
- if (xi[0])
- {
- carry = 0;
- if (WORDS_BIG_ENDIAN)
- isave += 3;
- for (k = 0; k < 4; k++)
- {
- acc = (unsigned EMULONG) (~(*isave) & 0xffff) + carry;
- if (WORDS_BIG_ENDIAN)
- *isave-- = acc;
- else
- *isave++ = acc;
- carry = 0;
- if (acc & 0x10000)
- carry = 1;
- }
- }
-}
-
-
-/* Longhand square root routine. */
-
-
-static int esqinited = 0;
-static unsigned short sqrndbit[NI];
-
-static void
-esqrt (x, y)
- unsigned EMUSHORT *x, *y;
-{
- unsigned EMUSHORT temp[NI], num[NI], sq[NI], xx[NI];
- EMULONG m, exp;
- int i, j, k, n, nlups;
-
- if (esqinited == 0)
- {
- ecleaz (sqrndbit);
- sqrndbit[NI - 2] = 1;
- esqinited = 1;
- }
- /* Check for arg <= 0 */
- i = ecmp (x, ezero);
- if (i <= 0)
- {
- if (i == -1)
- {
- mtherr ("esqrt", DOMAIN);
- eclear (y);
- }
- else
- emov (x, y);
- return;
- }
-
-#ifdef INFINITY
- if (eisinf (x))
- {
- eclear (y);
- einfin (y);
- return;
- }
-#endif
- /* Bring in the arg and renormalize if it is denormal. */
- emovi (x, xx);
- m = (EMULONG) xx[1]; /* local long word exponent */
- if (m == 0)
- m -= enormlz (xx);
-
- /* Divide exponent by 2 */
- m -= 0x3ffe;
- exp = (unsigned short) ((m / 2) + 0x3ffe);
-
- /* Adjust if exponent odd */
- if ((m & 1) != 0)
- {
- if (m > 0)
- exp += 1;
- eshdn1 (xx);
- }
-
- ecleaz (sq);
- ecleaz (num);
- n = 8; /* get 8 bits of result per inner loop */
- nlups = rndprc;
- j = 0;
-
- while (nlups > 0)
- {
- /* bring in next word of arg */
- if (j < NE)
- num[NI - 1] = xx[j + 3];
- /* Do additional bit on last outer loop, for roundoff. */
- if (nlups <= 8)
- n = nlups + 1;
- for (i = 0; i < n; i++)
- {
- /* Next 2 bits of arg */
- eshup1 (num);
- eshup1 (num);
- /* Shift up answer */
- eshup1 (sq);
- /* Make trial divisor */
- for (k = 0; k < NI; k++)
- temp[k] = sq[k];
- eshup1 (temp);
- eaddm (sqrndbit, temp);
- /* Subtract and insert answer bit if it goes in */
- if (ecmpm (temp, num) <= 0)
- {
- esubm (temp, num);
- sq[NI - 2] |= 1;
- }
- }
- nlups -= n;
- j += 1;
- }
-
- /* Adjust for extra, roundoff loop done. */
- exp += (NBITS - 1) - rndprc;
-
- /* Sticky bit = 1 if the remainder is nonzero. */
- k = 0;
- for (i = 3; i < NI; i++)
- k |= (int) num[i];
-
- /* Renormalize and round off. */
- emdnorm (sq, k, 0, exp, 64);
- emovo (sq, y);
-}
-#endif
#endif /* EMU_NON_COMPILE not defined */
/* Return the binary precision of the significand for a given
@@ -6853,30 +5897,11 @@ switch (GET_MODE_BITSIZE (mode))
{
case 32:
-#if TARGET_FLOAT_FORMAT == C4X_FLOAT_FORMAT
- return 56;
-#endif
return 24;
case 64:
-#if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
return 53;
-#else
-#if TARGET_FLOAT_FORMAT == IBM_FLOAT_FORMAT
- return 56;
-#else
-#if TARGET_FLOAT_FORMAT == VAX_FLOAT_FORMAT
- return 56;
-#else
-#if TARGET_FLOAT_FORMAT == C4X_FLOAT_FORMAT
- return 56;
-#else
- abort ();
-#endif
-#endif
-#endif
-#endif
case 96:
return 64;
diff --git a/gcc/real.h b/gcc/real.h
index 0fa893c..14946b2 100755
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -30,13 +30,9 @@ Boston, MA 02111-1307, USA. */
/* Default to IEEE float if not specified. Nearly all machines use it. */
-#ifndef TARGET_FLOAT_FORMAT
#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-#endif
-#ifndef HOST_FLOAT_FORMAT
#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-#endif
#if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
#define REAL_INFINITY
@@ -64,56 +60,11 @@ Boston, MA 02111-1307, USA. */
that can produce a target machine format differing by more
than just endian-ness from the host's format. The emulator
is also used to support extended real XFmode. */
-#ifndef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 64
-#endif
-#if (LONG_DOUBLE_TYPE_SIZE == 96) || (LONG_DOUBLE_TYPE_SIZE == 128)
-#ifndef REAL_ARITHMETIC
-#define REAL_ARITHMETIC
-#endif
-#endif
-#ifdef REAL_ARITHMETIC
+
/* **** Start of software floating point emulator interface macros **** */
-/* Support 80-bit extended real XFmode if LONG_DOUBLE_TYPE_SIZE
- has been defined to be 96 in the tm.h machine file. */
-#if (LONG_DOUBLE_TYPE_SIZE == 96)
-#define REAL_IS_NOT_DOUBLE
-#define REAL_ARITHMETIC
-typedef struct {
- HOST_WIDE_INT r[(11 + sizeof (HOST_WIDE_INT))/(sizeof (HOST_WIDE_INT))];
-} realvaluetype;
-#define REAL_VALUE_TYPE realvaluetype
-
-#else /* no XFmode support */
-
-#if (LONG_DOUBLE_TYPE_SIZE == 128)
-
-#define REAL_IS_NOT_DOUBLE
-#define REAL_ARITHMETIC
-typedef struct {
- HOST_WIDE_INT r[(19 + sizeof (HOST_WIDE_INT))/(sizeof (HOST_WIDE_INT))];
-} realvaluetype;
-#define REAL_VALUE_TYPE realvaluetype
-
-#else /* not TFmode */
-
-#if HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT
-/* If no XFmode support, then a REAL_VALUE_TYPE is 64 bits wide
- but it is not necessarily a host machine double. */
-#define REAL_IS_NOT_DOUBLE
-typedef struct {
- HOST_WIDE_INT r[(7 + sizeof (HOST_WIDE_INT))/(sizeof (HOST_WIDE_INT))];
-} realvaluetype;
-#define REAL_VALUE_TYPE realvaluetype
-#else
-/* If host and target formats are compatible, then a REAL_VALUE_TYPE
- is actually a host machine double. */
#define REAL_VALUE_TYPE double
-#endif
-
-#endif /* no TFmode support */
-#endif /* no XFmode support */
extern int significand_size PROTO((enum machine_mode));
@@ -122,7 +73,6 @@ extern int significand_size PROTO((enum machine_mode));
they invoke emulator functions. This will succeed only if the machine
files have been updated to use these macros in place of any
references to host machine `double' or `float' types. */
-#ifdef REAL_ARITHMETIC
#undef REAL_ARITHMETIC
#define REAL_ARITHMETIC(value, code, d1, d2) \
earith (&(value), (code), &(d1), &(d2))
@@ -198,11 +148,7 @@ extern REAL_VALUE_TYPE real_value_truncate PROTO ((enum machine_mode,
ereal_from_uint (&d, lo, hi, mode)
/* IN is a REAL_VALUE_TYPE. OUT is an array of longs. */
-#if LONG_DOUBLE_TYPE_SIZE == 96
-#define REAL_VALUE_TO_TARGET_LONG_DOUBLE(IN, OUT) (etarldouble ((IN), (OUT)))
-#else
#define REAL_VALUE_TO_TARGET_LONG_DOUBLE(IN, OUT) (etartdouble ((IN), (OUT)))
-#endif
#define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) (etardouble ((IN), (OUT)))
/* IN is a REAL_VALUE_TYPE. OUT is a long. */
@@ -224,45 +170,7 @@ extern REAL_VALUE_TYPE real_value_truncate PROTO ((enum machine_mode,
/* Conversions to decimal ASCII string. */
#define REAL_VALUE_TO_DECIMAL(r, fmt, s) (ereal_to_decimal (r, s))
-#endif /* REAL_ARITHMETIC defined */
-
/* **** End of software floating point emulator interface macros **** */
-#else /* No XFmode or TFmode and REAL_ARITHMETIC not defined */
-
-/* old interface */
-#ifdef REAL_ARITHMETIC
-/* Defining REAL_IS_NOT_DOUBLE breaks certain initializations
- when REAL_ARITHMETIC etc. are not defined. */
-
-/* Now see if the host and target machines use the same format.
- If not, define REAL_IS_NOT_DOUBLE (even if we end up representing
- reals as doubles because we have no better way in this cross compiler.)
- This turns off various optimizations that can happen when we know the
- compiler's float format matches the target's float format.
- */
-#if HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT
-#define REAL_IS_NOT_DOUBLE
-#ifndef REAL_VALUE_TYPE
-typedef struct {
- HOST_WIDE_INT r[sizeof (double)/sizeof (HOST_WIDE_INT)];
- } realvaluetype;
-#define REAL_VALUE_TYPE realvaluetype
-#endif /* no REAL_VALUE_TYPE */
-#endif /* formats differ */
-#endif /* 0 */
-
-#endif /* emulator not used */
-
-/* If we are not cross-compiling, use a `double' to represent the
- floating-point value. Otherwise, use some other type
- (probably a struct containing an array of longs). */
-#ifndef REAL_VALUE_TYPE
-#define REAL_VALUE_TYPE double
-#else
-#define REAL_IS_NOT_DOUBLE
-#endif
-
-#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
/* Convert a type `double' value in host format first to a type `float'
value in host format and then to a single type `long' value which
@@ -302,19 +210,13 @@ do { \
(OUT)[1] = u.l[0], (OUT)[0] = u.l[1]; \
} while (0)
#endif
-#endif /* HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT */
-
-/* In this configuration, double and long double are the same. */
-#ifndef REAL_VALUE_TO_TARGET_LONG_DOUBLE
-#define REAL_VALUE_TO_TARGET_LONG_DOUBLE(a, b) REAL_VALUE_TO_TARGET_DOUBLE (a, b)
-#endif
/* Compare two floating-point objects for bitwise identity.
This is not the same as comparing for equality on IEEE hosts:
-0.0 equals 0.0 but they are not identical, and conversely
two NaNs might be identical but they cannot be equal. */
#define REAL_VALUES_IDENTICAL(x, y) \
- (!bcmp ((char *) &(x), (char *) &(y), sizeof (REAL_VALUE_TYPE)))
+ (!memcmp ((char *) &(x), (char *) &(y), sizeof (REAL_VALUE_TYPE)))
/* Compare two floating-point values for equality. */
#ifndef REAL_VALUES_EQUAL
@@ -355,25 +257,12 @@ extern double ldexp ();
/* Convert the string X to a floating-point value. */
#ifndef REAL_VALUE_ATOF
-#if 1
/* Use real.c to convert decimal numbers to binary, ... */
REAL_VALUE_TYPE ereal_atof ();
#define REAL_VALUE_ATOF(x, s) ereal_atof (x, s)
/* Could use ereal_atof here for hexadecimal floats too, but real_hex_to_f
is OK and it uses faster native fp arithmetic. */
/* #define REAL_VALUE_HTOF(x, s) ereal_atof (x, s) */
-#else
-/* ... or, if you like the host computer's atof, go ahead and use it: */
-#define REAL_VALUE_ATOF(x, s) atof (x)
-#if defined (MIPSEL) || defined (MIPSEB)
-/* MIPS compiler can't handle parens around the function name.
- This problem *does not* appear to be connected with any
- macro definition for atof. It does not seem there is one. */
-extern double atof ();
-#else
-extern double (atof) ();
-#endif
-#endif
#endif
/* Hexadecimal floating constant input for use with host computer's
diff --git a/gcc/recog.c b/gcc/recog.c
index 956209b..ef65fb1 100755
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1804,7 +1804,7 @@ extract_insn (insn)
recog_n_alternatives += (*p++ == ',');
}
#ifndef REGISTER_CONSTRAINTS
- bzero (recog_operand_address_p, sizeof recog_operand_address_p);
+ zero_memory (recog_operand_address_p, sizeof recog_operand_address_p);
#endif
break;
}
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index e391706..b8fb48e 100755
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -498,8 +498,8 @@ reg_to_stack (first, file)
block_stack_in = (stack) alloca (blocks * sizeof (struct stack_def));
block_out_reg_set = (HARD_REG_SET *) alloca (blocks * sizeof (HARD_REG_SET));
- bzero ((char *) block_stack_in, blocks * sizeof (struct stack_def));
- bzero ((char *) block_out_reg_set, blocks * sizeof (HARD_REG_SET));
+ zero_memory ((char *) block_stack_in, blocks * sizeof (struct stack_def));
+ zero_memory ((char *) block_out_reg_set, blocks * sizeof (HARD_REG_SET));
block_number = (int *) alloca ((max_uid + 1) * sizeof (int));
@@ -688,7 +688,7 @@ record_asm_reg_life (insn, regstack)
Also enforce rule #5: Output operands must start at the top of
the reg-stack: output operands may not "skip" a reg. */
- bzero ((char *) reg_used_as_output, sizeof (reg_used_as_output));
+ zero_memory ((char *) reg_used_as_output, sizeof (reg_used_as_output));
for (i = 0; i < n_outputs; i++)
if (STACK_REG_P (recog_operand[i]))
{
@@ -722,7 +722,7 @@ record_asm_reg_life (insn, regstack)
to the top of the reg-stack than any input that is not implicitly
popped. */
- bzero ((char *) implicitly_dies, sizeof (implicitly_dies));
+ zero_memory ((char *) implicitly_dies, sizeof (implicitly_dies));
for (i = n_outputs; i < n_outputs + n_inputs; i++)
if (STACK_REG_P (recog_operand[i]))
{
@@ -2232,7 +2232,7 @@ subst_asm_stack_regs (insn, regstack)
}
}
- bcopy ((char *) regstack, (char *) &temp_stack, sizeof (temp_stack));
+ copy_memory ((char *) regstack, (char *) &temp_stack, sizeof (temp_stack));
/* Put the input regs into the desired place in TEMP_STACK. */
@@ -2531,7 +2531,7 @@ change_stack (insn, old, new, when)
the old stack order. */
new->top = old->top;
- bcopy (old->reg, new->reg, sizeof (new->reg));
+ copy_memory (old->reg, new->reg, sizeof (new->reg));
}
else
{
diff --git a/gcc/regclass.c b/gcc/regclass.c
index f62275a..dbf8871 100755
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -207,7 +207,7 @@ static rtx top_of_stack[MAX_MACHINE_MODE];
/* Linked list of reg_info structures allocated for reg_n_info array.
Grouping all of the allocated structures together in one lump
- means only one call to bzero to clear them, rather than n smaller
+ means only one call to zero_memory to clear them, rather than n smaller
calls. */
struct reg_info_data {
struct reg_info_data *next; /* next set of reg_info structures */
@@ -241,9 +241,9 @@ init_reg_sets ()
SET_HARD_REG_BIT (reg_class_contents[i], j);
}
- bcopy (initial_fixed_regs, fixed_regs, sizeof fixed_regs);
- bcopy (initial_call_used_regs, call_used_regs, sizeof call_used_regs);
- bzero (global_regs, sizeof global_regs);
+ copy_memory (initial_fixed_regs, fixed_regs, sizeof fixed_regs);
+ copy_memory (initial_call_used_regs, call_used_regs, sizeof call_used_regs);
+ zero_memory (global_regs, sizeof global_regs);
/* Do any additional initialization regsets may need */
INIT_ONCE_REG_SET ();
@@ -266,7 +266,7 @@ init_reg_sets_1 ()
/* Compute number of hard regs in each class. */
- bzero ((char *) reg_class_size, sizeof reg_class_size);
+ zero_memory ((char *) reg_class_size, sizeof reg_class_size);
for (i = 0; i < N_REG_CLASSES; i++)
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
@@ -373,7 +373,7 @@ init_reg_sets_1 ()
CLEAR_HARD_REG_SET (call_used_reg_set);
CLEAR_HARD_REG_SET (call_fixed_reg_set);
- bcopy (fixed_regs, call_fixed_regs, sizeof call_fixed_regs);
+ copy_memory (fixed_regs, call_fixed_regs, sizeof call_fixed_regs);
n_non_fixed_regs = 0;
@@ -1038,10 +1038,10 @@ regclass (f, nregs)
{
/* Zero out our accumulation of the cost of each class for each reg. */
- bzero ((char *) costs, nregs * sizeof (struct costs));
+ zero_memory ((char *) costs, nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
- bzero (in_inc_dec, nregs);
+ zero_memory (in_inc_dec, nregs);
#endif
loop_depth = 0, loop_cost = 1;
@@ -1194,7 +1194,7 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
if (*p == 0)
{
if (GET_CODE (op) == REG && REGNO (op) >= FIRST_PSEUDO_REGISTER)
- bzero ((char *) &this_op_costs[i], sizeof this_op_costs[i]);
+ zero_memory ((char *) &this_op_costs[i], sizeof this_op_costs[i]);
continue;
}
@@ -1894,7 +1894,7 @@ allocate_reg_info (num_regs, new_p, renumber_p)
if (!reg_data->used_p) /* page just allocated with calloc */
reg_data->used_p = 1; /* no need to zero */
else
- bzero ((char *) &reg_data->data[local_min],
+ zero_memory ((char *) &reg_data->data[local_min],
sizeof (reg_info) * (max - min_index - local_min + 1));
for (i = min_index+local_min; i <= max; i++)
diff --git a/gcc/regmove.c b/gcc/regmove.c
index ee6c734..32d9305 100755
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -692,7 +692,7 @@ find_related (xp, insn, luid, call_tally)
new_related->invalidate_luid = 0;
new_related->death = NULL_RTX;
rel_new (new_related->baseinfo);
- bzero ((char *) new_related->baseinfo,
+ zero_memory ((char *) new_related->baseinfo,
sizeof *new_related->baseinfo);
new_related->baseinfo->prev_base = rel_base_list;
rel_base_list = new_related;
@@ -1508,7 +1508,7 @@ optimize_related_values_1 (rel_base, luid, call_tally, insert_after,
}
/* Finally, clear the entries that we used in regno_related. We do it
- item by item here, because doing it with bzero for each basic block
+ item by item here, because doing it with zero_memory for each basic block
would give O(n*n) time complexity. */
for (rel = rel_base; rel; rel = rel->prev)
regno_related[REGNO (rel->reg)] = 0;
@@ -1623,7 +1623,7 @@ optimize_related_values (nregs, regmove_dump_file)
gcc_obstack_init (&related_obstack);
regno_related = rel_alloc (nregs * sizeof *regno_related);
- bzero ((char *) regno_related, nregs * sizeof *regno_related);
+ zero_memory ((char *) regno_related, nregs * sizeof *regno_related);
rel_base_list = 0;
loop_depth = 1;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
diff --git a/gcc/reload.c b/gcc/reload.c
index c21cd76..6bb93df 100755
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -714,7 +714,7 @@ get_secondary_mem (x, mode, opnum, type)
void
clear_secondary_mem ()
{
- bzero ((char *) secondary_memlocs, sizeof secondary_memlocs);
+ zero_memory ((char *) secondary_memlocs, sizeof secondary_memlocs);
}
#endif /* SECONDARY_MEMORY_NEEDED */
@@ -1553,7 +1553,7 @@ remove_address_replacements (in_rtx)
char reload_flags[MAX_RELOADS];
int something_changed = 0;
- bzero (reload_flags, sizeof reload_flags);
+ zero_memory (reload_flags, sizeof reload_flags);
for (i = 0, j = 0; i < n_replacements; i++)
{
if (loc_mentioned_in_p (replacements[i].where, in_rtx))
@@ -2461,7 +2461,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
/* The eliminated forms of any secondary memory locations are per-insn, so
clear them out here. */
- bzero ((char *) secondary_memlocs_elim, sizeof secondary_memlocs_elim);
+ zero_memory ((char *) secondary_memlocs_elim, sizeof secondary_memlocs_elim);
#endif
/* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it
@@ -2488,9 +2488,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
insn_code_number = INSN_CODE (insn);
this_insn_is_asm = insn_code_number < 0;
- bcopy ((char *) recog_operand_mode, (char *) operand_mode,
+ copy_memory ((char *) recog_operand_mode, (char *) operand_mode,
noperands * sizeof (enum machine_mode));
- bcopy ((char *) recog_constraints, (char *) constraints,
+ copy_memory ((char *) recog_constraints, (char *) constraints,
noperands * sizeof (char *));
commutative = -1;
@@ -3479,7 +3479,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
pref_or_nothing[commutative] = pref_or_nothing[commutative + 1];
pref_or_nothing[commutative + 1] = t;
- bcopy ((char *) recog_constraints, (char *) constraints,
+ copy_memory ((char *) recog_constraints, (char *) constraints,
noperands * sizeof (char *));
goto try_swapped;
}
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 08ca216..8cf24a7 100755
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -616,8 +616,8 @@ reload (first, global, dumpfile)
#endif
/* We don't have a stack slot for any spill reg yet. */
- bzero ((char *) spill_stack_slot, sizeof spill_stack_slot);
- bzero ((char *) spill_stack_slot_width, sizeof spill_stack_slot_width);
+ zero_memory ((char *) spill_stack_slot, sizeof spill_stack_slot);
+ zero_memory ((char *) spill_stack_slot_width, sizeof spill_stack_slot_width);
/* Initialize the save area information for caller-save, in case some
are needed. */
@@ -650,26 +650,26 @@ reload (first, global, dumpfile)
be substituted eventually by altering the REG-rtx's. */
reg_equiv_constant = (rtx *) xmalloc (max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_constant, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_equiv_constant, max_regno * sizeof (rtx));
reg_equiv_memory_loc = (rtx *) xmalloc (max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_memory_loc, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_equiv_memory_loc, max_regno * sizeof (rtx));
reg_equiv_mem = (rtx *) xmalloc (max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_mem, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_equiv_mem, max_regno * sizeof (rtx));
reg_equiv_init = (rtx *) xmalloc (max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_init, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_equiv_init, max_regno * sizeof (rtx));
reg_equiv_address = (rtx *) xmalloc (max_regno * sizeof (rtx));
- bzero ((char *) reg_equiv_address, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_equiv_address, max_regno * sizeof (rtx));
reg_max_ref_width = (int *) xmalloc (max_regno * sizeof (int));
- bzero ((char *) reg_max_ref_width, max_regno * sizeof (int));
+ zero_memory ((char *) reg_max_ref_width, max_regno * sizeof (int));
reg_old_renumber = (short *) xmalloc (max_regno * sizeof (short));
- bcopy (reg_renumber, reg_old_renumber, max_regno * sizeof (short));
+ copy_memory (reg_renumber, reg_old_renumber, max_regno * sizeof (short));
pseudo_forbidden_regs
= (HARD_REG_SET *) xmalloc (max_regno * sizeof (HARD_REG_SET));
pseudo_previous_regs
= (HARD_REG_SET *) xmalloc (max_regno * sizeof (HARD_REG_SET));
CLEAR_HARD_REG_SET (bad_spill_regs_global);
- bzero ((char *) pseudo_previous_regs, max_regno * sizeof (HARD_REG_SET));
+ zero_memory ((char *) pseudo_previous_regs, max_regno * sizeof (HARD_REG_SET));
/* Look for REG_EQUIV notes; record what each pseudo is equivalent to.
Also find all paradoxical subregs and find largest such for each pseudo.
@@ -1475,10 +1475,10 @@ calculate_needs (chain)
struct needs out_addr_addr[MAX_RECOG_OPERANDS];
} insn_needs;
- bzero ((char *) chain->group_size, sizeof chain->group_size);
+ zero_memory ((char *) chain->group_size, sizeof chain->group_size);
for (i = 0; i < N_REG_CLASSES; i++)
chain->group_mode[i] = VOIDmode;
- bzero ((char *) &insn_needs, sizeof insn_needs);
+ zero_memory ((char *) &insn_needs, sizeof insn_needs);
/* Count each reload once in every class
containing the reload's own class. */
@@ -3178,7 +3178,7 @@ eliminate_regs (x, mem_mode, insn)
if (new != XEXP (x, i) && ! copied)
{
rtx new_x = rtx_alloc (code);
- bcopy ((char *) x, (char *) new_x,
+ copy_memory ((char *) x, (char *) new_x,
(sizeof (*new_x) - sizeof (new_x->fld)
+ sizeof (new_x->fld[0]) * GET_RTX_LENGTH (code)));
x = new_x;
@@ -3199,7 +3199,7 @@ eliminate_regs (x, mem_mode, insn)
if (! copied)
{
rtx new_x = rtx_alloc (code);
- bcopy ((char *) x, (char *) new_x,
+ copy_memory ((char *) x, (char *) new_x,
(sizeof (*new_x) - sizeof (new_x->fld)
+ (sizeof (new_x->fld[0])
* GET_RTX_LENGTH (code))));
@@ -3576,7 +3576,7 @@ static void
set_initial_label_offsets ()
{
rtx x;
- bzero ((char *) &offsets_known_at[get_first_label_num ()], num_labels);
+ zero_memory ((char *) &offsets_known_at[get_first_label_num ()], num_labels);
for (x = forced_labels; x; x = XEXP (x, 1))
if (XEXP (x, 0))
@@ -3700,7 +3700,7 @@ init_elim_table ()
{
reg_eliminate = (struct elim_table *)
xmalloc(sizeof(struct elim_table) * NUM_ELIMINABLE_REGS);
- bzero ((PTR) reg_eliminate,
+ zero_memory ((PTR) reg_eliminate,
sizeof(struct elim_table) * NUM_ELIMINABLE_REGS);
}
@@ -3853,7 +3853,7 @@ finish_spills (global, dumpfile)
/* Retry global register allocation if possible. */
if (global)
{
- bzero ((char *) pseudo_forbidden_regs, max_regno * sizeof (HARD_REG_SET));
+ zero_memory ((char *) pseudo_forbidden_regs, max_regno * sizeof (HARD_REG_SET));
/* For every insn that needs reloads, set the registers used as spill
regs in pseudo_forbidden_regs for every pseudo live across the
insn. */
@@ -4193,10 +4193,10 @@ reload_as_needed (live_known)
#endif
rtx x;
- bzero ((char *) spill_reg_rtx, sizeof spill_reg_rtx);
- bzero ((char *) spill_reg_store, sizeof spill_reg_store);
+ zero_memory ((char *) spill_reg_rtx, sizeof spill_reg_rtx);
+ zero_memory ((char *) spill_reg_store, sizeof spill_reg_store);
reg_last_reload_reg = (rtx *) alloca (max_regno * sizeof (rtx));
- bzero ((char *) reg_last_reload_reg, max_regno * sizeof (rtx));
+ zero_memory ((char *) reg_last_reload_reg, max_regno * sizeof (rtx));
reg_has_output_reload = (char *) alloca (max_regno);
CLEAR_HARD_REG_SET (reg_reloaded_valid);
@@ -4256,7 +4256,7 @@ reload_as_needed (live_known)
rtx's for those pseudo regs. */
else
{
- bzero (reg_has_output_reload, max_regno);
+ zero_memory (reg_has_output_reload, max_regno);
CLEAR_HARD_REG_SET (reg_is_output_reload);
find_reloads (insn, 1, spill_indirect_levels, live_known,
@@ -5612,9 +5612,9 @@ choose_reload_regs (chain)
HARD_REG_SET save_reload_reg_used_in_other_addr;
HARD_REG_SET save_reload_reg_used_at_all;
- bzero (reload_inherited, MAX_RELOADS);
- bzero ((char *) reload_inheritance_insn, MAX_RELOADS * sizeof (rtx));
- bzero ((char *) reload_override_in, MAX_RELOADS * sizeof (rtx));
+ zero_memory (reload_inherited, MAX_RELOADS);
+ zero_memory ((char *) reload_inheritance_insn, MAX_RELOADS * sizeof (rtx));
+ zero_memory ((char *) reload_override_in, MAX_RELOADS * sizeof (rtx));
CLEAR_HARD_REG_SET (reload_reg_used);
CLEAR_HARD_REG_SET (reload_reg_used_at_all);
@@ -5705,15 +5705,15 @@ choose_reload_regs (chain)
if (n_reloads > 1)
qsort (reload_order, n_reloads, sizeof (short), reload_reg_class_lower);
- bcopy ((char *) reload_reg_rtx, (char *) save_reload_reg_rtx,
+ copy_memory ((char *) reload_reg_rtx, (char *) save_reload_reg_rtx,
sizeof reload_reg_rtx);
- bcopy (reload_inherited, save_reload_inherited, sizeof reload_inherited);
- bcopy ((char *) reload_inheritance_insn,
+ copy_memory (reload_inherited, save_reload_inherited, sizeof reload_inherited);
+ copy_memory ((char *) reload_inheritance_insn,
(char *) save_reload_inheritance_insn,
sizeof reload_inheritance_insn);
- bcopy ((char *) reload_override_in, (char *) save_reload_override_in,
+ copy_memory ((char *) reload_override_in, (char *) save_reload_override_in,
sizeof reload_override_in);
- bcopy ((char *) reload_spill_index, (char *) save_reload_spill_index,
+ copy_memory ((char *) reload_spill_index, (char *) save_reload_spill_index,
sizeof reload_spill_index);
COPY_HARD_REG_SET (save_reload_reg_used, reload_reg_used);
COPY_HARD_REG_SET (save_reload_reg_used_at_all, reload_reg_used_at_all);
@@ -6181,16 +6181,16 @@ choose_reload_regs (chain)
/* Loop around and try without any inheritance. */
/* First undo everything done by the failed attempt
to allocate with inheritance. */
- bcopy ((char *) save_reload_reg_rtx, (char *) reload_reg_rtx,
+ copy_memory ((char *) save_reload_reg_rtx, (char *) reload_reg_rtx,
sizeof reload_reg_rtx);
- bcopy ((char *) save_reload_inherited, (char *) reload_inherited,
+ copy_memory ((char *) save_reload_inherited, (char *) reload_inherited,
sizeof reload_inherited);
- bcopy ((char *) save_reload_inheritance_insn,
+ copy_memory ((char *) save_reload_inheritance_insn,
(char *) reload_inheritance_insn,
sizeof reload_inheritance_insn);
- bcopy ((char *) save_reload_override_in, (char *) reload_override_in,
+ copy_memory ((char *) save_reload_override_in, (char *) reload_override_in,
sizeof reload_override_in);
- bcopy ((char *) save_reload_spill_index, (char *) reload_spill_index,
+ copy_memory ((char *) save_reload_spill_index, (char *) reload_spill_index,
sizeof reload_spill_index);
COPY_HARD_REG_SET (reload_reg_used, save_reload_reg_used);
COPY_HARD_REG_SET (reload_reg_used_at_all, save_reload_reg_used_at_all);
@@ -8664,7 +8664,7 @@ reload_cse_regs_1 (first)
init_alias_analysis ();
reg_values = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
- bzero ((char *)reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
+ zero_memory ((char *)reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
/* Create our EXPR_LIST structures on reload_obstack, so that we can
free them when we are done. */
@@ -9105,8 +9105,8 @@ reload_cse_simplify_operands (insn)
alternative_reject = (int *) alloca (recog_n_alternatives * sizeof (int));
alternative_nregs = (int *) alloca (recog_n_alternatives * sizeof (int));
alternative_order = (int *) alloca (recog_n_alternatives * sizeof (int));
- bzero ((char *)alternative_reject, recog_n_alternatives * sizeof (int));
- bzero ((char *)alternative_nregs, recog_n_alternatives * sizeof (int));
+ zero_memory ((char *)alternative_reject, recog_n_alternatives * sizeof (int));
+ zero_memory ((char *)alternative_nregs, recog_n_alternatives * sizeof (int));
for (i = 0; i < recog_n_operands; i++)
{
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 36e4b66..dc5606e 100755
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -3556,8 +3556,8 @@ dbr_schedule (first, file)
end_of_function_label = 0;
/* Initialize the statistics for this function. */
- bzero ((char *) num_insns_needing_delays, sizeof num_insns_needing_delays);
- bzero ((char *) num_filled_delays, sizeof num_filled_delays);
+ zero_memory ((char *) num_insns_needing_delays, sizeof num_insns_needing_delays);
+ zero_memory ((char *) num_filled_delays, sizeof num_filled_delays);
/* Now do the delay slot filling. Try everything twice in case earlier
changes make more slots fillable. */
diff --git a/gcc/resource.c b/gcc/resource.c
index c76e253..3231f0e 100755
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -1146,11 +1146,11 @@ init_resource_info (epilogue_insn)
target_hash_table
= (struct target_info **) xmalloc ((TARGET_HASH_PRIME
* sizeof (struct target_info *)));
- bzero ((char *) target_hash_table,
+ zero_memory ((char *) target_hash_table,
TARGET_HASH_PRIME * sizeof (struct target_info *));
bb_ticks = (int *) xmalloc (n_basic_blocks * sizeof (int));
- bzero ((char *) bb_ticks, n_basic_blocks * sizeof (int));
+ zero_memory ((char *) bb_ticks, n_basic_blocks * sizeof (int));
}
/* Free up the resources allcated to mark_target_live_regs (). This
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index db47d32..de260ad 100755
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -96,7 +96,7 @@ void
sbitmap_copy (dst, src)
sbitmap dst, src;
{
- bcopy (src->elms, dst->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
+ copy_memory (src->elms, dst->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
}
/* Zero all elements in a bitmap. */
@@ -105,7 +105,7 @@ void
sbitmap_zero (bmap)
sbitmap bmap;
{
- bzero ((char *) bmap->elms, bmap->bytes);
+ zero_memory ((char *) bmap->elms, bmap->bytes);
}
/* Set to ones all elements in a bitmap. */
diff --git a/gcc/sched.c b/gcc/sched.c
index 27a5096..c546e6f 100755
--- a/gcc/sched.c
+++ b/gcc/sched.c
@@ -637,9 +637,9 @@ static int unit_n_insns[FUNCTION_UNITS_SIZE];
static void
clear_units ()
{
- bzero ((char *) unit_last_insn, sizeof (unit_last_insn));
- bzero ((char *) unit_tick, sizeof (unit_tick));
- bzero ((char *) unit_n_insns, sizeof (unit_n_insns));
+ zero_memory ((char *) unit_last_insn, sizeof (unit_last_insn));
+ zero_memory ((char *) unit_tick, sizeof (unit_tick));
+ zero_memory ((char *) unit_n_insns, sizeof (unit_n_insns));
}
/* Record an insn as one that will use the units encoded by UNIT. */
@@ -2633,9 +2633,9 @@ schedule_block (b, file)
i = max_reg_num ();
reg_last_uses = (rtx *) alloca (i * sizeof (rtx));
- bzero ((char *) reg_last_uses, i * sizeof (rtx));
+ zero_memory ((char *) reg_last_uses, i * sizeof (rtx));
reg_last_sets = (rtx *) alloca (i * sizeof (rtx));
- bzero ((char *) reg_last_sets, i * sizeof (rtx));
+ zero_memory ((char *) reg_last_sets, i * sizeof (rtx));
reg_pending_sets = ALLOCA_REG_SET ();
CLEAR_REG_SET (reg_pending_sets);
reg_pending_sets_all = 0;
@@ -3132,7 +3132,7 @@ schedule_block (b, file)
/* Q_SIZE will always be zero here. */
q_ptr = 0; clock = 0;
- bzero ((char *) insn_queue, sizeof (insn_queue));
+ zero_memory ((char *) insn_queue, sizeof (insn_queue));
/* Now, perform list scheduling. */
@@ -4258,8 +4258,8 @@ schedule_insns (dump_file)
sched_reg_live_length = (int *) alloca (max_regno * sizeof (int));
bb_dead_regs = ALLOCA_REG_SET ();
bb_live_regs = ALLOCA_REG_SET ();
- bzero ((char *) sched_reg_n_calls_crossed, max_regno * sizeof (int));
- bzero ((char *) sched_reg_live_length, max_regno * sizeof (int));
+ zero_memory ((char *) sched_reg_n_calls_crossed, max_regno * sizeof (int));
+ zero_memory ((char *) sched_reg_live_length, max_regno * sizeof (int));
}
else
{
@@ -4275,9 +4275,9 @@ schedule_insns (dump_file)
rtx line;
line_note = (rtx *) xmalloc (max_uid * sizeof (rtx));
- bzero ((char *) line_note, max_uid * sizeof (rtx));
+ zero_memory ((char *) line_note, max_uid * sizeof (rtx));
line_note_head = (rtx *) alloca (n_basic_blocks * sizeof (rtx));
- bzero ((char *) line_note_head, n_basic_blocks * sizeof (rtx));
+ zero_memory ((char *) line_note_head, n_basic_blocks * sizeof (rtx));
/* Determine the line-number at the start of each basic block.
This must be computed and saved now, because after a basic block's
@@ -4293,13 +4293,13 @@ schedule_insns (dump_file)
}
}
- bzero ((char *) insn_luid, max_uid * sizeof (int));
- bzero ((char *) insn_priority, max_uid * sizeof (int));
- bzero ((char *) insn_tick, max_uid * sizeof (int));
- bzero ((char *) insn_costs, max_uid * sizeof (short));
- bzero ((char *) insn_units, max_uid * sizeof (short));
- bzero ((char *) insn_blockage, max_uid * sizeof (unsigned int));
- bzero ((char *) insn_ref_count, max_uid * sizeof (int));
+ zero_memory ((char *) insn_luid, max_uid * sizeof (int));
+ zero_memory ((char *) insn_priority, max_uid * sizeof (int));
+ zero_memory ((char *) insn_tick, max_uid * sizeof (int));
+ zero_memory ((char *) insn_costs, max_uid * sizeof (short));
+ zero_memory ((char *) insn_units, max_uid * sizeof (short));
+ zero_memory ((char *) insn_blockage, max_uid * sizeof (unsigned int));
+ zero_memory ((char *) insn_ref_count, max_uid * sizeof (int));
/* Schedule each basic block, block by block. */
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 94090e6..828e371 100755
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1283,7 +1283,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (p != constraint)
{
j = *p;
- bcopy (constraint, constraint+1, p-constraint);
+ copy_memory (constraint, constraint+1, p-constraint);
*constraint = j;
warning ("output constraint `%c' for operand %d is not at the beginning", j, i);
@@ -4784,7 +4784,7 @@ check_for_full_enumeration_handling (type)
{
long i;
tree v = TYPE_VALUES (type);
- bzero (cases_seen, bytes_needed);
+ zero_memory (cases_seen, bytes_needed);
/* The time complexity of this code is normally O(N), where
N being the number of members in the enumerated type.
@@ -5205,7 +5205,7 @@ expand_end_case (orig_index)
ncases = TREE_INT_CST_LOW (range) + 1;
labelvec = (rtx *) alloca (ncases * sizeof (rtx));
- bzero ((char *) labelvec, ncases * sizeof (rtx));
+ zero_memory ((char *) labelvec, ncases * sizeof (rtx));
for (n = thiscase->data.case_stmt.case_list; n; n = n->right)
{
@@ -5349,7 +5349,7 @@ estimate_case_costs (node)
if (cost_table == NULL)
{
cost_table = ((short *) xmalloc (129 * sizeof (short))) + 1;
- bzero ((char *) (cost_table - 1), 129 * sizeof (short));
+ zero_memory ((char *) (cost_table - 1), 129 * sizeof (short));
for (i = 0; i < 128; i++)
{
diff --git a/gcc/stupid.c b/gcc/stupid.c
index 73ec357..e68f239 100755
--- a/gcc/stupid.c
+++ b/gcc/stupid.c
@@ -184,7 +184,7 @@ stupid_life_analysis (f, nregs, file)
current_function_has_computed_jump = 0;
- bzero (regs_ever_live, sizeof regs_ever_live);
+ zero_memory (regs_ever_live, sizeof regs_ever_live);
regs_live = (char *) xmalloc (nregs);
@@ -220,25 +220,25 @@ stupid_life_analysis (f, nregs, file)
/* Allocate tables to record info about regs. */
reg_where_dead = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_where_dead, nregs * sizeof (int));
+ zero_memory ((char *) reg_where_dead, nregs * sizeof (int));
reg_where_born_exact = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_where_born_exact, nregs * sizeof (int));
+ zero_memory ((char *) reg_where_born_exact, nregs * sizeof (int));
reg_where_born_clobber = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_where_born_clobber, nregs * sizeof (int));
+ zero_memory ((char *) reg_where_born_clobber, nregs * sizeof (int));
reg_where_dead_chain = (struct insn_chain **) xmalloc (nregs * sizeof (struct insn_chain *));
- bzero ((char *) reg_where_dead_chain, nregs * sizeof (struct insn_chain *));
+ zero_memory ((char *) reg_where_dead_chain, nregs * sizeof (struct insn_chain *));
reg_order = (int *) xmalloc (nregs * sizeof (int));
- bzero ((char *) reg_order, nregs * sizeof (int));
+ zero_memory ((char *) reg_order, nregs * sizeof (int));
regs_change_size = (char *) xmalloc (nregs * sizeof (char));
- bzero ((char *) regs_change_size, nregs * sizeof (char));
+ zero_memory ((char *) regs_change_size, nregs * sizeof (char));
regs_crosses_setjmp = (char *) xmalloc (nregs * sizeof (char));
- bzero ((char *) regs_crosses_setjmp, nregs * sizeof (char));
+ zero_memory ((char *) regs_crosses_setjmp, nregs * sizeof (char));
/* Allocate the reg_renumber array */
allocate_reg_info (max_regno, FALSE, TRUE);
@@ -248,7 +248,7 @@ stupid_life_analysis (f, nregs, file)
after_insn_hard_regs
= (HARD_REG_SET *) xmalloc (max_suid * sizeof (HARD_REG_SET));
- bzero ((char *) after_insn_hard_regs, max_suid * sizeof (HARD_REG_SET));
+ zero_memory ((char *) after_insn_hard_regs, max_suid * sizeof (HARD_REG_SET));
/* Allocate and zero out many data structures
that will record the data from lifetime analysis. */
@@ -258,7 +258,7 @@ stupid_life_analysis (f, nregs, file)
for (i = 0; i < max_regno; i++)
REG_N_DEATHS (i) = 1;
- bzero (regs_live, nregs);
+ zero_memory (regs_live, nregs);
/* Find where each pseudo register is born and dies,
by scanning all insns from the end to the start
diff --git a/gcc/system.h b/gcc/system.h
index eeec775..58b2e9c 100755
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -118,18 +118,7 @@ Boston, MA 02111-1307, USA. */
extern int errno;
#endif
-#ifdef STRING_WITH_STRINGS
-# include <string.h>
-# include <strings.h>
-#else
-# ifdef HAVE_STRING_H
-# include <string.h>
-# else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
-# endif
-#endif
+#include <string.h>
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
@@ -212,57 +201,9 @@ extern int errno;
#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
#endif
+#define copy_memory(src,dst,len) memcpy((dst),(src),(len))
-
-#ifndef bcopy
-# ifdef HAVE_BCOPY
-# ifdef NEED_DECLARATION_BCOPY
-extern void bcopy ();
-# endif
-# else /* ! HAVE_BCOPY */
-# define bcopy(src,dst,len) memcpy ((dst),(src),(len))
-# endif
-#endif
-
-#ifndef bcmp
-# ifdef HAVE_BCMP
-# ifdef NEED_DECLARATION_BCMP
-extern int bcmp ();
-# endif
-# else /* ! HAVE_BCMP */
-# define bcmp(left,right,len) memcmp ((left),(right),(len))
-# endif
-#endif
-
-#ifndef bzero
-# ifdef HAVE_BZERO
-# ifdef NEED_DECLARATION_BZERO
-extern void bzero ();
-# endif
-# else /* ! HAVE_BZERO */
-# define bzero(dst,len) memset ((dst),0,(len))
-# endif
-#endif
-
-#ifndef index
-# ifdef HAVE_INDEX
-# ifdef NEED_DECLARATION_INDEX
-extern char *index ();
-# endif
-# else /* ! HAVE_INDEX */
-# define index strchr
-# endif
-#endif
-
-#ifndef rindex
-# ifdef HAVE_RINDEX
-# ifdef NEED_DECLARATION_RINDEX
-extern char *rindex ();
-# endif
-# else /* ! HAVE_RINDEX */
-# define rindex strrchr
-# endif
-#endif
+#define zero_memory(dst,len) memset((dst),0,(len))
#ifdef NEED_DECLARATION_ATOF
extern double atof ();
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/bcopy.c b/gcc/testsuite/gcc.c-torture/unsorted/bcopy.c
index 1732b34..980de97 100755
--- a/gcc/testsuite/gcc.c-torture/unsorted/bcopy.c
+++ b/gcc/testsuite/gcc.c-torture/unsorted/bcopy.c
@@ -60,5 +60,5 @@ main ()
int i;
for (i = 1; i < 67108864 / BYTES; i++)
- bcopy (s, d, BYTES);
+ copy_memory (s, d, BYTES);
}
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/memtst.c b/gcc/testsuite/gcc.c-torture/unsorted/memtst.c
index b5ef260..104a974 100755
--- a/gcc/testsuite/gcc.c-torture/unsorted/memtst.c
+++ b/gcc/testsuite/gcc.c-torture/unsorted/memtst.c
@@ -18,7 +18,7 @@ main ()
{
int a[SIZE];
int i;
- bzero (a, SIZE * 4);
+ zero_memory (a, SIZE * 4);
for (i = 0; i < 100; i++)
{
memtst (a, SIZE);
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 6780337..d8e54cd 100755
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2199,7 +2199,7 @@ set_float_handler (handler)
{
float_handled = (handler != 0);
if (handler)
- bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
+ copy_memory ((char *) handler, (char *) float_handler, sizeof (float_handler));
if (float_handled && ! float_handler_set)
{
@@ -2237,7 +2237,7 @@ pop_float_handler (handled, handler)
{
float_handled = handled;
if (handled)
- bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
+ copy_memory ((char *) handler, (char *) float_handler, sizeof (float_handler));
}
/* Handler for SIGPIPE. */
diff --git a/gcc/tree.c b/gcc/tree.c
index 9172a4b..ca7b3db 100755
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -297,7 +297,7 @@ init_obstacks ()
rtl_obstack = saveable_obstack = &permanent_obstack;
/* Init the hash table of identifiers. */
- bzero ((char *) hash_table, sizeof hash_table);
+ zero_memory ((char *) hash_table, sizeof hash_table);
}
void
@@ -713,7 +713,7 @@ perm_calloc (nelem, size)
long size;
{
char *rval = (char *) obstack_alloc (&permanent_obstack, nelem * size);
- bzero (rval, nelem * size);
+ zero_memory (rval, nelem * size);
return rval;
}
@@ -1070,7 +1070,7 @@ make_node (code)
}
t = (tree) obstack_alloc (obstack, length);
- bzero (t, length);
+ zero_memory (t, length);
#ifdef GATHER_STATISTICS
tree_node_counts[(int)kind]++;
@@ -1268,7 +1268,7 @@ get_identifier (text)
for (idp = hash_table[hi]; idp; idp = TREE_CHAIN (idp))
if (IDENTIFIER_LENGTH (idp) == len
&& IDENTIFIER_POINTER (idp)[0] == text[0]
- && !bcmp (IDENTIFIER_POINTER (idp), text, len))
+ && !memcmp (IDENTIFIER_POINTER (idp), text, len))
return idp; /* <-- return if found */
/* Not found; optionally warn about a similar identifier */
@@ -1331,7 +1331,7 @@ maybe_get_identifier (text)
for (idp = hash_table[hi]; idp; idp = TREE_CHAIN (idp))
if (IDENTIFIER_LENGTH (idp) == len
&& IDENTIFIER_POINTER (idp)[0] == text[0]
- && !bcmp (IDENTIFIER_POINTER (idp), text, len))
+ && !memcmp (IDENTIFIER_POINTER (idp), text, len))
return idp; /* <-- return if found */
return NULL_TREE;
@@ -1551,7 +1551,7 @@ make_tree_vec (len)
#endif
t = (tree) obstack_alloc (obstack, length);
- bzero (t, length);
+ zero_memory (t, length);
TREE_SET_CODE (t, TREE_VEC);
TREE_VEC_LENGTH (t) = len;
@@ -3058,7 +3058,7 @@ build1 (code, type, node)
length = sizeof (struct tree_exp);
t = (tree) obstack_alloc (obstack, length);
- bzero (t, length);
+ zero_memory (t, length);
#ifdef GATHER_STATISTICS
tree_node_counts[(int)kind]++;
@@ -3968,7 +3968,7 @@ simple_cst_equal (t1, t2)
case STRING_CST:
return TREE_STRING_LENGTH (t1) == TREE_STRING_LENGTH (t2)
- && !bcmp (TREE_STRING_POINTER (t1), TREE_STRING_POINTER (t2),
+ && !memcmp (TREE_STRING_POINTER (t1), TREE_STRING_POINTER (t2),
TREE_STRING_LENGTH (t1));
case CONSTRUCTOR:
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 934aa9b..32d1c13 100755
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -693,7 +693,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
map->label_map = (rtx *) alloca (max_labelno * sizeof (rtx));
local_label = (char *) alloca (max_labelno);
- bzero (local_label, max_labelno);
+ zero_memory (local_label, max_labelno);
}
else
map->label_map = 0;
@@ -768,16 +768,16 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
to access the splittable_regs[] and addr_combined_regs[] arrays. */
splittable_regs = (rtx *) alloca (maxregnum * sizeof (rtx));
- bzero ((char *) splittable_regs, maxregnum * sizeof (rtx));
+ zero_memory ((char *) splittable_regs, maxregnum * sizeof (rtx));
derived_regs = alloca (maxregnum);
- bzero (derived_regs, maxregnum);
+ zero_memory (derived_regs, maxregnum);
splittable_regs_updates = (int *) alloca (maxregnum * sizeof (int));
- bzero ((char *) splittable_regs_updates, maxregnum * sizeof (int));
+ zero_memory ((char *) splittable_regs_updates, maxregnum * sizeof (int));
addr_combined_regs
= (struct induction **) alloca (maxregnum * sizeof (struct induction *));
- bzero ((char *) addr_combined_regs, maxregnum * sizeof (struct induction *));
+ zero_memory ((char *) addr_combined_regs, maxregnum * sizeof (struct induction *));
local_regno = (char *) alloca (maxregnum);
- bzero (local_regno, maxregnum);
+ zero_memory (local_regno, maxregnum);
/* Mark all local registers, i.e. the ones which are referenced only
inside the loop. */
@@ -1048,9 +1048,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
emit_label_after (labels[unroll_number - i],
PREV_INSN (loop_start));
- bzero ((char *) map->insn_map, max_insnno * sizeof (rtx));
- bzero ((char *) map->const_equiv_map, maxregnum * sizeof (rtx));
- bzero ((char *) map->const_age_map,
+ zero_memory ((char *) map->insn_map, max_insnno * sizeof (rtx));
+ zero_memory ((char *) map->const_equiv_map, maxregnum * sizeof (rtx));
+ zero_memory ((char *) map->const_age_map,
maxregnum * sizeof (unsigned));
map->const_age = 0;
@@ -1205,9 +1205,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
for (i = 0; i < unroll_number; i++)
{
- bzero ((char *) map->insn_map, max_insnno * sizeof (rtx));
- bzero ((char *) map->const_equiv_map, new_maxregnum * sizeof (rtx));
- bzero ((char *) map->const_age_map, new_maxregnum * sizeof (unsigned));
+ zero_memory ((char *) map->insn_map, max_insnno * sizeof (rtx));
+ zero_memory ((char *) map->const_equiv_map, new_maxregnum * sizeof (rtx));
+ zero_memory ((char *) map->const_age_map, new_maxregnum * sizeof (unsigned));
map->const_age = 0;
for (j = 0; j < max_labelno; j++)
diff --git a/gcc/unroll_991002.c b/gcc/unroll_991002.c
index 8482888..431c0dc 100755
--- a/gcc/unroll_991002.c
+++ b/gcc/unroll_991002.c
@@ -692,7 +692,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
map->label_map = (rtx *) alloca (max_labelno * sizeof (rtx));
local_label = (char *) alloca (max_labelno);
- bzero (local_label, max_labelno);
+ zero_memory (local_label, max_labelno);
}
else
map->label_map = 0;
@@ -764,16 +764,16 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
to access the splittable_regs[] and addr_combined_regs[] arrays. */
splittable_regs = (rtx *) alloca (maxregnum * sizeof (rtx));
- bzero ((char *) splittable_regs, maxregnum * sizeof (rtx));
+ zero_memory ((char *) splittable_regs, maxregnum * sizeof (rtx));
derived_regs = alloca (maxregnum);
- bzero (derived_regs, maxregnum);
+ zero_memory (derived_regs, maxregnum);
splittable_regs_updates = (int *) alloca (maxregnum * sizeof (int));
- bzero ((char *) splittable_regs_updates, maxregnum * sizeof (int));
+ zero_memory ((char *) splittable_regs_updates, maxregnum * sizeof (int));
addr_combined_regs
= (struct induction **) alloca (maxregnum * sizeof (struct induction *));
- bzero ((char *) addr_combined_regs, maxregnum * sizeof (struct induction *));
+ zero_memory ((char *) addr_combined_regs, maxregnum * sizeof (struct induction *));
local_regno = (char *) alloca (maxregnum);
- bzero (local_regno, maxregnum);
+ zero_memory (local_regno, maxregnum);
/* Mark all local registers, i.e. the ones which are referenced only
inside the loop. */
@@ -1044,9 +1044,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
emit_label_after (labels[unroll_number - i],
PREV_INSN (loop_start));
- bzero ((char *) map->insn_map, max_insnno * sizeof (rtx));
- bzero ((char *) map->const_equiv_map, maxregnum * sizeof (rtx));
- bzero ((char *) map->const_age_map,
+ zero_memory ((char *) map->insn_map, max_insnno * sizeof (rtx));
+ zero_memory ((char *) map->const_equiv_map, maxregnum * sizeof (rtx));
+ zero_memory ((char *) map->const_age_map,
maxregnum * sizeof (unsigned));
map->const_age = 0;
@@ -1201,9 +1201,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
for (i = 0; i < unroll_number; i++)
{
- bzero ((char *) map->insn_map, max_insnno * sizeof (rtx));
- bzero ((char *) map->const_equiv_map, new_maxregnum * sizeof (rtx));
- bzero ((char *) map->const_age_map, new_maxregnum * sizeof (unsigned));
+ zero_memory ((char *) map->insn_map, max_insnno * sizeof (rtx));
+ zero_memory ((char *) map->const_equiv_map, new_maxregnum * sizeof (rtx));
+ zero_memory ((char *) map->const_age_map, new_maxregnum * sizeof (unsigned));
map->const_age = 0;
for (j = 0; j < max_labelno; j++)
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 231fb00..bddb28d 100755
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1575,7 +1575,7 @@ assemble_name (file, name)
STRIP_NAME_ENCODING (real_name, name);
if (flag_prefix_function_name
- && ! bcmp (real_name, CHKR_PREFIX, CHKR_PREFIX_SIZE))
+ && ! memcmp (real_name, CHKR_PREFIX, CHKR_PREFIX_SIZE))
real_name = real_name + CHKR_PREFIX_SIZE;
id = maybe_get_identifier (real_name);
@@ -1777,7 +1777,7 @@ assemble_real (d, mode)
{
error ("floating point trap outputting a constant");
#ifdef REAL_IS_NOT_DOUBLE
- bzero ((char *) &d, sizeof d);
+ zero_memory ((char *) &d, sizeof d);
d = dconst0;
#else
d = 0;
@@ -1992,7 +1992,7 @@ immed_real_const_1 (d, mode)
If one is found, return it. */
for (r = const_double_chain; r; r = CONST_DOUBLE_CHAIN (r))
- if (! bcmp ((char *) &CONST_DOUBLE_LOW (r), (char *) &u, sizeof u)
+ if (! memcmp ((char *) &CONST_DOUBLE_LOW (r), (char *) &u, sizeof u)
&& GET_MODE (r) == mode)
return r;
@@ -2008,7 +2008,7 @@ immed_real_const_1 (d, mode)
rtl_in_saveable_obstack ();
r = rtx_alloc (CONST_DOUBLE);
PUT_MODE (r, mode);
- bcopy ((char *) &u, (char *) &CONST_DOUBLE_LOW (r), sizeof u);
+ copy_memory ((char *) &u, (char *) &CONST_DOUBLE_LOW (r), sizeof u);
pop_obstacks ();
/* Don't touch const_double_chain in nested function; see force_const_mem.
@@ -2334,7 +2334,7 @@ compare_constant_1 (exp, p)
strp = TREE_STRING_POINTER (exp);
len = TREE_STRING_LENGTH (exp);
- if (bcmp ((char *) &TREE_STRING_LENGTH (exp), p,
+ if (memcmp ((char *) &TREE_STRING_LENGTH (exp), p,
sizeof TREE_STRING_LENGTH (exp)))
return 0;
@@ -2355,7 +2355,7 @@ compare_constant_1 (exp, p)
strp = (char *) alloca (len);
get_set_constructor_bytes (exp, (unsigned char *) strp, len);
- if (bcmp ((char *) &xlen, p, sizeof xlen))
+ if (memcmp ((char *) &xlen, p, sizeof xlen))
return 0;
p += sizeof xlen;
@@ -2372,7 +2372,7 @@ compare_constant_1 (exp, p)
if (TREE_PURPOSE (link))
have_purpose = 1;
- if (bcmp ((char *) &length, p, sizeof length))
+ if (memcmp ((char *) &length, p, sizeof length))
return 0;
p += sizeof length;
@@ -2386,12 +2386,12 @@ compare_constant_1 (exp, p)
else
type = 0;
- if (bcmp ((char *) &type, p, sizeof type))
+ if (memcmp ((char *) &type, p, sizeof type))
return 0;
p += sizeof type;
- if (bcmp ((char *) &have_purpose, p, sizeof have_purpose))
+ if (memcmp ((char *) &have_purpose, p, sizeof have_purpose))
return 0;
p += sizeof have_purpose;
@@ -2401,7 +2401,7 @@ compare_constant_1 (exp, p)
{
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
- if (bcmp ((char *) &size, p, sizeof size))
+ if (memcmp ((char *) &size, p, sizeof size))
return 0;
p += sizeof size;
@@ -2418,7 +2418,7 @@ compare_constant_1 (exp, p)
{
tree zero = 0;
- if (bcmp ((char *) &zero, p, sizeof zero))
+ if (memcmp ((char *) &zero, p, sizeof zero))
return 0;
p += sizeof zero;
@@ -2427,7 +2427,7 @@ compare_constant_1 (exp, p)
if (TREE_PURPOSE (link)
&& TREE_CODE (TREE_PURPOSE (link)) == FIELD_DECL)
{
- if (bcmp ((char *) &TREE_PURPOSE (link), p,
+ if (memcmp ((char *) &TREE_PURPOSE (link), p,
sizeof TREE_PURPOSE (link)))
return 0;
@@ -2442,7 +2442,7 @@ compare_constant_1 (exp, p)
{
int zero = 0;
- if (bcmp ((char *) &zero, p, sizeof zero))
+ if (memcmp ((char *) &zero, p, sizeof zero))
return 0;
p += sizeof zero;
@@ -3044,9 +3044,9 @@ init_const_rtx_hash_table ()
const_rtx_sym_hash_table
= ((struct pool_sym **)
oballoc (MAX_RTX_HASH_TABLE * sizeof (struct pool_sym *)));
- bzero ((char *) const_rtx_hash_table,
+ zero_memory ((char *) const_rtx_hash_table,
MAX_RTX_HASH_TABLE * sizeof (struct constant_descriptor *));
- bzero ((char *) const_rtx_sym_hash_table,
+ zero_memory ((char *) const_rtx_sym_hash_table,
MAX_RTX_HASH_TABLE * sizeof (struct pool_sym *));
first_pool = last_pool = 0;
@@ -3131,7 +3131,7 @@ decode_rtx_const (mode, x, value)
if (GET_MODE (x) != VOIDmode)
{
value->mode = GET_MODE (x);
- bcopy ((char *) &CONST_DOUBLE_LOW (x),
+ copy_memory ((char *) &CONST_DOUBLE_LOW (x),
(char *) &value->un.du, sizeof value->un.du);
}
else
@@ -3556,7 +3556,7 @@ output_constant_pool (fnname, fndecl)
if (GET_CODE (x) != CONST_DOUBLE)
abort ();
- bcopy ((char *) &CONST_DOUBLE_LOW (x), (char *) &u, sizeof u);
+ copy_memory ((char *) &CONST_DOUBLE_LOW (x), (char *) &u, sizeof u);
assemble_real (u.d, pool->mode);
break;
diff --git a/gcc/varray.c b/gcc/varray.c
index 80f15b2..b214261 100755
--- a/gcc/varray.c
+++ b/gcc/varray.c
@@ -63,7 +63,7 @@ varray_grow (va, n)
va = (varray_type) xrealloc ((char *)va, VARRAY_HDR_SIZE + data_size);
va->num_elements = n;
if (n > old_elements)
- bzero (&va->data.c[old_data_size], data_size - old_data_size);
+ zero_memory (&va->data.c[old_data_size], data_size - old_data_size);
}
return va;