This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch installed: const-ification part2. (+ size -f measurements)


Here's a second constification patch.  Some static-ization is
scattered in there too.

To answer Neil's question about usefulness, I checked the effect with
"size -f" on f771 (cause fortran seemed to benefit the most.)  I had
two CVS checkouts where the only difference was that the first had
neither the first const patch nor this second one, and the second
checkout had both patches applied.  Here's what I got:

 > notpatched/build/gcc/f771: 17(.interp) + 29688(.hash) + 59504(.dynsym)
 > + 65942(.dynstr) + 32(.SUNW_version) + 36(.rela.got) + 24(.rela.bss) +
 > 984(.rela.plt) + 2937620(.text) + 28(.init) + 20(.fini) +
 > 284072(.rodata) + 156(.rodata1) + 48(.got) + 1036(.plt) +
 > 176(.dynamic) + 43224(.data) + 8(.ctors) + 8(.dtors) + 4(.eh_frame) +
 > 4(.jcr) + 13(.data1) + 319392(.bss) = 3742036

 > patched/build/gcc/f771: 17(.interp) + 29688(.hash) + 59504(.dynsym) +
 > 65942(.dynstr) + 32(.SUNW_version) + 36(.rela.got) + 24(.rela.bss) +
 > 984(.rela.plt) + 2937108(.text) + 28(.init) + 20(.fini) +
 > 286320(.rodata) + 156(.rodata1) + 48(.got) + 1036(.plt) +
 > 176(.dynamic) + 40568(.data) + 8(.ctors) + 8(.dtors) + 4(.eh_frame) +
 > 4(.jcr) + 13(.data1) + 319392(.bss) = 3741116

The byte count differences are:
.text	-512
.rodata	+2248
.data	-2656
overall -920

We have a modest but measureable difference.  Not only did stuff get
moved from .data to .rodata, but the overall size decreased too.


So here's the second patch.  Bootstrapped on sparc-sun-solaris2.7, no
testsuite or warning regressions.  I installed it as obvious.

		--Kaveh


2001-09-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* c-parse.in (yyerror): Const-ification and/or static-ization.
	* c-typeck.c (push_member_name): Likewise.
	* collect2.c (main): Likewise.
	* dbxout.c (dbxout_parms): Likewise.
	* diagnostic.c (format_with_decl): Likewise.
	* dwarf2out.c (output_ranges): Likewise.
	* dwarfout.c (fundamental_type_code): Likewise.
	* except.c (dw2_output_call_site_table): Likewise.
	* gcc.c (do_spec_1): Likewise.
	* genopinit.c (optabs): Likewise.
	* objc/objc-act.c (synth_id_with_class_suffix, start_class,
	gen_declaration_1, handle_impent): Likewise.
	* protoize.c (default_include, in_system_include_dir, abspath):
	Likewise.
	* sched-vis.c (visualize_stall_cycles): Likewise.
	* sdbout.c (plain_type_1, sdbout_end_function,
	sdbout_end_epilogue): Likewise.
	* varasm.c (decode_reg_name): Likewise.
	
	* 1750a.c (mod_regno_adjust): Likewise.
	* alpha.c (alpha_write_one_linkage,
	unicosmk_output_default_externs): Likewise.
	* arm.c (arm_condition_codes): Likewise.
	* arm.h (arm_condition_codes): Likewise.
	* avr.c (output_movsisf, encode_section_info): Likewise.
	* darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL):
	Likewise.
	* i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* m88k.c (output_function_profiler): Likewise.
	* mips.c (mips_output_conditional_branch): Likewise.
	* ns32k.c (ns32k_out_reg_names): Likewise.
	* ns32k.h (ns32k_out_reg_names): Likewise.
	* pj.c (pj_output_rval): Likewise.
	* rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise.
	* sparc.c (sparc_flat_function_prologue,
	sparc_flat_function_epilogue): Likewise.

cp:
	* decl.c (warn_extern_redeclared_static, cp_make_fname_decl):
	Const-ification.
	* pt.c (tsubst_decl): Likewise.

f:
	* bad.c (ffebad_finish): Const-ification and/or static-ization.
	* intrin.c (ffeintrin_cmp_name_): Likewise.
	* stc.c (ffestc_R904): Likewise.

java:
	* expr.c (expand_invoke): Const-ification.
	* parse.y (patch_method_invocation): Likewise.


