aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>2000-08-24 20:31:35 +0000
committerGreg McGary <gkm@gcc.gnu.org>2000-08-24 20:31:35 +0000
commitb6a1cbaeb19076fca9b0deb00138fedf0c8c36ff (patch)
tree598c21af74eb9deec6a463196f439a03d7a53b91 /gcc/config
parent2f26c11dbb2d0f1e37f16120c455147a00dff716 (diff)
downloadgcc-b6a1cbaeb19076fca9b0deb00138fedf0c8c36ff.zip
gcc-b6a1cbaeb19076fca9b0deb00138fedf0c8c36ff.tar.gz
gcc-b6a1cbaeb19076fca9b0deb00138fedf0c8c36ff.tar.bz2
optabs.c (init_optabs): Initialize fixtab...
* optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/arm/arm.c2
-rw-r--r--gcc/config/fr30/fr30.c2
-rw-r--r--gcc/config/i386/dgux.c4
-rw-r--r--gcc/config/i386/dgux.h6
-rw-r--r--gcc/config/m88k/m88k.c2
-rw-r--r--gcc/config/m88k/m88k.h4
-rw-r--r--gcc/config/mcore/mcore.c6
-rw-r--r--gcc/config/mips/mips.c9
-rw-r--r--gcc/config/rs6000/rs6000.c4
-rw-r--r--gcc/config/sparc/sparc.c6
11 files changed, 21 insertions, 26 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 99535ab..ef6845b 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1988,7 +1988,7 @@ alpha_lookup_xfloating_lib_func (code)
};
const struct xfloating_op *ops;
- const long n = sizeof(osf_xfloating_ops) / sizeof(osf_xfloating_ops[0]);
+ const long n = ARRAY_SIZE (osf_xfloating_ops);
long i;
/* How irritating. Nothing to key off for the table. Hardcode
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 4c7679a..6abe732 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -317,7 +317,7 @@ arm_override_options ()
unsigned i;
/* Set up the flags based on the cpu/architecture selected by the user. */
- for (i = sizeof (arm_select) / sizeof (arm_select[0]); i--;)
+ for (i = ARRAY_SIZE (arm_select); i--;)
{
struct arm_cpu_select * ptr = arm_select + i;
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index 68bae05..c2ee005 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -575,7 +575,7 @@ fr30_print_operand (file, x, code)
switch (GET_CODE (x0))
{
case REG:
- if ((unsigned) REGNO (x0) >= (sizeof (reg_names) / sizeof (reg_names[0])))
+ if ((unsigned) REGNO (x0) >= ARRAY_SIZE (reg_names))
abort ();
fprintf (file, "@%s", reg_names [REGNO (x0)]);
break;
diff --git a/gcc/config/i386/dgux.c b/gcc/config/i386/dgux.c
index 915719d..069a7ac 100644
--- a/gcc/config/i386/dgux.c
+++ b/gcc/config/i386/dgux.c
@@ -1,5 +1,5 @@
/* Subroutines for GNU compiler for Intel 80x86 running DG/ux
- Copyright (C) 1993, 1995, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1997, 1999, 2000 Free Software Foundation, Inc.
Currently maintained by (gcc@dg-rtp.dg.com)
This file is part of GNU CC.
@@ -90,7 +90,7 @@ output_options (file, f_options, f_len, W_options, W_len,
pos = output_option (file, sep, "-W", W_options[j].string,
indent, pos, max);
- for (j = 0; j < sizeof m_options / sizeof m_options[0]; j++)
+ for (j = 0; j < ARRAY_SIZE (m_options); j++)
if (m_options[j].name[0] != '\0'
&& m_options[j].value > 0
&& ((m_options[j].value & target_flags)
diff --git a/gcc/config/i386/dgux.h b/gcc/config/i386/dgux.h
index 5b0ca5f..10982c5 100644
--- a/gcc/config/i386/dgux.h
+++ b/gcc/config/i386/dgux.h
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
#include "i386/sysv4.h"
#ifndef VERSION_INFO2
-#define VERSION_INFO2 "$Revision: 1.9 $"
+#define VERSION_INFO2 "$Revision: 1.10 $"
#endif
#ifndef VERSION_STRING
@@ -85,8 +85,8 @@ Boston, MA 02111-1307, USA. */
/* Override svr[34].h. */
#undef ASM_FILE_START
#define ASM_FILE_START(FILE) \
- output_file_start (FILE, f_options, sizeof f_options / sizeof f_options[0], \
- W_options, sizeof W_options / sizeof W_options[0])
+ output_file_start (FILE, f_options, ARRAY_SIZE (f_options), \
+ W_options, ARRAY_SIZE (W_options))
/* ix86 abi specified type for wchar_t */
diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c
index ab79bf0..86c92e7 100644
--- a/gcc/config/m88k/m88k.c
+++ b/gcc/config/m88k/m88k.c
@@ -1544,7 +1544,7 @@ output_options (file, f_options, f_len, W_options, W_len,
pos = output_option (file, sep, "-W", W_options[j].string,
indent, pos, max);
- for (j = 0; j < (long) (sizeof m_options / sizeof m_options[0]); j++)
+ for (j = 0; j < (long) ARRAY_SIZE (m_options); j++)
if (m_options[j].name[0] != '\0'
&& m_options[j].value > 0
&& ((m_options[j].value & target_flags)
diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h
index ca2d0f7..1412ff2 100644
--- a/gcc/config/m88k/m88k.h
+++ b/gcc/config/m88k/m88k.h
@@ -1818,9 +1818,9 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
#define ASM_FILE_START(FILE) \
output_file_start (FILE, \
(struct m88k_lang_independent_options *) f_options, \
- sizeof f_options / sizeof f_options[0], \
+ ARRAY_SIZE (f_options), \
(struct m88k_lang_independent_options *) W_options, \
- sizeof W_options / sizeof W_options[0])
+ ARRAY_SIZE (W_options))
#undef ASM_FILE_END
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 4622ade..8dbcb2b 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -1158,7 +1158,7 @@ mcore_output_inline_const_forced (insn, operands, mode)
if (mcore_const_ok_for_inline (value))
return output_inline_const (SImode, operands);
- for (i = 0; (unsigned) i < sizeof (part) / sizeof (part[0]); i++)
+ for (i = 0; (unsigned) i < ARRAY_SIZE (part); i++)
{
part[i].shift = 0;
part[i].low = (value & 0x1F);
@@ -1990,7 +1990,7 @@ layout_mcore_frame (infp)
(1) run fast,
(2) reduce instruction space, or
(3) reduce stack space. */
- for (i = 0; i < sizeof (infp->growth) / sizeof (infp->growth[0]); i++)
+ for (i = 0; i < ARRAY_SIZE (infp->growth); i++)
infp->growth[i] = 0;
regarg = infp->reg_size + infp->arg_size;
@@ -3139,7 +3139,7 @@ handle_structs_in_regs (mode, type, reg)
}
/* We assume here that NPARM_REGS == 6. The assert checks this. */
- assert (sizeof (arg_regs) / sizeof (arg_regs[0]) == 6);
+ assert (ARRAY_SIZE (arg_regs) == 6);
rtvec = gen_rtvec (nregs, arg_regs[0], arg_regs[1], arg_regs[2],
arg_regs[3], arg_regs[4], arg_regs[5]);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 629fac1..f059ddd 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -3417,10 +3417,7 @@ output_block_move (insn, operands, num_regs, move_type)
/* ??? Detect a bug in GCC, where it can give us a register
the same as one of the addressing registers and reduce
the number of registers available. */
- for (i = 4;
- i < last_operand
- && safe_regs < (int)(sizeof(xoperands) / sizeof(xoperands[0]));
- i++)
+ for (i = 4; i < last_operand && safe_regs < (int) ARRAY_SIZE (xoperands); i++)
if (! reg_mentioned_p (operands[i], operands[0])
&& ! reg_mentioned_p (operands[i], operands[1]))
xoperands[safe_regs++] = operands[i];
@@ -3515,8 +3512,8 @@ output_block_move (insn, operands, num_regs, move_type)
}
}
- if (num_regs > (int)(sizeof (load_store) / sizeof (load_store[0])))
- num_regs = sizeof (load_store) / sizeof (load_store[0]);
+ if (num_regs > (int) ARRAY_SIZE (load_store))
+ num_regs = ARRAY_SIZE (load_store);
else if (num_regs < 1)
abort_with_insn (insn,
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 9e4c11f..18106cb 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -293,7 +293,7 @@ rs6000_override_options (default_cpu)
rs6000_select[0].string = default_cpu;
rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT;
- for (i = 0; i < sizeof (rs6000_select) / sizeof (rs6000_select[0]); i++)
+ for (i = 0; i < ARRAY_SIZE (rs6000_select); i++)
{
ptr = &rs6000_select[i];
if (ptr->string != (char *)0 && ptr->string[0] != '\0')
@@ -433,7 +433,7 @@ rs6000_file_start (file, default_cpu)
sprintf (buffer, "\n%s rs6000/powerpc options:", ASM_COMMENT_START);
rs6000_select[0].string = default_cpu;
- for (i = 0; i < sizeof (rs6000_select) / sizeof (rs6000_select[0]); i++)
+ for (i = 0; i < ARRAY_SIZE (rs6000_select); i++)
{
ptr = &rs6000_select[i];
if (ptr->string != (char *)0 && ptr->string[0] != '\0')
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index f6a354d..82e9a74 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -8569,8 +8569,6 @@ sparc_add_gc_roots ()
ggc_add_rtx_root (&get_pc_symbol, 1);
ggc_add_rtx_root (&sparc_addr_diff_list, 1);
ggc_add_rtx_root (&sparc_addr_list, 1);
- ggc_add_root (ultra_pipe_hist,
- sizeof (ultra_pipe_hist) / sizeof (ultra_pipe_hist[0]),
- sizeof (ultra_pipe_hist[0]),
- &mark_ultrasparc_pipeline_state);
+ ggc_add_root (ultra_pipe_hist, ARRAY_SIZE (ultra_pipe_hist),
+ sizeof (ultra_pipe_hist[0]), &mark_ultrasparc_pipeline_state);
}