+2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (expand_builtin_setjmp_receiver): Const-ify.
+ * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length):
+ Likewise.
+ * c-dump.c (dump_option_value_info): Likewise.
+ * c-format.c (format_length_info, format_char_info,
+ format_flag_spec, format_flag_pair, format_kind_info): Likewise.
+ * collect2.c (names): Likewise.
+ * cppdefault.h (default_include): Likewise.
+ * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise.
+ * flow.c (life_analysis): Likewise.
+ * gcc.c (dir_separator_str, modify_target, option_map,
+ target_option_translations, spec_list_1, extra_specs_1,
+ init_spec): Likewise.
+ * gcov.c (gcov_version_string): Likewise.
+ * genattr.c (write_units): Likewise.
+ * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise.
+ * gengenrtl.c (rtx_definition, defs): Likewise.
+ * genrecog.c (pred_table): Likewise.
+ * global.c (global_alloc): Likewise.
+ * lcm.c (optimize_mode_switching): Likewise.
+ * local-alloc.c (find_free_reg): Likewise.
+ * params.h (param_info): Likewise.
+ * predict.c (predictor_info): Likewise.
+ * protoize.c (unexpansion_struct): Likewise.
+ * real.c (bmask): Likewise.
+ * recog.h (insn_operand_data, insn_data): Likewise.
+ * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise.
+ * stmt.c (expand_nl_goto_receiver): Likewise.
+ * toplev.c (da, debug_args, lang_opt, documented_lang_options,
+ target_switches, target_options): Likewise.
+ * tradcif.y (token, tokentab2, yylex): Likewise.
+ * tree.h (attribute_spec): Likewise.
+
+ * alpha.c (override_options, alpha_lookup_xfloating_lib_func):
+ Likewise.
+ * arc.c (arc_output_function_epilogue): Likewise.
+ * arm.c (processors, all_cores, all_architectures,
+ arm_override_options, isr_attribute_arg, isr_attribute_args,
+ arm_isr_value): Likewise.
+ * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc):
+ Likewise.
+ * c4x.c (c4x_int_reglist): Likewise.
+ * d30v.c (override_options): Likewise.
+ * h8300.c (shift_insn): Likewise.
+ * i386.c (size_cost, i386_cost, i486_cost, pentium_cost,
+ pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost,
+ ix86_expand_sse_comi, ix86_expand_sse_compare, override_options,
+ builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg,
+ ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise.
+ * i386.h (processor_costs, ix86_cost): Likewise.
+ * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise.
+ * m68hc11.h (processor_costs, m68hc11_cost): Likewise.
+ * m68k.c (codes_68881, codes_FPA): Likewise.
+ * m88k.c (mode_from_align, max_from_align, all_from_align,
+ best_from_align, m_options): Likewise.
+ * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise.
+ * mcore.c (mode_from_align): Likewise.
+ * mips/elf64.h (UNIQUE_SECTION): Likewise.
+ * mips/iris6gld.h (UNIQUE_SECTION): Likewise.
+ * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise.
+ * mips.h (mips_regno_to_class): Likewise.
+ * ns32k.c (scales): Likewise.
+ * pa.c (import_string, magic_milli): Likewise.
+ * rs6000.c (alt_reg_names, rs6000_override_options): Likewise.
+ * sparc.c (leaf_reg_remap, sparc_override_options,
+ reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders):
+ Likewise.
+ * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise.
+
2001-10-07 Dale Johannesen <dalej@apple.com>
* reload1.c (reload_reg_free_p): Teach register interference
{
#ifdef ELIMINABLE_REGS
size_t i;
- static struct elims {int from, to;} elim_regs[] = ELIMINABLE_REGS;
+ static const struct elims {const int from, to;} elim_regs[] = ELIMINABLE_REGS;
for (i = 0; i < ARRAY_SIZE (elim_regs); i++)
if (elim_regs[i].from == ARG_POINTER_REGNUM
/* Information about how a function name is generated. */
struct fname_var_t
{
- tree *decl; /* pointer to the VAR_DECL. */
- unsigned rid; /* RID number for the identifier. */
- int pretty; /* How pretty is it? */
+ tree *const decl; /* pointer to the VAR_DECL. */
+ const unsigned rid; /* RID number for the identifier. */
+ const int pretty; /* How pretty is it? */
};
/* The three ways of getting then name of the current function. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-static char c_tree_code_type[] = {
+static const char c_tree_code_type[] = {
'x',
#include "c-common.def"
};
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-static int c_tree_code_length[] = {
+static const int c_tree_code_length[] = {
0,
#include "c-common.def"
};
/* Define a name->number mapping for a dump flag value. */
struct dump_option_value_info
{
- const char *name; /* the name of the value */
- int value; /* the value of the name */
+ const char *const name; /* the name of the value */
+ const int value; /* the value of the name */
};
/* Table of dump options. This must be consistent with the TDF_* flags
typedef struct
{
/* Name of the single-character length modifier. */
- const char *name;
+ const char *const name;
/* Index into a format_char_info.types array. */
- enum format_lengths index;
+ const enum format_lengths index;
/* Standard version this length appears in. */
- enum format_std_version std;
+ const enum format_std_version std;
/* Same, if the modifier can be repeated, or NULL if it can't. */
- const char *double_name;
- enum format_lengths double_index;
- enum format_std_version double_std;
+ const char *const double_name;
+ const enum format_lengths double_index;
+ const enum format_std_version double_std;
} format_length_info;
which act identically), and the length modifiers used with it. */
typedef struct
{
- const char *format_chars;
- int pointer_count;
- enum format_std_version std;
+ const char *const format_chars;
+ const int pointer_count;
+ const enum format_std_version std;
/* Types accepted for each length modifier. */
- format_type_detail types[FMT_LEN_MAX];
+ const format_type_detail types[FMT_LEN_MAX];
/* List of other modifier characters allowed with these specifiers.
This lists flags, and additionally "w" for width, "p" for precision
(right precision, for strfmon), "#" for left precision (strfmon),
"a" for scanf "a" allocation extension (not applicable in C99 mode),
"*" for scanf suppression, and "E" and "O" for those strftime
modifiers. */
- const char *flag_chars;
+ const char *const flag_chars;
/* List of additional flags describing these conversion specifiers.
"c" for generic character pointers being allowed, "2" for strftime
two digit year formats, "3" for strftime formats giving two digit
"R" if the argument is a pointer which is dereferenced and read from,
"i" for printf integer formats where the '0' flag is ignored with
precision, and "[" for the starting character of a scanf scanset. */
- const char *flags2;
+ const char *const flags2;
} format_char_info;
typedef struct
{
/* The flag character in question (0 for end of array). */
- int flag_char;
+ const int flag_char;
/* Zero if this entry describes the flag character in general, or a
non-zero character that may be found in flags2 if it describes the
flag when used with certain formats only. If the latter, only
will be used, if non-NULL and the standard version is higher than
the unpredicated one, for any pedantic warning. For example, 'o'
for strftime formats (meaning 'O' is an extension over C99). */
- int predicate;
+ const int predicate;
/* Nonzero if the next character after this flag in the format should
be skipped ('=' in strfmon), zero otherwise. */
- int skip_next_char;
+ const int skip_next_char;
/* The name to use for this flag in diagnostic messages. For example,
N_("`0' flag"), N_("field width"). */
- const char *name;
+ const char *const name;
/* Long name for this flag in diagnostic messages; currently only used for
"ISO C does not support ...". For example, N_("the `I' printf flag"). */
- const char *long_name;
+ const char *const long_name;
/* The standard version in which it appeared. */
- enum format_std_version std;
+ const enum format_std_version std;
} format_flag_spec;
typedef struct
{
/* The first flag character in question (0 for end of array). */
- int flag_char1;
+ const int flag_char1;
/* The second flag character. */
- int flag_char2;
+ const int flag_char2;
/* Non-zero if the message should say that the first flag is ignored with
the second, zero if the combination should simply be objected to. */
- int ignored;
+ const int ignored;
/* Zero if this entry applies whenever this flag combination occurs,
a non-zero character from flags2 if it only applies in some
circumstances (e.g. 'i' for printf formats ignoring 0 with precision). */
- int predicate;
+ const int predicate;
} format_flag_pair;
{
/* The name of this kind of format, for use in diagnostics. Also
the name of the attribute (without preceding and following __). */
- const char *name;
+ const char *const name;
/* Specifications of the length modifiers accepted; possibly NULL. */
- const format_length_info *length_char_specs;
+ const format_length_info *const length_char_specs;
/* Details of the conversion specification characters accepted. */
- const format_char_info *conversion_specs;
+ const format_char_info *const conversion_specs;
/* String listing the flag characters that are accepted. */
- const char *flag_chars;
+ const char *const flag_chars;
/* String listing modifier characters (strftime) accepted. May be NULL. */
- const char *modifier_chars;
+ const char *const modifier_chars;
/* Details of the flag characters, including pseudo-flags. */
- const format_flag_spec *flag_specs;
+ const format_flag_spec *const flag_specs;
/* Details of bad combinations of flags. */
- const format_flag_pair *bad_flag_pairs;
+ const format_flag_pair *const bad_flag_pairs;
/* Flags applicable to this kind of format. */
- int flags;
+ const int flags;
/* Flag character to treat a width as, or 0 if width not used. */
- int width_char;
+ const int width_char;
/* Flag character to treat a left precision (strfmon) as,
or 0 if left precision not used. */
- int left_precision_char;
+ const int left_precision_char;
/* Flag character to treat a precision (for strfmon, right precision) as,
or 0 if precision not used. */
- int precision_char;
+ const int precision_char;
/* If a flag character has the effect of suppressing the conversion of
an argument ('*' in scanf), that flag character, otherwise 0. */
- int suppression_char;
+ const int suppression_char;
/* Flag character to treat a length modifier as (ignored if length
modifiers not used). Need not be placed in flag_chars for conversion
specifiers, but is used to check for bad combinations such as length
modifier with assignment suppression in scanf. */
- int length_code_char;
+ const int length_code_char;
/* Pointer to type of argument expected if '*' is used for a width,
or NULL if '*' not used for widths. */
- tree *width_type;
+ tree *const width_type;
/* Pointer to type of argument expected if '*' is used for a precision,
or NULL if '*' not used for precisions. */
- tree *precision_type;
+ tree *const precision_type;
} format_kind_info;
#if 0
struct try_type
{
- tree *node_var;
- char unsigned_flag;
- char long_flag;
- char long_long_flag;
+ tree *const node_var;
+ const char unsigned_flag;
+ const char long_flag;
+ const char long_long_flag;
};
struct try_type type_sequence[] =
is_ctor_dtor (s)
const char *s;
{
- struct names { const char *const name; int len; int ret; int two_underscores; };
+ struct names { const char *const name; const int len; const int ret;
+ const int two_underscores; };
register struct names *p;
register int ch;
override_options ()
{
int i;
- static struct cpu_table {
- const char *name;
- enum processor_type processor;
- int flags;
+ static const struct cpu_table {
+ const char *const name;
+ const enum processor_type processor;
+ const int flags;
} cpu_table[] = {
#define EV5_MASK (MASK_CPU_EV5)
#define EV6_MASK (MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX)
{
struct xfloating_op
{
- enum rtx_code code;
- const char *func;
+ const enum rtx_code code;
+ const char *const func;
};
static const struct xfloating_op vms_xfloating_ops[] =
/* Emit the return instruction. */
{
- static int regs[4] = {
+ static const int regs[4] = {
0, RETURN_ADDR_REGNUM, ILINK1_REGNUM, ILINK2_REGNUM
};
fprintf (file, "\tj.d %s\n", reg_names[regs[fn_type]]);
struct processors
{
- const char * name;
- unsigned int flags;
+ const char *const name;
+ const unsigned int flags;
};
/* Not all of these give usefully different compilation alternatives,
but there is no simple way of generalizing them. */
-static struct processors all_cores[] =
+static const struct processors all_cores[] =
{
/* ARM Cores */
{NULL, 0}
};
-static struct processors all_architectures[] =
+static const struct processors all_architectures[] =
{
/* ARM Architectures */
/* If the user did not specify a processor, choose one for them. */
if (insn_flags == 0)
{
- struct processors * sel;
+ const struct processors * sel;
unsigned int sought;
- static struct cpu_default
+ static const struct cpu_default
{
- int cpu;
- const char * name;
+ const int cpu;
+ const char *const name;
}
cpu_defaults[] =
{
{ TARGET_CPU_generic, "arm" },
{ 0, 0 }
};
- struct cpu_default * def;
+ const struct cpu_default * def;
/* Find the default. */
for (def = cpu_defaults; def->name; def++)
if (sel->name == NULL)
{
unsigned int current_bit_count = 0;
- struct processors * best_fit = NULL;
+ const struct processors * best_fit = NULL;
/* Ideally we would like to issue an error message here
saying that it was not possible to find a CPU compatible
typedef struct
{
- const char * arg;
- unsigned long return_value;
+ const char *const arg;
+ const unsigned long return_value;
}
isr_attribute_arg;
-static isr_attribute_arg isr_attribute_args [] =
+static const isr_attribute_arg isr_attribute_args [] =
{
{ "IRQ", ARM_FT_ISR },
{ "irq", ARM_FT_ISR },
arm_isr_value (argument)
tree argument;
{
- isr_attribute_arg * ptr;
+ const isr_attribute_arg * ptr;
const char * arg;
/* No argument - default to IRQ. */
};
struct mcu_type_s {
- const char *name;
- enum avr_arch arch;
+ const char *const name;
+ const enum avr_arch arch;
};
/* List of all known AVR MCU types - if updated, it has to be kept
/* return register class from register number */
-static int reg_class_tab[]={
+static const int reg_class_tab[]={
GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,
GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,
GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,
order_regs_for_local_alloc ()
{
unsigned int i;
- int order_0[] = {
+ static const int order_0[] = {
24,25,
18,19,
20,21,
0,1,
32,33,34,35
};
- int order_1[] = {
+ static const int order_1[] = {
18,19,
20,21,
22,23,
0,1,
32,33,34,35
};
- int order_2[] = {
+ static const int order_2[] = {
25,24,
23,22,
21,20,
32,33,34,35
};
- int *order = (TARGET_ORDER_1 ? order_1 :
- TARGET_ORDER_2 ? order_2 :
- order_0);
+ const int *order = (TARGET_ORDER_1 ? order_1 :
+ TARGET_ORDER_2 ? order_2 :
+ order_0);
for (i=0; i < ARRAY_SIZE (order_0); ++i)
reg_alloc_order[i] = order[i];
}
Don't use R0 to pass arguments in, we use 0 to indicate a stack
argument. */
-static int c4x_int_reglist[3][6] =
+static const int c4x_int_reglist[3][6] =
{
{AR2_REGNO, R2_REGNO, R3_REGNO, RC_REGNO, RS_REGNO, RE_REGNO},
{AR2_REGNO, R3_REGNO, RC_REGNO, RS_REGNO, RE_REGNO, 0},
#if 0
{
- static char *names[] = REG_CLASS_NAMES;
+ static const char *const names[] = REG_CLASS_NAMES;
fprintf (stderr, "Register %s class is %s, can hold modes", reg_names[regno], names[class]);
for (mode1 = VOIDmode;
(int)mode1 < NUM_MACHINE_MODES;
struct shift_insn
{
- const char *assembler;
- int cc_valid;
+ const char *const assembler;
+ const int cc_valid;
};
/* Assembler instruction shift table.
#endif
/* Processor costs (relative to an add) */
+static const
struct processor_costs size_cost = { /* costs for tunning for size */
2, /* cost of an add instruction */
3, /* cost of a lea instruction */
3, /* MMX or SSE register to integer */
};
/* Processor costs (relative to an add) */
+static const
struct processor_costs i386_cost = { /* 386 specific costs */
1, /* cost of an add instruction */
1, /* cost of a lea instruction */
3, /* MMX or SSE register to integer */
};
+static const
struct processor_costs i486_cost = { /* 486 specific costs */
1, /* cost of an add instruction */
1, /* cost of a lea instruction */
3 /* MMX or SSE register to integer */
};
+static const
struct processor_costs pentium_cost = {
1, /* cost of an add instruction */
1, /* cost of a lea instruction */
3 /* MMX or SSE register to integer */
};
+static const
struct processor_costs pentiumpro_cost = {
1, /* cost of an add instruction */
1, /* cost of a lea instruction */
3 /* MMX or SSE register to integer */
};
+static const
struct processor_costs k6_cost = {
1, /* cost of an add instruction */
2, /* cost of a lea instruction */
6 /* MMX or SSE register to integer */
};
+static const
struct processor_costs athlon_cost = {
1, /* cost of an add instruction */
2, /* cost of a lea instruction */
6 /* MMX or SSE register to integer */
};
+static const
struct processor_costs pentium4_cost = {
1, /* cost of an add instruction */
1, /* cost of a lea instruction */
10, /* MMX or SSE register to integer */
};
-struct processor_costs *ix86_cost = &pentium_cost;
+const struct processor_costs *ix86_cost = &pentium_cost;
/* Processor feature/optimization bitmasks. */
#define m_386 (1<<PROCESSOR_I386)
static int ix86_decompose_address PARAMS ((rtx, struct ix86_address *));
struct builtin_description;
-static rtx ix86_expand_sse_comi PARAMS ((struct builtin_description *, tree,
- rtx));
-static rtx ix86_expand_sse_compare PARAMS ((struct builtin_description *, tree,
- rtx));
+static rtx ix86_expand_sse_comi PARAMS ((const struct builtin_description *,
+ tree, rtx));
+static rtx ix86_expand_sse_compare PARAMS ((const struct builtin_description *,
+ tree, rtx));
static rtx ix86_expand_unop1_builtin PARAMS ((enum insn_code, tree, rtx));
static rtx ix86_expand_unop_builtin PARAMS ((enum insn_code, tree, rtx, int));
static rtx ix86_expand_binop_builtin PARAMS ((enum insn_code, tree, rtx));
static struct ptt
{
- struct processor_costs *cost; /* Processor costs */
- int target_enable; /* Target flags to enable. */
- int target_disable; /* Target flags to disable. */
- int align_loop; /* Default alignments. */
- int align_jump;
- int align_func;
- int branch_cost;
+ const struct processor_costs *cost; /* Processor costs */
+ const int target_enable; /* Target flags to enable. */
+ const int target_disable; /* Target flags to disable. */
+ const int align_loop; /* Default alignments. */
+ const int align_jump;
+ const int align_func;
+ const int branch_cost;
}
const processor_target_table[PROCESSOR_max] =
{
static struct pta
{
- const char *name; /* processor name or nickname. */
- enum processor_type processor;
+ const char *const name; /* processor name or nickname. */
+ const enum processor_type processor;
}
const processor_alias_table[] =
{
struct builtin_description
{
- unsigned int mask;
- enum insn_code icode;
- const char * name;
- enum ix86_builtins code;
- enum rtx_code comparison;
- unsigned int flag;
+ const unsigned int mask;
+ const enum insn_code icode;
+ const char *const name;
+ const enum ix86_builtins code;
+ const enum rtx_code comparison;
+ const unsigned int flag;
};
-static struct builtin_description bdesc_comi[] =
+static const struct builtin_description bdesc_comi[] =
{
{ MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comieq", IX86_BUILTIN_COMIEQSS, EQ, 0 },
{ MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comilt", IX86_BUILTIN_COMILTSS, LT, 0 },
{ MASK_SSE, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomineq", IX86_BUILTIN_UCOMINEQSS, NE, 0 }
};
-static struct builtin_description bdesc_2arg[] =
+static const struct builtin_description bdesc_2arg[] =
{
/* SSE */
{ MASK_SSE, CODE_FOR_addv4sf3, "__builtin_ia32_addps", IX86_BUILTIN_ADDPS, 0, 0 },
};
-static struct builtin_description bdesc_1arg[] =
+static const struct builtin_description bdesc_1arg[] =
{
{ MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_pmovmskb, 0, IX86_BUILTIN_PMOVMSKB, 0, 0 },
{ MASK_SSE, CODE_FOR_sse_movmskps, 0, IX86_BUILTIN_MOVMSKPS, 0, 0 },
void
ix86_init_mmx_sse_builtins ()
{
- struct builtin_description * d;
+ const struct builtin_description * d;
size_t i;
tree endlink = void_list_node;
static rtx
ix86_expand_sse_compare (d, arglist, target)
- struct builtin_description *d;
+ const struct builtin_description *d;
tree arglist;
rtx target;
{
static rtx
ix86_expand_sse_comi (d, arglist, target)
- struct builtin_description *d;
+ const struct builtin_description *d;
tree arglist;
rtx target;
{
enum machine_mode mode ATTRIBUTE_UNUSED;
int ignore ATTRIBUTE_UNUSED;
{
- struct builtin_description *d;
+ const struct builtin_description *d;
size_t i;
enum insn_code icode;
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
/* Define the specific costs for a given cpu */
struct processor_costs {
- int add; /* cost of an add instruction */
- int lea; /* cost of a lea instruction */
- int shift_var; /* variable shift costs */
- int shift_const; /* constant shift costs */
- int mult_init; /* cost of starting a multiply */
- int mult_bit; /* cost of multiply per each bit set */
- int divide; /* cost of a divide/mod */
- int large_insn; /* insns larger than this cost more */
- int move_ratio; /* The threshold of number of scalar
+ const int add; /* cost of an add instruction */
+ const int lea; /* cost of a lea instruction */
+ const int shift_var; /* variable shift costs */
+ const int shift_const; /* constant shift costs */
+ const int mult_init; /* cost of starting a multiply */
+ const int mult_bit; /* cost of multiply per each bit set */
+ const int divide; /* cost of a divide/mod */
+ const int large_insn; /* insns larger than this cost more */
+ const int move_ratio; /* The threshold of number of scalar
memory-to-memory move insns. */
- int movzbl_load; /* cost of loading using movzbl */
- int int_load[3]; /* cost of loading integer registers
+ const int movzbl_load; /* cost of loading using movzbl */
+ const int int_load[3]; /* cost of loading integer registers
in QImode, HImode and SImode relative
to reg-reg move (2). */
- int int_store[3]; /* cost of storing integer register
+ const int int_store[3]; /* cost of storing integer register
in QImode, HImode and SImode */
- int fp_move; /* cost of reg,reg fld/fst */
- int fp_load[3]; /* cost of loading FP register
+ const int fp_move; /* cost of reg,reg fld/fst */
+ const int fp_load[3]; /* cost of loading FP register
in SFmode, DFmode and XFmode */
- int fp_store[3]; /* cost of storing FP register
+ const int fp_store[3]; /* cost of storing FP register
in SFmode, DFmode and XFmode */
- int mmx_move; /* cost of moving MMX register. */
- int mmx_load[2]; /* cost of loading MMX register
+ const int mmx_move; /* cost of moving MMX register. */
+ const int mmx_load[2]; /* cost of loading MMX register
in SImode and DImode */
- int mmx_store[2]; /* cost of storing MMX register
+ const int mmx_store[2]; /* cost of storing MMX register
in SImode and DImode */
- int sse_move; /* cost of moving SSE register. */
- int sse_load[3]; /* cost of loading SSE register
+ const int sse_move; /* cost of moving SSE register. */
+ const int sse_load[3]; /* cost of loading SSE register
in SImode, DImode and TImode*/
- int sse_store[3]; /* cost of storing SSE register
+ const int sse_store[3]; /* cost of storing SSE register
in SImode, DImode and TImode*/
- int mmxsse_to_integer; /* cost of moving mmxsse register to
+ const int mmxsse_to_integer; /* cost of moving mmxsse register to
integer and vice versa. */
};
-extern struct processor_costs *ix86_cost;
+extern const struct processor_costs *ix86_cost;
/* Run-time compilation parameters selecting different hardware subsets. */
rtx m68hc11_compare_op1;
\f
-struct processor_costs *m68hc11_cost;
+const struct processor_costs *m68hc11_cost;
/* Costs for a 68HC11. */
-struct processor_costs m6811_cost = {
+static const struct processor_costs m6811_cost = {
/* add */
COSTS_N_INSNS (2),
/* logical */
};
/* Costs for a 68HC12. */
-struct processor_costs m6812_cost = {
+static const struct processor_costs m6812_cost = {
/* add */
COSTS_N_INSNS (1),
/* logical */
\f
/* Define cost parameters for a given processor variant. */
struct processor_costs {
- int add; /* cost of an add instruction */
- int logical; /* cost of a logical instruction */
- int shift_var;
- int shiftQI_const[8];
- int shiftHI_const[16];
- int multQI;
- int multHI;
- int multSI;
- int divQI;
- int divHI;
- int divSI;
+ const int add; /* cost of an add instruction */
+ const int logical; /* cost of a logical instruction */
+ const int shift_var;
+ const int shiftQI_const[8];
+ const int shiftHI_const[16];
+ const int multQI;
+ const int multHI;
+ const int multSI;
+ const int divQI;
+ const int divHI;
+ const int divSI;
};
/* Costs for the current processor. */
-extern struct processor_costs *m68hc11_cost;
+extern const struct processor_costs *m68hc11_cost;
\f
/* target machine storage layout */
"1e16"
};
-int codes_68881[7] = {
+static const int codes_68881[7] = {
0x0f,
0x32,
0x33,
};
-int codes_FPA[38] = {
+static const int codes_FPA[38] = {
/* small rationals */
0x200,
0xe,
#define MOVSTR_SI_LIMIT_88110 72
#define MOVSTR_DI_LIMIT_88110 72
-static enum machine_mode mode_from_align[] =
+static const enum machine_mode mode_from_align[] =
{VOIDmode, QImode, HImode, VOIDmode, SImode,
VOIDmode, VOIDmode, VOIDmode, DImode};
-static int max_from_align[] = {0, MOVSTR_QI, MOVSTR_HI, 0, MOVSTR_SI,
- 0, 0, 0, MOVSTR_DI};
-static int all_from_align[] = {0, MOVSTR_QI, MOVSTR_ODD_HI, 0, MOVSTR_ODD_SI,
- 0, 0, 0, MOVSTR_ODD_DI};
+static const int max_from_align[] = {0, MOVSTR_QI, MOVSTR_HI, 0, MOVSTR_SI,
+ 0, 0, 0, MOVSTR_DI};
+static const int all_from_align[] = {0, MOVSTR_QI, MOVSTR_ODD_HI, 0,
+ MOVSTR_ODD_SI, 0, 0, 0, MOVSTR_ODD_DI};
-static int best_from_align[3][9] = {
+static const int best_from_align[3][9] = {
{0, MOVSTR_QI_LIMIT_88100, MOVSTR_HI_LIMIT_88100, 0, MOVSTR_SI_LIMIT_88100,
0, 0, 0, MOVSTR_DI_LIMIT_88100},
{0, MOVSTR_QI_LIMIT_88110, MOVSTR_HI_LIMIT_88110, 0, MOVSTR_SI_LIMIT_88110,
return pos + fprintf (file, "%s%s%s", sep, type, name);
}
-static struct { const char *const name; int value; } m_options[] = TARGET_SWITCHES;
+static const struct { const char *const name; const int value; } m_options[] =
+TARGET_SWITCHES;
static void
output_options (file, f_options, f_len, W_options, W_len,
write-over scoreboard delays between caller and callee. */
#define ORDER_REGS_FOR_LOCAL_ALLOC \
{ \
- static int leaf[] = REG_LEAF_ALLOC_ORDER; \
- static int nonleaf[] = REG_ALLOC_ORDER; \
+ static const int leaf[] = REG_LEAF_ALLOC_ORDER; \
+ static const int nonleaf[] = REG_ALLOC_ORDER; \
\
memcpy (reg_alloc_order, regs_ever_live[1] ? nonleaf : leaf, \
FIRST_PSEUDO_REGISTER * sizeof (int)); \
known constants. DEST and SRC are registers. OFFSET is the known
starting point for the output pattern. */
-static enum machine_mode mode_from_align[] =
+static const enum machine_mode mode_from_align[] =
{
VOIDmode, QImode, HImode, VOIDmode, SImode,
VOIDmode, VOIDmode, VOIDmode, DImode
#define UNIQUE_SECTION(DECL,RELOC) \
do { \
int len, size, sec; \
- char *name, *string, *prefix; \
- static char *prefixes[4][2] = { \
+ const char *name, *prefix; \
+ char *string; \
+ static const char *const prefixes[4][2] = { \
{ ".text.", ".gnu.linkonce.t." }, \
{ ".rodata.", ".gnu.linkonce.r." }, \
{ ".data.", ".gnu.linkonce.d." }, \
{ \
int len; \
int sec; \
- char *name; \
+ const char *name; \
char *string; \
- char *prefix; \
- static char *prefixes[/*4*/3][2] = \
+ const char *prefix; \
+ static const char *const prefixes[/*4*/3][2] = \
{ \
{ ".text.", ".gnu.linkonce.t." }, \
{ ".rodata.", ".gnu.linkonce.r." }, \
/* Mips software names for the registers, used to overwrite the
mips_reg_names array. */
-char mips_sw_reg_names[][8] =
+static const char mips_sw_reg_names[][8] =
{
"$zero","$at", "$v0", "$v1", "$a0", "$a1", "$a2", "$a3",
"$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7",
};
/* Map hard register number to register class */
-enum reg_class mips_regno_to_class[] =
+const enum reg_class mips_regno_to_class[] =
{
GR_REGS, GR_REGS, M16_NA_REGS, M16_NA_REGS,
M16_REGS, M16_REGS, M16_REGS, M16_REGS,
choose a class which is "minimal", meaning that no smaller class
also contains the register. */
-extern enum reg_class mips_regno_to_class[];
+extern const enum reg_class mips_regno_to_class[];
#define REGNO_REG_CLASS(REGNO) mips_regno_to_class[ (REGNO) ]
register FILE *file;
register rtx addr;
{
- static char scales[] = { 'b', 'w', 'd', 0, 'q', };
+ static const char scales[] = { 'b', 'w', 'd', 0, 'q', };
rtx offset, base, indexexp, tmp;
int scale;
extern int flag_pic;
static void import_milli PARAMS ((enum millicodes));
static char imported[(int) end1000];
static const char * const milli_names[] = {"remI", "remU", "divI", "divU", "mulI", "mulU"};
-static char import_string[] = ".IMPORT $$....,MILLICODE";
+static const char import_string[] = ".IMPORT $$....,MILLICODE";
#define MILLI_START 10
static void
/* Emit the rtl for doing a division by a constant. */
/* Do magic division millicodes exist for this value? */
-static int magic_milli[]= {0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0,
- 1, 1};
+static const int magic_milli[]= {0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0,
+ 1, 1};
/* We'll use an array to keep track of the magic millicodes and
whether or not we've used them already. [n][0] is signed, [n][1] is
};
#ifdef TARGET_REGNAMES
-static char alt_reg_names[][8] =
+static const char alt_reg_names[][8] =
{
"%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7",
"%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15",
static struct ptt
{
- const char *name; /* Canonical processor name. */
- enum processor_type processor; /* Processor type enum value. */
- int target_enable; /* Target flags to enable. */
- int target_disable; /* Target flags to disable. */
- } processor_target_table[]
+ const char *const name; /* Canonical processor name. */
+ const enum processor_type processor; /* Processor type enum value. */
+ const int target_enable; /* Target flags to enable. */
+ const int target_disable; /* Target flags to disable. */
+ } const processor_target_table[]
= {{"common", PROCESSOR_COMMON, MASK_NEW_MNEMONICS,
POWER_MASKS | POWERPC_MASKS},
{"power", PROCESSOR_POWER,
registers. FRAME_POINTER_REGNUM cannot be remapped by
this function to eliminate it. You must use -fomit-frame-pointer
to get that. */
-char leaf_reg_remap[] =
+const char leaf_reg_remap[] =
{ 0, 1, 2, 3, 4, 5, 6, 7,
-1, -1, -1, -1, -1, -1, 14, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
sparc_override_options ()
{
static struct code_model {
- const char *name;
- int value;
- } cmodels[] = {
+ const char *const name;
+ const int value;
+ } const cmodels[] = {
{ "32", CM_32 },
{ "medlow", CM_MEDLOW },
{ "medmid", CM_MEDMID },
{ "embmedany", CM_EMBMEDANY },
{ 0, 0 }
};
- struct code_model *cmodel;
+ const struct code_model *cmodel;
/* Map TARGET_CPU_DEFAULT to value for -m{arch,tune}=. */
static struct cpu_default {
- int cpu;
- const char *name;
- } cpu_default[] = {
+ const int cpu;
+ const char *const name;
+ } const cpu_default[] = {
/* There must be one entry here for each TARGET_CPU value. */
{ TARGET_CPU_sparc, "cypress" },
{ TARGET_CPU_sparclet, "tsc701" },
{ TARGET_CPU_ultrasparc, "ultrasparc" },
{ 0, 0 }
};
- struct cpu_default *def;
+ const struct cpu_default *def;
/* Table of values for -m{cpu,tune}=. */
static struct cpu_table {
- const char *name;
- enum processor_type processor;
- int disable;
- int enable;
- } cpu_table[] = {
+ const char *const name;
+ const enum processor_type processor;
+ const int disable;
+ const int enable;
+ } const cpu_table[] = {
{ "v7", PROCESSOR_V7, MASK_ISA, 0 },
{ "cypress", PROCESSOR_CYPRESS, MASK_ISA, 0 },
{ "v8", PROCESSOR_V8, MASK_ISA, MASK_V8 },
|MASK_DEPRECATED_V8_INSNS},
{ 0, 0, 0, 0 }
};
- struct cpu_table *cpu;
- struct sparc_cpu_select *sel;
+ const struct cpu_table *cpu;
+ const struct sparc_cpu_select *sel;
int fpu;
#ifndef SPARC_BI_ARCH
\f
/* Leaf functions and non-leaf functions have different needs. */
-static int
+static const int
reg_leaf_alloc_order[] = REG_LEAF_ALLOC_ORDER;
-static int
+static const int
reg_nonleaf_alloc_order[] = REG_ALLOC_ORDER;
-static int *reg_alloc_orders[] = {
+static const int *const reg_alloc_orders[] = {
reg_leaf_alloc_order,
reg_nonleaf_alloc_order};
{
last_order_nonleaf = !last_order_nonleaf;
memcpy ((char *) reg_alloc_order,
- (char *) reg_alloc_orders[last_order_nonleaf],
+ (const char *) reg_alloc_orders[last_order_nonleaf],
FIRST_PSEUDO_REGISTER * sizeof (int));
}
}
struct sparc_cpu_select
{
const char *string;
- const char *name;
- int set_tune_p;
- int set_arch_p;
+ const char *const name;
+ const int set_tune_p;
+ const int set_arch_p;
};
extern struct sparc_cpu_select sparc_select[];
extern char sparc_leaf_regs[];
#define LEAF_REGISTERS sparc_leaf_regs
-extern char leaf_reg_remap[];
+extern const char leaf_reg_remap[];
#define LEAF_REG_REMAP(REGNO) (leaf_reg_remap[REGNO])
/* The class value for index registers, and the one for base regs. */
+2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * class.c (build_vtable_entry_ref): Const-ify.
+ * decl.c (predefined_identifier,
+ initialize_predefined_identifiers): Likewise.
+ * init.c (build_new_1): Likewise.
+ * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword):
+ Likewise.
+
2001-10-05 Alexandre Oliva <aoliva@redhat.com>
* optimize.c (struct inline_data): Moved to ../tree-inline.c.
build_vtable_entry_ref (basetype, idx)
tree basetype, idx;
{
- static char asm_stmt[] = ".vtable_entry %c0, %c1";
+ static const char asm_stmt[] = ".vtable_entry %c0, %c1";
tree s, i, i2;
tree vtable = get_vtbl_decl_for_binfo (TYPE_BINFO (basetype));
tree first_fn = TYPE_BINFO_VTABLE (basetype);
typedef struct predefined_identifier
{
/* The name of the identifier. */
- const char *name;
+ const char *const name;
/* The place where the IDENTIFIER_NODE should be stored. */
- tree *node;
+ tree *const node;
/* Non-zero if this is the name of a constructor or destructor. */
- int ctor_or_dtor_p;
+ const int ctor_or_dtor_p;
} predefined_identifier;
/* Create all the predefined identifiers. */
static void
initialize_predefined_identifiers ()
{
- struct predefined_identifier *pid;
+ const predefined_identifier *pid;
/* A table of identifiers to create at startup. */
- static predefined_identifier predefined_identifiers[] = {
+ static const predefined_identifier predefined_identifiers[] = {
{ "C++", &lang_name_cplusplus, 0 },
{ "C", &lang_name_c, 0 },
{ "Java", &lang_name_java, 0 },
tree class_addr, alloc_decl;
tree class_decl = build_java_class_ref (true_type);
tree class_size = size_in_bytes (true_type);
- static char alloc_name[] = "_Jv_AllocObject";
+ static const char alloc_name[] = "_Jv_AllocObject";
use_java_new = 1;
alloc_decl = IDENTIFIER_GLOBAL_VALUE (get_identifier (alloc_name));
if (alloc_decl == NULL_TREE)
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-static char cplus_tree_code_type[] = {
+static const char cplus_tree_code_type[] = {
'x',
#include "cp-tree.def"
};
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-static int cplus_tree_code_length[] = {
+static const int cplus_tree_code_length[] = {
0,
#include "cp-tree.def"
};
/* The reserved keyword table. */
struct resword
{
- const char *word;
- ENUM_BITFIELD(rid) rid : 16;
- unsigned int disable : 16;
+ const char *const word;
+ const ENUM_BITFIELD(rid) rid : 16;
+ const unsigned int disable : 16;
};
/* Disable mask. Keywords are disabled if (reswords[i].disable & mask) is
struct default_include
{
- const char *fname; /* The name of the directory. */
- const char *component; /* The component containing the directory
+ const char *const fname; /* The name of the directory. */
+ const char *const component; /* The component containing the directory
(see update_path in prefix.c) */
- int cplusplus; /* Only look here if we're compiling C++. */
- int cxx_aware; /* Includes in this directory don't need to
+ const int cplusplus; /* Only look here if we're compiling C++. */
+ const int cxx_aware; /* Includes in this directory don't need to
be wrapped in extern "C" when compiling
C++. */
};
struct suffix
{
- unsigned char s[4];
- unsigned char u;
- unsigned char l;
+ const unsigned char s[4];
+ const unsigned char u;
+ const unsigned char l;
};
-const struct suffix vsuf_1[] = {
+static const struct suffix vsuf_1[] = {
{ "u", 1, 0 }, { "U", 1, 0 },
{ "l", 0, 1 }, { "L", 0, 1 }
};
-const struct suffix vsuf_2[] = {
+static const struct suffix vsuf_2[] = {
{ "ul", 1, 1 }, { "UL", 1, 1 }, { "uL", 1, 1 }, { "Ul", 1, 1 },
{ "lu", 1, 1 }, { "LU", 1, 1 }, { "Lu", 1, 1 }, { "lU", 1, 1 },
{ "ll", 0, 2 }, { "LL", 0, 2 }
};
-const struct suffix vsuf_3[] = {
+static const struct suffix vsuf_3[] = {
{ "ull", 1, 2 }, { "ULL", 1, 2 }, { "uLL", 1, 2 }, { "Ull", 1, 2 },
{ "llu", 1, 2 }, { "LLU", 1, 2 }, { "LLu", 1, 2 }, { "llU", 1, 2 }
};
+Sun Oct 7 12:27:54 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * bad.c (_ffebad_message_, ffebad_messages_): Const-ify.
+ * bld.c (ffebld_arity_op_): Likewise.
+ * bld.h (ffebld_arity_op_): Likewise.
+ * com.c (ffecom_init_0): Likewise.
+ * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_,
+ _ffeintrin_imp_, names, gens, imps, specs, cc_pair,
+ cc_descriptions, cc_summaries): Likewise.
+ * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_,
+ _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_,
+ ffeintrin_imps_, ffeintrin_specs_): Likewise.
+
2001-10-05 Toon Moene <toon@moene.indiv.nluug.nl>
* news.texi: Document libf2c being built as a shared library.
struct _ffebad_message_
{
- ffebadSeverity severity;
- const char *message;
+ const ffebadSeverity severity;
+ const char *const message;
};
/* Static objects accessed by functions in this module. */
-static struct _ffebad_message_ ffebad_messages_[]
+static const struct _ffebad_message_ ffebad_messages_[]
=
{
#define FFEBAD_MSGS1(KWD,SEV,MSG) { SEV, MSG },
/* Externals defined here. */
-ffebldArity ffebld_arity_op_[]
+const ffebldArity ffebld_arity_op_[]
=
{
#define FFEBLD_OP(KWD,NAME,ARITY) ARITY,
/* Global objects accessed by users of this module. */
-extern ffebldArity ffebld_arity_op_[];
+extern const ffebldArity ffebld_arity_op_[];
extern struct _ffebld_pool_stack_ ffebld_pool_stack_;
/* Declare functions with prototypes. */
if (ffe_is_do_internal_checks ())
{
- static char names[][12]
+ static const char names[][12]
=
{"bar", "bletch", "foo", "foobar"};
- char *name;
+ const char *name;
unsigned long ul;
double fl;
name = bsearch ("foo", &names[0], ARRAY_SIZE (names), sizeof (names[0]),
(int (*)(const void *, const void *)) strcmp);
- if (name != (char *) &names[2])
+ if (name != &names[0][2])
{
assert ("bsearch doesn't work, #define FFEPROJ_BSEARCH 0 in proj.h"
== NULL);
struct _ffeintrin_name_
{
- const char *name_uc;
- const char *name_lc;
- const char *name_ic;
- ffeintrinGen generic;
- ffeintrinSpec specific;
+ const char *const name_uc;
+ const char *const name_lc;
+ const char *const name_ic;
+ const ffeintrinGen generic;
+ const ffeintrinSpec specific;
};
struct _ffeintrin_gen_
{
- const char *name; /* Name as seen in program. */
- ffeintrinSpec specs[2];
+ const char *const name; /* Name as seen in program. */
+ const ffeintrinSpec specs[2];
};
struct _ffeintrin_spec_
{
- const char *name; /* Uppercase name as seen in source code,
+ const char *const name; /* Uppercase name as seen in source code,
lowercase if no source name, "none" if no
name at all (NONE case). */
- bool is_actualarg; /* Ok to pass as actual arg if -pedantic. */
- ffeintrinFamily family;
- ffeintrinImp implementation;
+ const bool is_actualarg; /* Ok to pass as actual arg if -pedantic. */
+ const ffeintrinFamily family;
+ const ffeintrinImp implementation;
};
struct _ffeintrin_imp_
{
- const char *name; /* Name of implementation. */
+ const char *const name; /* Name of implementation. */
#if 0 /* FFECOM_targetCURRENT == FFECOM_targetGCC */
- ffecomGfrt gfrt; /* gfrt index in library. */
+ const ffecomGfrt gfrt; /* gfrt index in library. */
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
- const char *control;
+ const char *const control;
};
-static struct _ffeintrin_name_ names[] = {
+static const struct _ffeintrin_name_ names[] = {
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC) \
{ UPPER, LOWER, MIXED, FFEINTRIN_ ## GEN, FFEINTRIN_ ## SPEC },
#define DEFGEN(CODE,NAME,SPEC1,SPEC2)
#undef DEFIMPY
};
-static struct _ffeintrin_gen_ gens[] = {
+static const struct _ffeintrin_gen_ gens[] = {
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
#define DEFGEN(CODE,NAME,SPEC1,SPEC2) \
{ NAME, { SPEC1, SPEC2, }, },
#undef DEFIMPY
};
-static struct _ffeintrin_imp_ imps[] = {
+static const struct _ffeintrin_imp_ imps[] = {
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
#define DEFGEN(CODE,NAME,SPEC1,SPEC2)
#define DEFSPEC(CODE,NAME,CALLABLE,FAMILY,IMP)
#undef DEFIMPY
};
-static struct _ffeintrin_spec_ specs[] = {
+static const struct _ffeintrin_spec_ specs[] = {
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
#define DEFGEN(CODE,NAME,SPEC1,SPEC2)
#define DEFSPEC(CODE,NAME,CALLABLE,FAMILY,IMP) \
#undef DEFIMPY
};
-struct cc_pair { ffeintrinImp imp; const char *text; };
+struct cc_pair { const ffeintrinImp imp; const char *const text; };
static const char *descriptions[FFEINTRIN_imp] = { 0 };
-static struct cc_pair cc_descriptions[] = {
+static const struct cc_pair cc_descriptions[] = {
#define DEFDOC(IMP,SUMMARY,DESCRIPTION) { FFEINTRIN_imp ## IMP, DESCRIPTION },
#include "intdoc.h0"
#undef DEFDOC
};
static const char *summaries[FFEINTRIN_imp] = { 0 };
-static struct cc_pair cc_summaries[] = {
+static const struct cc_pair cc_summaries[] = {
#define DEFDOC(IMP,SUMMARY,DESCRIPTION) { FFEINTRIN_imp ## IMP, SUMMARY },
#include "intdoc.h0"
#undef DEFDOC
struct _ffeintrin_name_
{
- const char *name_uc;
- const char *name_lc;
- const char *name_ic;
- ffeintrinGen generic;
- ffeintrinSpec specific;
+ const char *const name_uc;
+ const char *const name_lc;
+ const char *const name_ic;
+ const ffeintrinGen generic;
+ const ffeintrinSpec specific;
};
struct _ffeintrin_gen_
{
- const char *name; /* Name as seen in program. */
- ffeintrinSpec specs[2];
+ const char *const name; /* Name as seen in program. */
+ const ffeintrinSpec specs[2];
};
struct _ffeintrin_spec_
{
- const char *name; /* Uppercase name as seen in source code,
+ const char *const name; /* Uppercase name as seen in source code,
lowercase if no source name, "none" if no
name at all (NONE case). */
- bool is_actualarg; /* Ok to pass as actual arg if -pedantic. */
- ffeintrinFamily family;
- ffeintrinImp implementation;
+ const bool is_actualarg; /* Ok to pass as actual arg if -pedantic. */
+ const ffeintrinFamily family;
+ const ffeintrinImp implementation;
};
struct _ffeintrin_imp_
{
- const char *name; /* Name of implementation. */
+ const char *const name; /* Name of implementation. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
- ffecomGfrt gfrt_direct; /* library routine, direct-callable form. */
- ffecomGfrt gfrt_f2c; /* library routine, f2c-callable form. */
- ffecomGfrt gfrt_gnu; /* library routine, gnu-callable form. */
+ const ffecomGfrt gfrt_direct;/* library routine, direct-callable form. */
+ const ffecomGfrt gfrt_f2c; /* library routine, f2c-callable form. */
+ const ffecomGfrt gfrt_gnu; /* library routine, gnu-callable form. */
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
- const char *control;
- char y2kbad;
+ const char *const control;
+ const char y2kbad;
};
static ffebad ffeintrin_check_ (ffeintrinImp imp, ffebldOp op,
static bool ffeintrin_check_any_ (ffebld arglist);
static int ffeintrin_cmp_name_ (const void *name, const void *intrinsic);
-static struct _ffeintrin_name_ ffeintrin_names_[]
+static const struct _ffeintrin_name_ ffeintrin_names_[]
=
{ /* Alpha order. */
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC) \
#undef DEFIMPY
};
-static struct _ffeintrin_gen_ ffeintrin_gens_[]
+static const struct _ffeintrin_gen_ ffeintrin_gens_[]
=
{
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
#undef DEFIMPY
};
-static struct _ffeintrin_imp_ ffeintrin_imps_[]
+static const struct _ffeintrin_imp_ ffeintrin_imps_[]
=
{
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
#undef DEFIMPY
};
-static struct _ffeintrin_spec_ ffeintrin_specs_[]
+static const struct _ffeintrin_spec_ ffeintrin_specs_[]
=
{
#define DEFNAME(UPPER,LOWER,MIXED,GEN,SPEC)
{
#ifdef ELIMINABLE_REGS
register int i;
- static struct {int from, to; } eliminables[] = ELIMINABLE_REGS;
+ static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
#endif
/* Record which registers will be eliminated. We use this in
#endif /* DIR_UP */
#endif /* VMS */
-static char dir_separator_str[] = { DIR_SEPARATOR, 0 };
+static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
switch. The only case we support now is simply appending or deleting a
string to or from the end of the first part of the configuration name. */
-struct modify_target
+const struct modify_target
{
- const char *sw;
- enum add_del {ADD, DELETE} add_del;
- const char *str;
+ const char *const sw;
+ const enum add_del {ADD, DELETE} add_del;
+ const char *const str;
}
modify_target[] = MODIFY_TARGET_NAME;
#endif
struct option_map
{
/* The long option's name. */
- const char *name;
+ const char *const name;
/* The equivalent short option. */
- const char *equivalent;
+ const char *const equivalent;
/* Argument info. A string of flag chars; NULL equals no options.
a => argument required.
o => argument optional.
j => join argument to equivalent, making one word.
* => require other text after NAME as an argument. */
- const char *arg_info;
+ const char *const arg_info;
};
/* This is the table of mappings. Mappings are tried sequentially
for each option encountered; the first one that matches, wins. */
-struct option_map option_map[] =
+static const struct option_map option_map[] =
{
{"--all-warnings", "-Wall", 0},
{"--ansi", "-ansi", 0},
\f
#ifdef TARGET_OPTION_TRANSLATE_TABLE
-static struct {
- const char *option_found;
- const char *replacements;
+static const struct {
+ const char *const option_found;
+ const char *const replacements;
} target_option_translations[] =
{
TARGET_OPTION_TRANSLATE_TABLE,
That is all that the EXTRA_SPECS macro gives us. */
struct spec_list_1
{
- const char *name;
- const char *ptr;
+ const char *const name;
+ const char *const ptr;
};
-static struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
+static const struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
static struct spec_list *extra_specs = (struct spec_list *) 0;
#endif
#ifdef USE_AS_TRADITIONAL_FORMAT
/* Prepend "--traditional-format" to whatever asm_spec we had before. */
{
- static char tf[] = "--traditional-format ";
+ static const char tf[] = "--traditional-format ";
obstack_grow (&obstack, tf, sizeof(tf) - 1);
obstack_grow0 (&obstack, asm_spec, strlen (asm_spec));
asm_spec = obstack_finish (&obstack);
/* The functions in this file for creating and solution program flow graphs
are very similar to functions in the gcc source file profile.c. */
-char gcov_version_string[] = "GNU gcov version 1.5\n";
+static const char gcov_version_string[] = "GNU gcov version 1.5\n";
/* This is the size of the buffer used to read in source file lines. */
printf ("#define INSN_SCHEDULING\n\n");
printf ("extern int result_ready_cost PARAMS ((rtx));\n");
printf ("extern int function_units_used PARAMS ((rtx));\n\n");
- printf ("extern struct function_unit_desc\n");
+ printf ("extern const struct function_unit_desc\n");
printf ("{\n");
- printf (" const char *name;\n");
- printf (" int bitmask;\n");
- printf (" int multiplicity;\n");
- printf (" int simultaneity;\n");
- printf (" int default_cost;\n");
- printf (" int max_issue_delay;\n");
- printf (" int (*ready_cost_function) PARAMS ((rtx));\n");
- printf (" int (*conflict_cost_function) PARAMS ((rtx, rtx));\n");
- printf (" int max_blockage;\n");
- printf (" unsigned int (*blockage_range_function) PARAMS ((rtx));\n");
- printf (" int (*blockage_function) PARAMS ((rtx, rtx));\n");
+ printf (" const char *const name;\n");
+ printf (" const int bitmask;\n");
+ printf (" const int multiplicity;\n");
+ printf (" const int simultaneity;\n");
+ printf (" const int default_cost;\n");
+ printf (" const int max_issue_delay;\n");
+ printf (" int (*const ready_cost_function) PARAMS ((rtx));\n");
+ printf (" int (*const conflict_cost_function) PARAMS ((rtx, rtx));\n");
+ printf (" const int max_blockage;\n");
+ printf (" unsigned int (*const blockage_range_function) PARAMS ((rtx));\n");
+ printf (" int (*const blockage_function) PARAMS ((rtx, rtx));\n");
printf ("} function_units[];\n\n");
printf ("#define FUNCTION_UNITS_SIZE %d\n", num_units);
printf ("#define MIN_MULTIPLICITY %d\n", multiplicity->min);
static const char *const new_names[] = {"*insn_default_length",
"*insn_variable_length_p",
"*insn_current_length"};
- static rtx (*no_address_fn[]) PARAMS ((rtx)) = {identity_fn, zero_fn, zero_fn};
- static rtx (*address_fn[]) PARAMS ((rtx)) = {max_fn, one_fn, identity_fn};
+ static rtx (*const no_address_fn[]) PARAMS ((rtx)) = {identity_fn, zero_fn, zero_fn};
+ static rtx (*const address_fn[]) PARAMS ((rtx)) = {max_fn, one_fn, identity_fn};
size_t i;
struct attr_desc *length_attr, *new_attr;
struct attr_value *av, *new_av;
the function units. The name is included for documentation purposes
only. */
- printf ("struct function_unit_desc function_units[] = {\n");
+ printf ("const struct function_unit_desc function_units[] = {\n");
/* Write out the descriptions in numeric order, but don't force that order
on the list. Doing so increases the runtime of genattrtab.c. */
struct rtx_definition
{
- const char *enumname, *name, *format;
+ const char *const enumname, *const name, *const format;
};
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGX(ENUM), NAME, FORMAT },
-struct rtx_definition defs[] =
+const struct rtx_definition defs[] =
{
#include "rtl.def" /* rtl expressions are documented here */
};
output_predicate_decls ()
{
#ifdef PREDICATE_CODES
- static struct {
- const char *name;
- RTX_CODE codes[NUM_RTX_CODE];
+ static const struct {
+ const char *const name;
+ const RTX_CODE codes[NUM_RTX_CODE];
} predicate[] = {
PREDICATE_CODES
};
of tree nodes. Also, if a predicate can match only one code, we can
hardwire that code into the node testing the predicate. */
-static struct pred_table
+static const struct pred_table
{
- const char *name;
- RTX_CODE codes[NUM_RTX_CODE];
+ const char *const name;
+ const RTX_CODE codes[NUM_RTX_CODE];
} preds[] = {
{"general_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF, SUBREG, REG, MEM}},
{
int retval;
#ifdef ELIMINABLE_REGS
- static struct {int from, to; } eliminables[] = ELIMINABLE_REGS;
+ static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
#endif
int need_fp
= (! flag_omit_frame_pointer
+2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * jcf-io.c (format_uint): Const-ify.
+ * lang.c (java_tree_code_type, java_tree_code_length): Likewise.
+ * lex.c (java_get_line_col): Likewise.
+ * parse.y (build_incdec): Likewise.
+
2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_assignment): Use lvalue's original TYPE when
/* Note this code does not pretend to be optimized. */
do {
int digit = value % base;
- static char digit_chars[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+ static const char digit_chars[] = "0123456789abcdefghijklmnopqrstuvwxyz";
*--buf_ptr = digit_chars[digit];
value /= base;
} while (value != 0);
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-char java_tree_code_type[] = {
+static const char java_tree_code_type[] = {
'x',
#include "java-tree.def"
};
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-int java_tree_code_length[] = {
+static const int java_tree_code_length[] = {
0,
#include "java-tree.def"
};
c = getc (fp);
if (c == EOF)
{
- static char msg[] = "<<file too short - unexpected EOF>>";
+ static const char msg[] = "<<file too short - unexpected EOF>>";
obstack_grow (&temporary_obstack, msg, sizeof(msg)-1);
goto have_line;
}
tree op1;
int is_post_p;
{
- static enum tree_code lookup [2][2] =
+ static const enum tree_code lookup [2][2] =
{
{ PREDECREMENT_EXPR, PREINCREMENT_EXPR, },
{ POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, },
int need_commit = 0;
sbitmap *kill;
struct edge_list *edge_list;
- static int num_modes[] = NUM_MODES_FOR_MODE_SWITCHING;
+ static const int num_modes[] = NUM_MODES_FOR_MODE_SWITCHING;
#define N_ENTITIES (sizeof num_modes / sizeof (int))
int entity_map[N_ENTITIES];
struct bb_info *bb_info[N_ENTITIES];
#endif
HARD_REG_SET used, first_used;
#ifdef ELIMINABLE_REGS
- static struct {int from, to; } eliminables[] = ELIMINABLE_REGS;
+ static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
#endif
/* Validate our parameters. */
{
/* The name used with the `--param <name>=<value>' switch to set this
value. */
- const char *option;
+ const char *const option;
/* The associated value. */
int value;
/* A short description of the option. */
- const char *help;
+ const char *const help;
} param_info;
/* An array containing the compiler parameters and their current
Filled using information from predict.def. */
struct predictor_info
{
- const char *name; /* Name used in the debugging dumps. */
- int hitrate; /* Expected hitrate used by
- predict_insn_def call. */
- int flags;
+ const char *const name; /* Name used in the debugging dumps. */
+ const int hitrate; /* Expected hitrate used by
+ predict_insn_def call. */
+ const int flags;
};
/* Use given predictor without Dempster-Shaffer theory if it matches
#define HITRATE(VAL) ((int)((VAL) * REG_BR_PROB_BASE + 50) / 100)
#define DEF_PREDICTOR(ENUM, NAME, HITRATE, FLAGS) {NAME, HITRATE, FLAGS},
-struct predictor_info predictor_info[] = {
+static const struct predictor_info predictor_info[] = {
#include "predict.def"
/* Upper bound on predictors. */
/* Type of the structure that holds information about macro unexpansions. */
struct unexpansion_struct {
- const char *expanded;
- const char *contracted;
+ const char *const expanded;
+ const char *const contracted;
};
typedef struct unexpansion_struct unexpansion;
/* Return Y = largest integer not greater than X (truncated toward minus
infinity). */
-static UEMUSHORT bmask[] =
+static const UEMUSHORT bmask[] =
{
0xffff,
0xfffe,
struct insn_operand_data
{
- insn_operand_predicate_fn predicate;
+ const insn_operand_predicate_fn predicate;
- const char *constraint;
+ const char *const constraint;
- ENUM_BITFIELD(machine_mode) mode : 16;
+ const ENUM_BITFIELD(machine_mode) mode : 16;
- char strict_low;
+ const char strict_low;
- char eliminable;
+ const char eliminable;
};
/* Legal values for insn_data.output_format. Indicate what type of data
struct insn_data
{
- const char *name;
+ const char *const name;
const PTR output;
- insn_gen_fn genfun;
- const struct insn_operand_data *operand;
+ const insn_gen_fn genfun;
+ const struct insn_operand_data *const operand;
- char n_operands;
- char n_dups;
- char n_alternatives;
- char output_format;
+ const char n_operands;
+ const char n_dups;
+ const char n_alternatives;
+ const char output_format;
};
extern const struct insn_data insn_data[];
/* Data for initializing the above. */
-static char initial_fixed_regs[] = FIXED_REGISTERS;
+static const char initial_fixed_regs[] = FIXED_REGISTERS;
/* Indexed by hard register number, contains 1 for registers
that are fixed use or are clobbered by function calls.
/* Data for initializing the above. */
-static char initial_call_used_regs[] = CALL_USED_REGISTERS;
+static const char initial_call_used_regs[] = CALL_USED_REGISTERS;
/* This is much like call_used_regs, except it doesn't have to
be a superset of FIXED_REGISTERS. This vector indicates
that if such an elimination is present, it can always be used.
This is the case on all known machines; if we don't make this
assumption, we do unnecessary saving on many machines. */
- static struct elims {int from, to;} elim_regs[] = ELIMINABLE_REGS;
+ static const struct elims {const int from, to;} elim_regs[] = ELIMINABLE_REGS;
size_t i;
for (i = 0; i < ARRAY_SIZE (elim_regs); i++)
int align_functions_log;
/* Table of supported debugging formats. */
-static struct
+static const struct
{
- const char *arg;
+ const char *const arg;
/* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
constant expression, we use NO_DEBUG in its place. */
- enum debug_info_type debug_type;
- int use_extensions_p;
- const char *description;
+ const enum debug_info_type debug_type;
+ const int use_extensions_p;
+ const char *const description;
} *da,
debug_args[] =
{
/* Table of language-specific options. */
-static struct lang_opt
+static const struct lang_opt
{
- const char *option;
- const char *description;
+ const char *const option;
+ const char *const description;
}
documented_lang_options[] =
{
If VALUE is negative, -VALUE is bits to clear.
(The sign bit is not used so there is no confusion.) */
-struct
+static const struct
{
- const char *name;
- int value;
- const char *description;
+ const char *const name;
+ const int value;
+ const char *const description;
}
target_switches [] = TARGET_SWITCHES;
/* This table is similar, but allows the switch to have a value. */
#ifdef TARGET_OPTIONS
-struct
+static const struct
{
- const char *prefix;
- const char **variable;
- const char *description;
+ const char *const prefix;
+ const char **const variable;
+ const char *const description;
}
target_options [] = TARGET_OPTIONS;
#endif
}
struct token {
- const char *operator;
- int token;
+ const char *const operator;
+ const int token;
};
#ifndef NULL
#define NULL 0
#endif
-static struct token tokentab2[] = {
+static const struct token tokentab2[] = {
{"&&", AND},
{"||", OR},
{"<<", LSH},
register int c;
register int namelen;
register const char *tokstart;
- register struct token *toktab;
+ register const struct token *toktab;
retry:
{
/* The name of the attribute (without any leading or trailing __),
or NULL to mark the end of a table of attributes. */
- const char *name;
+ const char *const name;
/* The minimum length of the list of arguments of the attribute. */
- int min_length;
+ const int min_length;
/* The maximum length of the list of arguments of the attribute
(-1 for no maximum). */
- int max_length;
+ const int max_length;
/* Whether this attribute requires a DECL. If it does, it will be passed
from types of DECLs, function return types and array element types to
the DECLs, function types and array types respectively; but when
a warning. (If greater control is desired for a given attribute,
this should be false, and the flags argument to the handler may be
used to gain greater control in that case.) */
- bool decl_required;
+ const bool decl_required;
/* Whether this attribute requires a type. If it does, it will be passed
from a DECL to the type of that DECL. */
- bool type_required;
+ const bool type_required;
/* Whether this attribute requires a function (or method) type. If it does,
it will be passed from a function pointer type to the target type,
and from a function return type (which is not itself a function
pointer type) to the function type. */
- bool function_type_required;
+ const bool function_type_required;
/* Function to handle this attribute. NODE points to the node to which
the attribute is to be applied. If a DECL, it should be modified in
place; if a TYPE, a copy should be created. NAME is the name of the
otherwise the return value should be NULL_TREE. This pointer may be
NULL if no special handling is required beyond the checks implied
by the rest of this structure. */
- tree (*handler) PARAMS ((tree *node, tree name, tree args,
- int flags, bool *no_add_attrs));
+ tree (*const handler) PARAMS ((tree *node, tree name, tree args,
+ int flags, bool *no_add_attrs));
};
extern const struct attribute_spec default_target_attribute_table[];