diff -rup orig/egcs-CVS20010912/gcc/c-parse.in egcs-CVS20010912/gcc/c-parse.in
--- orig/egcs-CVS20010912/gcc/c-parse.in	Wed Aug 22 16:30:25 2001
+++ egcs-CVS20010912/gcc/c-parse.in	Wed Sep 12 17:09:18 2001
@@ -3615,7 +3615,7 @@ yyerror (msgid)
   else if (last_token == CPP_CHAR || last_token == CPP_WCHAR)
     {
       unsigned int val = TREE_INT_CST_LOW (yylval.ttype);
-      const char *ell = (last_token == CPP_CHAR) ? "" : "L";
+      const char *const ell = (last_token == CPP_CHAR) ? "" : "L";
       if (val <= UCHAR_MAX && ISGRAPH (val))
 	error ("%s before %s'%c'", string, ell, val);
       else
diff -rup orig/egcs-CVS20010912/gcc/c-typeck.c egcs-CVS20010912/gcc/c-typeck.c
--- orig/egcs-CVS20010912/gcc/c-typeck.c	Wed Sep 12 12:05:25 2001
+++ egcs-CVS20010912/gcc/c-typeck.c	Wed Sep 12 16:50:01 2001
@@ -4507,7 +4507,7 @@ push_member_name (decl)
      tree decl;
      
 {
-  const char *string
+  const char *const string
     = DECL_NAME (decl) ? IDENTIFIER_POINTER (DECL_NAME (decl)) : "<anonymous>";
   PUSH_SPELLING (SPELLING_MEMBER, string, u.s);
 }
diff -rup orig/egcs-CVS20010912/gcc/collect2.c egcs-CVS20010912/gcc/collect2.c
--- orig/egcs-CVS20010912/gcc/collect2.c	Wed Sep 12 12:05:25 2001
+++ egcs-CVS20010912/gcc/collect2.c	Wed Sep 12 15:53:47 2001
@@ -796,21 +796,21 @@ main (argc, argv)
      int argc;
      char *argv[];
 {
-  const char *const ld_suffix	= "ld";
+  static const char *const ld_suffix	= "ld";
   const char *full_ld_suffix	= ld_suffix;
-  const char *const real_ld_suffix = "real-ld";
-  const char *const collect_ld_suffix = "collect-ld";
-  const char *const nm_suffix	= "nm";
+  static const char *const real_ld_suffix = "real-ld";
+  static const char *const collect_ld_suffix = "collect-ld";
+  static const char *const nm_suffix	= "nm";
   const char *full_nm_suffix	= nm_suffix;
-  const char *const gnm_suffix	= "gnm";
+  static const char *const gnm_suffix	= "gnm";
   const char *full_gnm_suffix	= gnm_suffix;
 #ifdef LDD_SUFFIX
-  const char *const ldd_suffix	= LDD_SUFFIX;
+  static const char *const ldd_suffix	= LDD_SUFFIX;
   const char *full_ldd_suffix	= ldd_suffix;
 #endif
-  const char *const strip_suffix = "strip";
+  static const char *const strip_suffix = "strip";
   const char *full_strip_suffix = strip_suffix;
-  const char *const gstrip_suffix = "gstrip";
+  static const char *const gstrip_suffix = "gstrip";
   const char *full_gstrip_suffix = gstrip_suffix;
   const char *arg;
   FILE *outf;
diff -rup orig/egcs-CVS20010912/gcc/config/1750a/1750a.c egcs-CVS20010912/gcc/config/1750a/1750a.c
--- orig/egcs-CVS20010912/gcc/config/1750a/1750a.c	Sun Jul  8 07:30:23 2001
+++ egcs-CVS20010912/gcc/config/1750a/1750a.c	Wed Sep 12 17:19:42 2001
@@ -304,7 +304,7 @@ mod_regno_adjust (instr, op)
      rtx *op;
 {
   static char outstr[40];
-  const char *r = (!strncmp (instr, "dvr", 3) ? "r" : "");
+  const char *const r = (!strncmp (instr, "dvr", 3) ? "r" : "");
   int modregno_gcc = REGNO (op[3]), modregno_1750 = REGNO (op[0]) + 1;
 
   if (modregno_gcc == modregno_1750
diff -rup orig/egcs-CVS20010912/gcc/config/alpha/alpha.c egcs-CVS20010912/gcc/config/alpha/alpha.c
--- orig/egcs-CVS20010912/gcc/config/alpha/alpha.c	Tue Sep 11 07:30:16 2001
+++ egcs-CVS20010912/gcc/config/alpha/alpha.c	Wed Sep 12 17:28:35 2001
@@ -7735,7 +7735,7 @@ alpha_write_one_linkage (node, data)
      splay_tree_node node;
      void *data;
 {
-  const char *name = (const char *) node->key;
+  const char *const name = (const char *) node->key;
   struct alpha_links *links = (struct alpha_links *) node->value;
   FILE *stream = (FILE *) data;
 
@@ -8438,7 +8438,7 @@ static void
 unicosmk_output_default_externs (file)
 	FILE *file;
 {
-  static const char *externs[] =
+  static const char *const externs[] =
     { "__T3E_MISMATCH" };
 
   int i;
diff -rup orig/egcs-CVS20010912/gcc/config/arm/arm.c egcs-CVS20010912/gcc/config/arm/arm.c
--- orig/egcs-CVS20010912/gcc/config/arm/arm.c	Wed Sep 12 12:05:25 2001
+++ egcs-CVS20010912/gcc/config/arm/arm.c	Wed Sep 12 16:04:32 2001
@@ -283,7 +283,7 @@ rtx arm_target_insn;
 int arm_target_label;
 
 /* The condition codes of the ARM, and the inverse function.  */
-const char *const arm_condition_codes[] =
+static const char *const arm_condition_codes[] =
 {
   "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc",
   "hi", "ls", "ge", "lt", "gt", "le", "al", "nv"
diff -rup orig/egcs-CVS20010912/gcc/config/arm/arm.h egcs-CVS20010912/gcc/config/arm/arm.h
--- orig/egcs-CVS20010912/gcc/config/arm/arm.h	Wed Sep 12 12:05:25 2001
+++ egcs-CVS20010912/gcc/config/arm/arm.h	Wed Sep 12 16:05:02 2001
@@ -61,7 +61,6 @@ typedef enum arm_cond_code
 arm_cc;
 
 extern arm_cc arm_current_cc;
-extern const char *const arm_condition_codes[];
 
 #define ARM_INVERSE_CONDITION_CODE(X)  ((arm_cc) (((int)X) ^ 1))
 
diff -rup orig/egcs-CVS20010912/gcc/config/avr/avr.c egcs-CVS20010912/gcc/config/avr/avr.c
--- orig/egcs-CVS20010912/gcc/config/avr/avr.c	Wed Sep 12 12:05:25 2001
+++ egcs-CVS20010912/gcc/config/avr/avr.c	Wed Sep 12 16:59:20 2001
@@ -2363,7 +2363,7 @@ output_movsisf(insn, operands, l)
 	  
 	  if (GET_CODE (src) == CONST_INT)
 	    {
-	      const char *clr_op0 =
+	      const char *const clr_op0 =
 		AVR_ENHANCED ? (AS1 (clr,%A0) CR_TAB
 				AS1 (clr,%B0) CR_TAB
 				AS2 (movw,%C0,%A0))
@@ -4756,7 +4756,7 @@ encode_section_info (decl)
 	   && TREE_CODE (decl) == VAR_DECL
 	   && avr_progmem_p (decl))
     {
-      const char *const dsec = ".progmem.data";
+      static const char *const dsec = ".progmem.data";
       DECL_SECTION_NAME (decl) = build_string (strlen (dsec), dsec);
       TREE_READONLY (decl) = 1;
     }
diff -rup orig/egcs-CVS20010912/gcc/config/darwin.h egcs-CVS20010912/gcc/config/darwin.h
--- orig/egcs-CVS20010912/gcc/config/darwin.h	Wed Sep 12 12:05:26 2001
+++ egcs-CVS20010912/gcc/config/darwin.h	Wed Sep 12 17:18:32 2001
@@ -719,7 +719,7 @@ enum machopic_addr_class {
 
 #define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH)		\
   do {								\
-    const char *stub_ = (STUB);					\
+    const char *const stub_ = (STUB);				\
     char *buffer_ = (BUF);					\
     strcpy (buffer_, stub_);					\
     if (stub_[0] == '"')					\
@@ -734,7 +734,7 @@ enum machopic_addr_class {
 
 #define GEN_SYMBOL_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH)	\
   do {								\
-    const char *symbol_ = (SYMBOL);				\
+    const char *const symbol_ = (SYMBOL);			\
     char *buffer_ = (BUF);					\
     if (name_needs_quotes (symbol_) && symbol_[0] != '"')	\
       {								\
diff -rup orig/egcs-CVS20010912/gcc/config/i386/i386.c egcs-CVS20010912/gcc/config/i386/i386.c
--- orig/egcs-CVS20010912/gcc/config/i386/i386.c	Wed Sep 12 12:05:26 2001
+++ egcs-CVS20010912/gcc/config/i386/i386.c	Wed Sep 12 16:18:59 2001
@@ -361,9 +361,9 @@ static int use_fast_prologue_epilogue;
 
 #define AT_BP(mode) (gen_rtx_MEM ((mode), hard_frame_pointer_rtx))
 
-const char * const hi_reg_name[] = HI_REGISTER_NAMES;
-const char * const qi_reg_name[] = QI_REGISTER_NAMES;
-const char * const qi_high_reg_name[] = QI_HIGH_REGISTER_NAMES;
+static const char *const hi_reg_name[] = HI_REGISTER_NAMES; /* names for 16 bit regs */
+static const char *const qi_reg_name[] = QI_REGISTER_NAMES; /* names for 8 bit regs (low) */
+static const char *const qi_high_reg_name[] = QI_HIGH_REGISTER_NAMES; /* names for 8 bit regs (high) */
 
 /* Array of the smallest class containing reg number REGNO, indexed by
    REGNO.  Used by REGNO_REG_CLASS in i386.h.  */
diff -rup orig/egcs-CVS20010912/gcc/config/i386/i386.h egcs-CVS20010912/gcc/config/i386/i386.h
--- orig/egcs-CVS20010912/gcc/config/i386/i386.h	Sat Sep  8 07:30:38 2001
+++ egcs-CVS20010912/gcc/config/i386/i386.h	Wed Sep 12 16:18:44 2001
@@ -3095,9 +3095,6 @@ extern const char *ix86_branch_cost_stri
 extern int ix86_regparm;			/* ix86_regparm_string as a number */
 extern int ix86_preferred_stack_boundary;	/* preferred stack boundary alignment in bits */
 extern int ix86_branch_cost;			/* values 1-5: see jump.c */
-extern const char * const hi_reg_name[];	/* names for 16 bit regs */
-extern const char * const qi_reg_name[];	/* names for 8 bit regs (low) */
-extern const char * const qi_high_reg_name[];	/* names for 8 bit regs (high) */
 extern enum reg_class const regclass_map[];	/* smalled class containing REGNO */
 extern struct rtx_def *ix86_compare_op0;	/* operand 0 for comparisons */
 extern struct rtx_def *ix86_compare_op1;	/* operand 1 for comparisons */
diff -rup orig/egcs-CVS20010912/gcc/config/m88k/m88k.c egcs-CVS20010912/gcc/config/m88k/m88k.c
--- orig/egcs-CVS20010912/gcc/config/m88k/m88k.c	Wed Sep 12 12:05:26 2001
+++ egcs-CVS20010912/gcc/config/m88k/m88k.c	Wed Sep 12 17:21:14 2001
@@ -2407,7 +2407,7 @@ output_function_profiler (file, labelno,
 {
   char label[256];
   char dbi[256];
-  const char *temp = (savep ? reg_names[2] : reg_names[10]);
+  const char *const temp = (savep ? reg_names[2] : reg_names[10]);
 
   /* Remember to update FUNCTION_PROFILER_LENGTH.  */
 
diff -rup orig/egcs-CVS20010912/gcc/config/mips/mips.c egcs-CVS20010912/gcc/config/mips/mips.c
--- orig/egcs-CVS20010912/gcc/config/mips/mips.c	Wed Sep 12 12:05:26 2001
+++ egcs-CVS20010912/gcc/config/mips/mips.c	Wed Sep 12 16:46:09 2001
@@ -9548,7 +9548,7 @@ mips_output_conditional_branch (insn,
 	   would otherwise; that way we skip the annulled instruction
 	   in the delay slot.  */
 
-	const char *target
+	const char *const target
 	  = ((mips_branch_likely || length == 16) ? ".+16" : ".+12");
 	char *c;
 
@@ -9625,7 +9625,7 @@ mips_output_conditional_branch (insn,
 	   anything.  */
 
 	/* The target of the reversed branch.  */
-	const char *target
+	const char *const target
 	  = ((mips_branch_likely || length == 20) ? ".+20" : ".+16");
 	const char *at_register = mips_reg_names[ASSEMBLER_SCRATCH_REGNUM];
 	const char *gp_register = mips_reg_names[PIC_OFFSET_TABLE_REGNUM];
diff -rup orig/egcs-CVS20010912/gcc/config/ns32k/ns32k.c egcs-CVS20010912/gcc/config/ns32k/ns32k.c
--- orig/egcs-CVS20010912/gcc/config/ns32k/ns32k.c	Sun Jul  8 07:30:33 2001
+++ egcs-CVS20010912/gcc/config/ns32k/ns32k.c	Wed Sep 12 16:10:00 2001
@@ -59,7 +59,7 @@ enum reg_class regclass_map[FIRST_PSEUDO
   FRAME_POINTER_REG, STACK_POINTER_REG
 };
 
-const char *const ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES;
+static const char *const ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES;
 
 static rtx gen_indexed_expr PARAMS ((rtx, rtx, rtx));
 static const char *singlemove_string PARAMS ((rtx *));
diff -rup orig/egcs-CVS20010912/gcc/config/ns32k/ns32k.h egcs-CVS20010912/gcc/config/ns32k/ns32k.h
--- orig/egcs-CVS20010912/gcc/config/ns32k/ns32k.h	Mon Jul  9 07:30:33 2001
+++ egcs-CVS20010912/gcc/config/ns32k/ns32k.h	Wed Sep 12 16:10:09 2001
@@ -1441,7 +1441,6 @@ do {									\
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address(FILE, ADDR)
 
 extern unsigned int ns32k_reg_class_contents[N_REG_CLASSES][1];
-extern const char *const ns32k_out_reg_names[];
 extern enum reg_class regclass_map[];		/* smallest class containing REGNO */
 
 /*
diff -rup orig/egcs-CVS20010912/gcc/config/pj/pj.c egcs-CVS20010912/gcc/config/pj/pj.c
--- orig/egcs-CVS20010912/gcc/config/pj/pj.c	Mon Aug 27 07:30:16 2001
+++ egcs-CVS20010912/gcc/config/pj/pj.c	Wed Sep 12 16:59:41 2001
@@ -400,7 +400,7 @@ pj_output_rval (op, mode, outer_op)
     }
   else if (tab && tab->handlers[mode].insn_code != CODE_FOR_nothing)
     {
-      const char *template =
+      const char *const template =
 	(const char *) insn_data[tab->handlers[mode].insn_code].output;
       if (code == NEG)
 	pj_printf (template, 0, XEXP (op, 0));
diff -rup orig/egcs-CVS20010912/gcc/config/rs6000/rs6000.c egcs-CVS20010912/gcc/config/rs6000/rs6000.c
--- orig/egcs-CVS20010912/gcc/config/rs6000/rs6000.c	Mon Sep 10 23:19:36 2001
+++ egcs-CVS20010912/gcc/config/rs6000/rs6000.c	Wed Sep 12 17:23:31 2001
@@ -8616,7 +8616,7 @@ output_call (insn, call_dest, operand_nu
 
 #define GEN_LOCAL_LABEL_FOR_SYMBOL(BUF,SYMBOL,LENGTH,N)		\
   do {								\
-    const char *symbol_ = (SYMBOL);				\
+    const char *const symbol_ = (SYMBOL);			\
     char *buffer_ = (BUF);					\
     if (symbol_[0] == '"')					\
       {								\
diff -rup orig/egcs-CVS20010912/gcc/config/sparc/sparc.c egcs-CVS20010912/gcc/config/sparc/sparc.c
--- orig/egcs-CVS20010912/gcc/config/sparc/sparc.c	Wed Sep 12 12:05:26 2001
+++ egcs-CVS20010912/gcc/config/sparc/sparc.c	Wed Sep 12 16:11:13 2001
@@ -6702,7 +6702,7 @@ sparc_flat_function_prologue (file, size
     {
       unsigned int reg_offset = current_frame_info.reg_offset;
       const char *const fp_str = reg_names[FRAME_POINTER_REGNUM];
-      const char *const t1_str = "%g1";
+      static const char *const t1_str = "%g1";
 
       /* Things get a little tricky if local variables take up more than ~4096
 	 bytes and outgoing arguments take up more than ~4096 bytes.  When that
@@ -6887,7 +6887,7 @@ sparc_flat_function_epilogue (file, size
       unsigned HOST_WIDE_INT size1;
       const char *const sp_str = reg_names[STACK_POINTER_REGNUM];
       const char *const fp_str = reg_names[FRAME_POINTER_REGNUM];
-      const char *const t1_str = "%g1";
+      static const char *const t1_str = "%g1";
 
       /* In the reload sequence, we don't need to fill the load delay
 	 slots for most of the loads, also see if we can fill the final
diff -rup orig/egcs-CVS20010912/gcc/cp/decl.c egcs-CVS20010912/gcc/cp/decl.c
--- orig/egcs-CVS20010912/gcc/cp/decl.c	Tue Sep  4 22:27:12 2001
+++ egcs-CVS20010912/gcc/cp/decl.c	Wed Sep 12 17:14:09 2001
@@ -3028,9 +3028,9 @@ static void
 warn_extern_redeclared_static (newdecl, olddecl)
      tree newdecl, olddecl;
 {
-  static const char *explicit_extern_static_warning
+  static const char *const explicit_extern_static_warning
     = "`%D' was declared `extern' and later `static'";
-  static const char *implicit_extern_static_warning
+  static const char *const implicit_extern_static_warning
     = "`%D' was declared implicitly `extern' and later `static'";
 
   tree name;
@@ -6574,7 +6574,7 @@ cp_make_fname_decl (id, type_dep)
      tree id;
      int type_dep;
 {
-  const char *name = (type_dep && processing_template_decl
+  const char *const name = (type_dep && processing_template_decl
 		      ? NULL : fname_as_string (type_dep));
   tree init = cp_fname_init (name);
   tree decl = build_decl (VAR_DECL, id, TREE_TYPE (init));
diff -rup orig/egcs-CVS20010912/gcc/cp/pt.c egcs-CVS20010912/gcc/cp/pt.c
--- orig/egcs-CVS20010912/gcc/cp/pt.c	Thu Sep  6 23:23:57 2001
+++ egcs-CVS20010912/gcc/cp/pt.c	Wed Sep 12 17:14:23 2001
@@ -5992,7 +5992,7 @@ tsubst_decl (t, args, type)
 	/* For __PRETTY_FUNCTION__ we have to adjust the initializer.  */
 	if (DECL_PRETTY_FUNCTION_P (r))
 	  {
-	    const char *name = (*decl_printable_name)
+	    const char *const name = (*decl_printable_name)
 	      			(current_function_decl, 2);
 	    DECL_INITIAL (r) = cp_fname_init (name);
 	    TREE_TYPE (r) = TREE_TYPE (DECL_INITIAL (r));
diff -rup orig/egcs-CVS20010912/gcc/dbxout.c egcs-CVS20010912/gcc/dbxout.c
--- orig/egcs-CVS20010912/gcc/dbxout.c	Mon Sep 10 23:19:32 2001
+++ egcs-CVS20010912/gcc/dbxout.c	Wed Sep 12 17:10:48 2001
@@ -2566,7 +2566,7 @@ dbxout_parms (parms)
 	       living on the stack.  DECL_RTL looks like
 	       (MEM (MEM (PLUS (REG ...) (CONST_INT ...)))) or it
 	       could look like (MEM (MEM (REG))).  */
-	    const char *decl_name = (DECL_NAME (parms)
+	    const char *const decl_name = (DECL_NAME (parms)
 				     ? IDENTIFIER_POINTER (DECL_NAME (parms))
 				     : "(anon)");
            if (GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 0)) == REG)
diff -rup orig/egcs-CVS20010912/gcc/diagnostic.c egcs-CVS20010912/gcc/diagnostic.c
--- orig/egcs-CVS20010912/gcc/diagnostic.c	Tue Aug 28 07:30:11 2001
+++ egcs-CVS20010912/gcc/diagnostic.c	Wed Sep 12 17:11:30 2001
@@ -866,7 +866,7 @@ format_with_decl (buffer, decl)
   
   if (*p == '%')		/* Print the name.  */
     {
-      const char *n = (DECL_NAME (decl)
+      const char *const n = (DECL_NAME (decl)
 		 ? (*decl_printable_name) (decl, 2)
 		 : _("((anonymous))"));
       output_add_string (buffer, n);
diff -rup orig/egcs-CVS20010912/gcc/dwarf2out.c egcs-CVS20010912/gcc/dwarf2out.c
--- orig/egcs-CVS20010912/gcc/dwarf2out.c	Wed Sep 12 12:05:27 2001
+++ egcs-CVS20010912/gcc/dwarf2out.c	Wed Sep 12 15:55:26 2001
@@ -6508,7 +6508,7 @@ static void
 output_ranges ()
 {
   register unsigned i;
-  const char *const start_fmt = "Offset 0x%x";
+  static const char *const start_fmt = "Offset 0x%x";
   const char *fmt = start_fmt;
 
   for (i = 0; i < ranges_table_in_use; ++i)
diff -rup orig/egcs-CVS20010912/gcc/dwarfout.c egcs-CVS20010912/gcc/dwarfout.c
--- orig/egcs-CVS20010912/gcc/dwarfout.c	Wed Aug 22 16:30:32 2001
+++ egcs-CVS20010912/gcc/dwarfout.c	Wed Sep 12 16:52:30 2001
@@ -1849,7 +1849,7 @@ fundamental_type_code (type)
 	    && DECL_NAME (TYPE_NAME (type)) != 0
 	    && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE)
 	  {
-	    const char *name =
+	    const char *const name =
 	      IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
 
 	    if (!strcmp (name, "unsigned char"))
@@ -1908,7 +1908,7 @@ fundamental_type_code (type)
 	    && DECL_NAME (TYPE_NAME (type)) != 0
 	    && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE)
 	  {
-	    const char *name =
+	    const char *const name =
 	      IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
 
 	    /* Note that here we can run afowl of a serious bug in "classic"
diff -rup orig/egcs-CVS20010912/gcc/except.c egcs-CVS20010912/gcc/except.c
--- orig/egcs-CVS20010912/gcc/except.c	Mon Aug 27 13:28:59 2001
+++ egcs-CVS20010912/gcc/except.c	Wed Sep 12 16:47:10 2001
@@ -3409,7 +3409,7 @@ sjlj_size_of_call_site_table ()
 static void
 dw2_output_call_site_table ()
 {
-  const char *function_start_lab
+  const char *const function_start_lab
     = IDENTIFIER_POINTER (current_function_func_begin_label);
   int n = cfun->eh->call_site_data_used;
   int i;
diff -rup orig/egcs-CVS20010912/gcc/f/bad.c egcs-CVS20010912/gcc/f/bad.c
--- orig/egcs-CVS20010912/gcc/f/bad.c	Thu Apr 12 18:18:51 2001
+++ egcs-CVS20010912/gcc/f/bad.c	Wed Sep 12 16:43:25 2001
@@ -349,7 +349,7 @@ void
 ffebad_finish ()
 {
 #define MAX_SPACES 132
-  static const char *spaces
+  static const char *const spaces
   = "...>\
 \040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
 \040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\
diff -rup orig/egcs-CVS20010912/gcc/f/intrin.c egcs-CVS20010912/gcc/f/intrin.c
--- orig/egcs-CVS20010912/gcc/f/intrin.c	Thu Dec  7 22:00:25 2000
+++ egcs-CVS20010912/gcc/f/intrin.c	Wed Sep 12 17:16:36 2001
@@ -1165,9 +1165,9 @@ ffeintrin_check_any_ (ffebld arglist)
 static int
 ffeintrin_cmp_name_ (const void *name, const void *intrinsic)
 {
-  const char *uc = ((const struct _ffeintrin_name_ *) intrinsic)->name_uc;
-  const char *lc = ((const struct _ffeintrin_name_ *) intrinsic)->name_lc;
-  const char *ic = ((const struct _ffeintrin_name_ *) intrinsic)->name_ic;
+  const char *const uc = ((const struct _ffeintrin_name_ *) intrinsic)->name_uc;
+  const char *const lc = ((const struct _ffeintrin_name_ *) intrinsic)->name_lc;
+  const char *const ic = ((const struct _ffeintrin_name_ *) intrinsic)->name_ic;
 
   return ffesrc_strcmp_2c (ffe_case_intrin (), name, uc, lc, ic);
 }
diff -rup orig/egcs-CVS20010912/gcc/f/stc.c egcs-CVS20010912/gcc/f/stc.c
--- orig/egcs-CVS20010912/gcc/f/stc.c	Wed Sep 12 12:05:27 2001
+++ egcs-CVS20010912/gcc/f/stc.c	Wed Sep 12 16:01:22 2001
@@ -10203,8 +10203,7 @@ ffestc_R904 ()
 {
   int i;
   int expect_file;
-  const char *const status_strs[]
-  =
+  static const char *const status_strs[] =
   {
     "New",
     "Old",
@@ -10212,29 +10211,25 @@ ffestc_R904 ()
     "Scratch",
     "Unknown"
   };
-  const char *const access_strs[]
-  =
+  static const char *const access_strs[] =
   {
     "Append",
     "Direct",
     "Keyed",
     "Sequential"
   };
-  const char *const blank_strs[]
-  =
+  static const char *const blank_strs[] =
   {
     "Null",
     "Zero"
   };
-  const char *const carriagecontrol_strs[]
-  =
+  static const char *const carriagecontrol_strs[] =
   {
     "Fortran",
     "List",
     "None"
   };
-  const char *const dispose_strs[]
-  =
+  static const char *const dispose_strs[] =
   {
     "Delete",
     "Keep",
@@ -10244,42 +10239,36 @@ ffestc_R904 ()
     "Submit",
     "Submit/Delete"
   };
-  const char *const form_strs[]
-  =
+  static const char *const form_strs[] =
   {
     "Formatted",
     "Unformatted"
   };
-  const char *const organization_strs[]
-  =
+  static const char *const organization_strs[] =
   {
     "Indexed",
     "Relative",
     "Sequential"
   };
-  const char *const position_strs[]
-  =
+  static const char *const position_strs[] =
   {
     "Append",
     "AsIs",
     "Rewind"
   };
-  const char *const action_strs[]
-  =
+  static const char *const action_strs[] =
   {
     "Read",
     "ReadWrite",
     "Write"
   };
-  const char *const delim_strs[]
-  =
+  static const char *const delim_strs[] =
   {
     "Apostrophe",
     "None",
     "Quote"
   };
-  const char *const recordtype_strs[]
-  =
+  static const char *const recordtype_strs[] =
   {
     "Fixed",
     "Segmented",
@@ -10288,8 +10277,7 @@ ffestc_R904 ()
     "Stream_LF",
     "Variable"
   };
-  const char *const pad_strs[]
-  =
+  static const char *const pad_strs[] =
   {
     "No",
     "Yes"
@@ -10458,8 +10446,7 @@ ffestc_R904 ()
 void
 ffestc_R907 ()
 {
-  const char *const status_strs[]
-  =
+  static const char *const status_strs[] =
   {
     "Delete",
     "Keep",
diff -rup orig/egcs-CVS20010912/gcc/gcc.c egcs-CVS20010912/gcc/gcc.c
--- orig/egcs-CVS20010912/gcc/gcc.c	Wed Sep 12 12:05:27 2001
+++ egcs-CVS20010912/gcc/gcc.c	Wed Sep 12 16:54:48 2001
@@ -4580,7 +4580,7 @@ do_spec_1 (spec, inswitch, soft_matched_
 
 	  case 'C':
 	    {
-	      const char* spec 
+	      const char *const spec
 		= (input_file_compiler->cpp_spec 
 		   ? input_file_compiler->cpp_spec 
 		   : cpp_spec);
diff -rup orig/egcs-CVS20010912/gcc/genopinit.c egcs-CVS20010912/gcc/genopinit.c
--- orig/egcs-CVS20010912/gcc/genopinit.c	Wed Aug 22 16:30:40 2001
+++ egcs-CVS20010912/gcc/genopinit.c	Wed Sep 12 15:51:00 2001
@@ -56,7 +56,7 @@ Software Foundation, 59 Temple Place - S
    used for comparisons.  In that case, $c and $C are the lower-case and
    upper-case forms of the comparison, respectively.  */
 
-const char * const optabs[] =
+static const char * const optabs[] =
 { "extendtab[$B][$A][0] = CODE_FOR_$(extend$a$b2$)",
   "extendtab[$B][$A][1] = CODE_FOR_$(zero_extend$a$b2$)",
   "fixtab[$A][$B][0] = CODE_FOR_$(fix$F$a$I$b2$)",
diff -rup orig/egcs-CVS20010912/gcc/java/expr.c egcs-CVS20010912/gcc/java/expr.c
--- orig/egcs-CVS20010912/gcc/java/expr.c	Sat Aug 18 07:30:30 2001
+++ egcs-CVS20010912/gcc/java/expr.c	Wed Sep 12 16:44:10 2001
@@ -1916,7 +1916,7 @@ expand_invoke (opcode, method_ref_index,
   tree method_name = COMPONENT_REF_NAME (&current_jcf->cpool, method_ref_index);
   tree self_type = get_class_constant
     (current_jcf, COMPONENT_REF_CLASS_INDEX(&current_jcf->cpool, method_ref_index));
-  const char *self_name
+  const char *const self_name
     = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (self_type)));
   tree call, func, method, arg_list, method_type;
   tree check = NULL_TREE;
diff -rup orig/egcs-CVS20010912/gcc/java/parse.y egcs-CVS20010912/gcc/java/parse.y
--- orig/egcs-CVS20010912/gcc/java/parse.y	Wed Sep 12 12:05:28 2001
+++ egcs-CVS20010912/gcc/java/parse.y	Wed Sep 12 17:17:19 2001
@@ -10308,15 +10308,15 @@ patch_method_invocation (patch, primary,
       /* Calls to clone() on array types are permitted as a special-case. */
       && !is_array_clone_call)
     {
-      const char *fct_name = IDENTIFIER_POINTER (DECL_NAME (list));
-      const char *access =
+      const char *const fct_name = IDENTIFIER_POINTER (DECL_NAME (list));
+      const char *const access =
 	java_accstring_lookup (get_access_flags_from_decl (list));
-      const char *klass =
+      const char *const klass =
 	IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (list))));
-      const char *refklass =
+      const char *const refklass =
 	IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)));
-      const char *what = (DECL_CONSTRUCTOR_P (list)
-			  ? "constructor" : "method");
+      const char *const what = (DECL_CONSTRUCTOR_P (list)
+				? "constructor" : "method");
       /* FIXME: WFL yields the wrong message here but I don't know
 	 what else to use.  */
       parse_error_context (wfl,
@@ -14828,7 +14828,7 @@ array_constructor_check_entry (type, ent
   /* Check and report errors */
   if (!new_value)
     {
-      const char *msg = (!valid_cast_to_p (type_value, type) ?
+      const char *const msg = (!valid_cast_to_p (type_value, type) ?
 		   "Can't" : "Explicit cast needed to");
       if (!array_type_string)
 	array_type_string = xstrdup (lang_printable_name (type, 1));
diff -rup orig/egcs-CVS20010912/gcc/objc/objc-act.c egcs-CVS20010912/gcc/objc/objc-act.c
--- orig/egcs-CVS20010912/gcc/objc/objc-act.c	Wed Sep  5 22:41:23 2001
+++ egcs-CVS20010912/gcc/objc/objc-act.c	Wed Sep 12 16:56:47 2001
@@ -4618,7 +4618,7 @@ synth_id_with_class_suffix (preamble, ct
   if (TREE_CODE (ctxt) == CLASS_IMPLEMENTATION_TYPE
       || TREE_CODE (ctxt) == CLASS_INTERFACE_TYPE)
     {
-      const char *class_name
+      const char *const class_name
 	= IDENTIFIER_POINTER (CLASS_NAME (implementation_context));
       string = (char *) alloca (strlen (preamble) + strlen (class_name) + 3);
       sprintf (string, "%s_%s", preamble,
@@ -4628,9 +4628,9 @@ synth_id_with_class_suffix (preamble, ct
 	   || TREE_CODE (ctxt) == CATEGORY_INTERFACE_TYPE)
     {
       /* We have a category.  */
-      const char *class_name
+      const char *const class_name
 	= IDENTIFIER_POINTER (CLASS_NAME (implementation_context));
-      const char *class_super_name
+      const char *const class_super_name
 	= IDENTIFIER_POINTER (CLASS_SUPER_NAME (implementation_context));
       string = (char *) alloca (strlen (preamble)
 				+ strlen (class_name)
@@ -6252,7 +6252,7 @@ start_class (code, class_name, super_nam
 	  && (super_name != CLASS_SUPER_NAME (implementation_template)))
         {
 	  tree previous_name = CLASS_SUPER_NAME (implementation_template);
-          const char *name =
+          const char *const name =
 	    previous_name ? IDENTIFIER_POINTER (previous_name) : "";
 	  error ("conflicting super class name `%s'",
 		 IDENTIFIER_POINTER (super_name));
@@ -8046,7 +8046,7 @@ gen_declaration_1 (atype_or_adecl, buf)
 	  || TREE_CODE (atype_or_adecl) == PARM_DECL
 	  || TREE_CODE (atype_or_adecl) == FUNCTION_DECL)
 	{
-	  const char *decl_name =
+	  const char *const decl_name =
 	    (DECL_NAME (atype_or_adecl)
 	     ? IDENTIFIER_POINTER (DECL_NAME (atype_or_adecl)) : "");
 
@@ -8506,7 +8506,7 @@ handle_impent (impent)
 
   if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
     {
-      const char *class_name =
+      const char *const class_name =
 	IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context));
 
       string = (char *) alloca (strlen (class_name) + 30);
@@ -8516,9 +8516,9 @@ handle_impent (impent)
     }
   else if (TREE_CODE (impent->imp_context) == CATEGORY_IMPLEMENTATION_TYPE)
     {
-      const char *class_name =
+      const char *const class_name =
 	IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context));
-      const char *class_super_name =
+      const char *const class_super_name =
         IDENTIFIER_POINTER (CLASS_SUPER_NAME (impent->imp_context));
 
       string = (char *) alloca (strlen (class_name)
diff -rup orig/egcs-CVS20010912/gcc/protoize.c egcs-CVS20010912/gcc/protoize.c
--- orig/egcs-CVS20010912/gcc/protoize.c	Wed Sep 12 12:05:28 2001
+++ egcs-CVS20010912/gcc/protoize.c	Wed Sep 12 17:12:20 2001
@@ -205,7 +205,7 @@ static const int hash_mask = (HASH_TABLE
 #define LOCAL_INCLUDE_DIR "/usr/local/include"
 #endif
 
-struct default_include { const char *const fname; 
+static const struct default_include { const char *const fname; 
 			 const char *const component;
 			 int x1, x2; } include_defaults[]
 #ifdef INCLUDE_DEFAULTS
@@ -743,7 +743,7 @@ static int
 in_system_include_dir (path)
      const char *path;
 {
-  struct default_include *p;
+  const struct default_include *p;
 
   if (! is_abspath (path))
     abort ();		/* Must be an absolutized filename.  */
@@ -1195,7 +1195,7 @@ abspath (cwd, rel_filename)
      const char *rel_filename;
 {
   /* Setup the current working directory as needed.  */
-  const char *cwd2 = (cwd) ? cwd : cwd_buffer;
+  const char *const cwd2 = (cwd) ? cwd : cwd_buffer;
   char *const abs_buffer
     = (char *) alloca (strlen (cwd2) + strlen (rel_filename) + 2);
   char *endp = abs_buffer;
diff -rup orig/egcs-CVS20010912/gcc/sched-vis.c egcs-CVS20010912/gcc/sched-vis.c
--- orig/egcs-CVS20010912/gcc/sched-vis.c	Wed Sep 12 12:05:28 2001
+++ egcs-CVS20010912/gcc/sched-vis.c	Wed Sep 12 15:57:42 2001
@@ -905,7 +905,7 @@ void
 visualize_stall_cycles (stalls)
      int stalls;
 {
-  const char *const prefix = ";;       ";
+  static const char *const prefix = ";;       ";
   const char *suffix = "\n";
   char *p;
 
diff -rup orig/egcs-CVS20010912/gcc/sdbout.c egcs-CVS20010912/gcc/sdbout.c
--- orig/egcs-CVS20010912/gcc/sdbout.c	Mon Sep 10 07:30:34 2001
+++ egcs-CVS20010912/gcc/sdbout.c	Wed Sep 12 16:39:21 2001
@@ -516,7 +516,7 @@ plain_type_1 (type, level)
 	    && DECL_NAME (TYPE_NAME (type)) != 0
 	    && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE)
 	  {
-	    const char *name
+	    const char *const name
 	      = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
 
 	    if (!strcmp (name, "char"))
@@ -1679,7 +1679,7 @@ sdbout_end_function (line)
 static void
 sdbout_end_epilogue ()
 {
-  const char *name
+  const char *const name
     = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
 
 #ifdef PUT_SDB_EPILOGUE_END
diff -rup orig/egcs-CVS20010912/gcc/varasm.c egcs-CVS20010912/gcc/varasm.c
--- orig/egcs-CVS20010912/gcc/varasm.c	Wed Sep 12 12:05:29 2001
+++ egcs-CVS20010912/gcc/varasm.c	Wed Sep 12 16:21:41 2001
@@ -747,7 +747,7 @@ decode_reg_name (asmspec)
 
 #ifdef ADDITIONAL_REGISTER_NAMES
       {
-	static struct { const char *const name; int number; } table[]
+	static const struct { const char *const name; const int number; } table[]
 	  = ADDITIONAL_REGISTER_NAMES;
 
 	for (i = 0; i < (int) ARRAY_SIZE (table); i++)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]