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]

Re: (i386-linux x sh-elf) build breakage


On Jul 17, 2000, Richard Henderson <rth@cygnus.com> wrote:

> +      Ought to rewrite insn_addresses into a varray so that it can
> +      easily be extended.  */

There you are.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makefile.in (INSN_ATTR_H): New macro.  Replace all dependencies
	on insn-attr.h with it.
	* genattr.c (insn_addresses): Renamed to...
	(insn_addresses_): to catch old uses.
	(INSN_ADDRESSES_DEFN, INSN_ADDRESSES, INSN_ADDRESSES_ALLOC,
	INSN_ADDRESSES_FREE, INSN_ADDRESSES_SET_P, INSN_ADDRESSES_SIZE,
	INSN_ADDRESSES_PUSH): New macros for insn-attr.h.
	* genattrtab.c (write_test_expr): Use new macros.
	* final.c (insn_addresses, init_insn_lengths): Likewise.
	(align_fuzz, shorten_branches): Likewise.
	(final): Likewise.  Do not reject new insns if their addresses
	have been added to INSN_ADDRESSES.
	* config/arm/arm.c, config/avr/avr.c: Use new macros.
	* config/h8300/h8300.c, config/i370/i370.c: Likewise.
	* config/m88k/m88k.c, config/pa/pa.c, config/pa/pa.md: Likewise.
	* config/sparc/sparc.c, config/sparc/sparc.md: Likewise.
	* config/sh/sh.c: Likewise.
	(output_branchy_insn): Push address of new label.

Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.482
diff -u -r1.482 Makefile.in
--- gcc/Makefile.in	2000/07/18 23:46:11	1.482
+++ gcc/Makefile.in	2000/07/20 09:01:00
@@ -777,6 +777,7 @@
 GCC_H = gcc.h version.h
 GGC_H = ggc.h varray.h
 TIMEVAR_H = timevar.h timevar.def
+INSN_ATTR_H = insn-attr.h $(srcdir)/varray.h
 #
 # Language makefile fragments.
 
@@ -1238,9 +1239,9 @@
    $(RTL_H) ggc.h
 diagnostic.o : diagnostic.c diagnostic.h \
    $(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \
-   $(GGC_H) input.h insn-attr.h insn-codes.h insn-config.h toplev.h intl.h 
+   $(GGC_H) input.h $(INSN_ATTR_H) insn-codes.h insn-config.h toplev.h intl.h 
 toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
-   flags.h input.h insn-attr.h xcoffout.h defaults.h output.h diagnostic.h \
+   flags.h input.h $(INSN_ATTR_H) xcoffout.h defaults.h output.h diagnostic.h \
    insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
    dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
    graph.h loop.h  except.h regs.h $(TIMEVAR_H) $(lang_options_files)
@@ -1310,7 +1311,7 @@
    intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H)
 jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
    insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
-   toplev.h insn-attr.h
+   toplev.h $(INSN_ATTR_H)
 
 simplify-rtx.o : simplify-rtx.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
    hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
@@ -1324,9 +1325,9 @@
    hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
 resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \
    $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
-   insn-attr.h except.h
+   $(INSN_ATTR_H) except.h
 lcm.o : lcm.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
-   real.h insn-config.h insn-attr.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H)
+   real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H)
 ssa.o : ssa.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) $(BASIC_BLOCK_H) \
    output.h insn-config.h
 conflict.o : conflict.c $(CONFIG_H) system.h $(OBSTACK_H) $(HASHTAB_H) \
@@ -1344,14 +1345,14 @@
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
    insn-flags.h function.h except.h $(EXPR_H)
 combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h function.h \
-   insn-config.h insn-flags.h insn-codes.h insn-attr.h $(REGS_H) $(EXPR_H) \
+   insn-config.h insn-flags.h insn-codes.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
    $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h
 regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
    $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
    toplev.h function.h output.h $(GGC_H)
 local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
-   output.h function.h insn-attr.h toplev.h
+   output.h function.h $(INSN_ATTR_H) toplev.h
 bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
    $(REGS_H)
 global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h function.h \
@@ -1367,7 +1368,7 @@
    $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
    $(RECOG_H) reload.h $(EXPR_H) toplev.h
 reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
-   $(BASIC_BLOCK_H) $(REGS_H) insn-config.h insn-attr.h insn-flags.h \
+   $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) insn-flags.h \
    $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h
 alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
    $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h $(GGC_H) function.h \
@@ -1377,14 +1378,14 @@
    $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
 haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) \
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
-   insn-attr.h toplev.h $(RECOG_H) except.h
+   $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
 final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
-   $(REGS_H) $(RECOG_H) conditions.h insn-config.h insn-attr.h function.h \
+   $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
    real.h output.h hard-reg-set.h insn-flags.h insn-codes.h gstab.h except.h \
    xcoffout.h defaults.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h \
    dbxout.h $(BASIC_BLOCK_H)
 recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) function.h $(BASIC_BLOCK_H) \
-   $(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
+   $(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h $(INSN_ATTR_H) \
    insn-flags.h insn-codes.h real.h toplev.h output.h
 reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) $(RECOG_H) \
    $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h \
@@ -1405,7 +1406,7 @@
    output.h
 $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
    $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
-   insn-flags.h output.h insn-attr.h insn-codes.h system.h toplev.h function.h
+   insn-flags.h output.h $(INSN_ATTR_H) insn-codes.h system.h toplev.h function.h
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file)
 
 # Build auxiliary files that support ecoff format.
@@ -1528,7 +1529,7 @@
 	touch s-peep
 
 insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
-    output.h insn-attr.h insn-config.h system.h toplev.h $(RECOG_H)
+    output.h $(INSN_ATTR_H) insn-config.h system.h toplev.h $(RECOG_H)
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
 
 insn-attr.h: s-attr ; @true
@@ -1544,7 +1545,7 @@
 	touch s-attrtab
 
 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \
-    conditions.h hard-reg-set.h insn-config.h insn-flags.h insn-attr.h \
+    conditions.h hard-reg-set.h insn-config.h insn-flags.h $(INSN_ATTR_H) \
     output.h $(RECOG_H) function.h insn-codes.h system.h toplev.h flags.h
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
 
Index: gcc/genattr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genattr.c,v
retrieving revision 1.36
diff -u -r1.36 genattr.c
--- gcc/genattr.c	2000/05/18 22:05:14	1.36
+++ gcc/genattr.c	2000/07/20 09:01:03
@@ -126,8 +126,19 @@
       printf ("extern int insn_default_length PARAMS ((rtx));\n");
       printf ("extern int insn_variable_length_p PARAMS ((rtx));\n");
       printf ("extern int insn_current_length PARAMS ((rtx));\n\n");
-      printf ("extern int *insn_addresses;\n");
+      printf ("#include \"varray.h\"\n\n");
+      printf ("extern varray_type insn_addresses_;\n");
       printf ("extern int insn_current_address;\n\n");
+      printf ("#define INSN_ADDRESSES_DEFN() varray_type insn_addresses_\n");
+      printf ("#define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id))\n");
+      printf ("#define INSN_ADDRESSES_ALLOC(size) do { \\\n\
+  VARRAY_INT_INIT (insn_addresses_, (size), \"insn_addresses\"); \\\n\
+  VARRAY_ACTIVE_SIZE (insn_addresses_) = (size); \\\n\
+} while (0)\n");
+      printf ("#define INSN_ADDRESSES_FREE() VARRAY_FREE (insn_addresses_)\n");
+      printf ("#define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)\n");
+      printf ("#define INSN_ADDRESSES_SIZE() VARRAY_ACTIVE_SIZE (insn_addresses_)\n");
+      printf ("#define INSN_ADDRESSES_PUSH(v) VARRAY_PUSH_INT (insn_addresses_, (v))\n\n");
     }
 }
 
Index: gcc/genattrtab.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genattrtab.c,v
retrieving revision 1.78
diff -u -r1.78 genattrtab.c
--- gcc/genattrtab.c	2000/06/27 10:24:38	1.78
+++ gcc/genattrtab.c	2000/07/20 09:01:04
@@ -4662,7 +4662,7 @@
 
     /* The address of the branch target.  */
     case MATCH_DUP:
-      printf ("insn_addresses[INSN_UID (GET_CODE (operands[%d]) == LABEL_REF ? XEXP (operands[%d], 0) : operands[%d])]",
+      printf ("INSN_ADDRESSES (INSN_UID (GET_CODE (operands[%d]) == LABEL_REF ? XEXP (operands[%d], 0) : operands[%d]))",
 	      XINT (exp, 0), XINT (exp, 0), XINT (exp, 0));
       break;
 
Index: gcc/final.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/final.c,v
retrieving revision 1.137
diff -u -r1.137 final.c
--- gcc/final.c	2000/07/13 04:40:23	1.137
+++ gcc/final.c	2000/07/20 09:01:03
@@ -612,7 +612,7 @@
    `insn_current_length'.  */
 
 static short *insn_lengths;
-int *insn_addresses;
+INSN_ADDRESSES_DEFN();
 
 /* Max uid for which the above arrays are valid.  */
 static int insn_lengths_max_uid;
@@ -665,11 +665,7 @@
       insn_lengths = 0;
       insn_lengths_max_uid = 0;
     }
-  if (insn_addresses)
-    {
-      free (insn_addresses);
-      insn_addresses = 0;
-    }
+  INSN_ADDRESSES_FREE ();
   if (uid_align)
     {
       free (uid_align);
@@ -889,7 +885,7 @@
       int align_addr, new_align;
 
       uid = INSN_UID (align_label);
-      align_addr = insn_addresses[uid] - insn_lengths[uid];
+      align_addr = INSN_ADDRESSES (uid) - insn_lengths[uid];
       if (uid_shuid[uid] > end_shuid)
 	break;
       known_align_log = LABEL_TO_ALIGNMENT (align_label);
@@ -1135,7 +1131,7 @@
   insn_lengths_max_uid = max_uid;
   /* Syntax errors can lead to labels being outside of the main insn stream.
      Initialize insn_addresses, so that we get reproducible results.  */
-  insn_addresses = (int *) xcalloc (max_uid, sizeof (int));
+  INSN_ADDRESSES_ALLOC (max_uid);
 
   varying_length = (char *) xcalloc (max_uid, sizeof (char));
 
@@ -1242,7 +1238,7 @@
 	    }
 	}
 
-      insn_addresses[uid] = insn_current_address;
+      INSN_ADDRESSES (uid) = insn_current_address;
       
       if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER
 	  || GET_CODE (insn) == CODE_LABEL)
@@ -1298,8 +1294,8 @@
 		  if ((varying_length[inner_uid]
 		       = insn_variable_length_p (inner_insn)) != 0)
 		    varying_length[uid] = 1;
-		  insn_addresses[inner_uid] = (insn_current_address +
-					       insn_lengths[uid]);
+		  INSN_ADDRESSES (inner_uid) = (insn_current_address
+						+ insn_lengths[uid]);
 		}
 	      else
 		varying_length[inner_uid] = 0;
@@ -1353,7 +1349,7 @@
 		}
 	      else
 		insn_lengths[uid] = 0;
-	      insn_addresses[uid] = insn_current_address;
+	      INSN_ADDRESSES (uid) = insn_current_address;
 	      continue;
 	    }
 
@@ -1361,8 +1357,8 @@
 	  if (length_align < insn_current_align)
 	    insn_current_align = length_align;
 
-	  insn_last_address = insn_addresses[uid];
-	  insn_addresses[uid] = insn_current_address;
+	  insn_last_address = INSN_ADDRESSES (uid);
+	  INSN_ADDRESSES (uid) = insn_current_address;
 
 #ifdef CASE_VECTOR_SHORTEN_MODE
 	  if (optimize && GET_CODE (insn) == JUMP_INSN
@@ -1374,9 +1370,9 @@
 	      rtx min_lab = XEXP (XEXP (body, 2), 0);
 	      rtx max_lab = XEXP (XEXP (body, 3), 0);
 	      addr_diff_vec_flags flags = ADDR_DIFF_VEC_FLAGS (body);
-	      int rel_addr = insn_addresses[INSN_UID (rel_lab)];
-	      int min_addr = insn_addresses[INSN_UID (min_lab)];
-	      int max_addr = insn_addresses[INSN_UID (max_lab)];
+	      int rel_addr = INSN_ADDRESSES (INSN_UID (rel_lab));
+	      int min_addr = INSN_ADDRESSES (INSN_UID (min_lab));
+	      int max_addr = INSN_ADDRESSES (INSN_UID (max_lab));
 	      rtx prev;
 	      int rel_align = 0;
 
@@ -1491,7 +1487,7 @@
 		  int inner_uid = INSN_UID (inner_insn);
 		  int inner_length;
 
-		  insn_addresses[inner_uid] = insn_current_address;
+		  INSN_ADDRESSES (inner_uid) = insn_current_address;
 
 		  /* insn_current_length returns 0 for insns with a
 		     non-varying length.  */
@@ -2018,7 +2014,7 @@
   for (insn = NEXT_INSN (first); insn;)
     {
 #ifdef HAVE_ATTR_length
-      if (INSN_UID (insn) >= insn_lengths_max_uid)
+      if (INSN_UID (insn) >= INSN_ADDRESSES_SIZE ())
 	{
 #ifdef STACK_REGS
 	  /* Irritatingly, the reg-stack pass is creating new instructions
@@ -2032,7 +2028,7 @@
 #endif
 	}
       else
-	insn_current_address = insn_addresses[INSN_UID (insn)];
+	insn_current_address = INSN_ADDRESSES (INSN_UID (insn));
 #endif /* HAVE_ATTR_length */
 
       insn = final_scan_insn (insn, file, optimize, prescan, 0);
Index: gcc/config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.c,v
retrieving revision 1.97
diff -u -r1.97 arm.c
--- gcc/config/arm/arm.c	2000/06/25 16:21:08	1.97
+++ gcc/config/arm/arm.c	2000/07/20 09:01:07
@@ -8526,10 +8526,9 @@
 thumb_final_prescan_insn (insn)
      rtx insn;
 {
-  extern int * insn_addresses;
-
   if (flag_print_asm_name)
-    asm_fprintf (asm_out_file, "%@ 0x%04x\n", insn_addresses[INSN_UID (insn)]);
+    asm_fprintf (asm_out_file, "%@ 0x%04x\n",
+		 INSN_ADDRESSES (INSN_UID (insn)));
 }
 
 int
Index: gcc/config/avr/avr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/avr/avr.c,v
retrieving revision 1.15
diff -u -r1.15 avr.c
--- gcc/config/avr/avr.c	2000/07/03 16:51:37	1.15
+++ gcc/config/avr/avr.c	2000/07/20 09:01:08
@@ -605,8 +605,8 @@
   signal_func_p = signal_function_p (current_function_decl);
   leaf_func_p = leaf_function_p ();
   main_p = ! strcmp ("main", current_function_name);
-  function_size = (insn_addresses[INSN_UID (get_last_insn ())]
-		   - insn_addresses[INSN_UID (get_insns ())]);
+  function_size = (INSN_ADDRESSES (INSN_UID (get_last_insn ()))
+		   - INSN_ADDRESSES (INSN_UID (get_insns ())));
   live_seq = sequent_regs_live ();
   minimize = (TARGET_CALL_PROLOGUES
 	      && !interrupt_func_p && !signal_func_p && live_seq);
@@ -1089,9 +1089,9 @@
      rtx x;                     /* jump operand */
      rtx insn;                  /* jump insn */
 {
-  int dest_addr = insn_addresses[INSN_UID (GET_MODE (x) == LABEL_REF
-                                           ? XEXP (x, 0) : x)];
-  int cur_addr = insn_addresses[INSN_UID (insn)];
+  int dest_addr = INSN_ADDRESSES (INSN_UID (GET_MODE (x) == LABEL_REF
+					    ? XEXP (x, 0) : x));
+  int cur_addr = INSN_ADDRESSES (INSN_UID (insn));
   int jump_distance = cur_addr - dest_addr;
   
   if (-63 <= jump_distance && jump_distance <= 62)
@@ -1212,11 +1212,12 @@
 
   if (TARGET_INSN_SIZE_DUMP || TARGET_ALL_DEBUG)
     {
-      fprintf (asm_out_file, "/*DEBUG: 0x%x\t\t%d\t%d */\n", insn_addresses[uid],
-               insn_addresses[uid] - last_insn_address,
-	       rtx_cost (PATTERN (insn),INSN));
+      fprintf (asm_out_file, "/*DEBUG: 0x%x\t\t%d\t%d */\n",
+	       INSN_ADDRESSES (uid),
+               INSN_ADDRESSES (uid) - last_insn_address,
+	       rtx_cost (PATTERN (insn), INSN));
     }
-  last_insn_address = insn_addresses[uid];
+  last_insn_address = INSN_ADDRESSES (uid);
 
   if (TARGET_RTL_DUMP)
     {
@@ -3999,8 +4000,8 @@
   int uid = INSN_UID (GET_CODE (dest) == LABEL_REF
 		      ? XEXP (dest, 0)
 		      : dest);
-  int jump_addr = insn_addresses[INSN_UID (insn)];
-  int dest_addr = insn_addresses[uid];
+  int jump_addr = INSN_ADDRESSES (INSN_UID (insn));
+  int dest_addr = INSN_ADDRESSES (uid);
   return dest_addr - jump_addr == 2;
 }
 
Index: gcc/config/h8300/h8300.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/h8300/h8300.c,v
retrieving revision 1.28
diff -u -r1.28 h8300.c
--- gcc/config/h8300/h8300.c	2000/07/17 08:55:51	1.28
+++ gcc/config/h8300/h8300.c	2000/07/20 09:01:08
@@ -1531,9 +1531,9 @@
 
   if (TARGET_ADDRESSES)
     {
-      fprintf (asm_out_file, "; 0x%x %d\n", insn_addresses[uid],
-	       insn_addresses[uid] - last_insn_address);
-      last_insn_address = insn_addresses[uid];
+      fprintf (asm_out_file, "; 0x%x %d\n", INSN_ADDRESSES (uid),
+	       INSN_ADDRESSES (uid) - last_insn_address);
+      last_insn_address = INSN_ADDRESSES (uid);
     }
 }
 
Index: gcc/config/i370/i370.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i370/i370.c,v
retrieving revision 1.11
diff -u -r1.11 i370.c
--- gcc/config/i370/i370.c	2000/04/17 00:52:30	1.11
+++ gcc/config/i370/i370.c	2000/07/20 09:01:08
@@ -323,7 +323,7 @@
     dest = XEXP (dest, 1);
   dest = XEXP (dest, 0);
   dest_uid = INSN_UID (dest);
-  dest_addr =  insn_addresses[dest_uid];
+  dest_addr = INSN_ADDRESSES (dest_uid);
 
   /* next, record the address of this insn as the true addr of first ref */
   {
@@ -344,7 +344,7 @@
      rtx insn;
 {
   int here, there;
-  here = insn_addresses[INSN_UID (insn)];
+  here = INSN_ADDRESSES (INSN_UID (insn));
   there = i370_branch_dest (insn);
   return (there - here);
 }
@@ -402,13 +402,13 @@
 
    for (insn = get_insns(); insn; insn = NEXT_INSN(insn))
      {
-       int here = insn_addresses[INSN_UID (insn)];
+       int here = INSN_ADDRESSES (INSN_UID (insn));
        enum rtx_code code = GET_CODE(insn);
 
        /* ??? adjust for tables embedded in the .text section that
         * the compiler didn't take into account */
        here += tablejump_offset;
-       insn_addresses[INSN_UID (insn)] = here;
+       INSN_ADDRESSES (INSN_UID (insn)) = here;
 
        /* check to see if this insn is a label ... */
        if (CODE_LABEL == code)
Index: gcc/config/m88k/m88k.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/m88k/m88k.c,v
retrieving revision 1.23
diff -u -r1.23 m88k.c
--- gcc/config/m88k/m88k.c	2000/05/04 13:49:50	1.23
+++ gcc/config/m88k/m88k.c	2000/07/20 09:01:09
@@ -853,8 +853,8 @@
 	  rtx low, high;
 	  const char *last;
 	  rtx dest = XEXP (SET_SRC (PATTERN (jump)), 0);
-	  int delta = 4 * (insn_addresses[INSN_UID (dest)]
-			   - insn_addresses[INSN_UID (seq_insn)]
+	  int delta = 4 * (INSN_ADDRESSES (INSN_UID (dest))
+			   - INSN_ADDRESSES (INSN_UID (seq_insn))
 			   - 2);
 #if (MONITOR_GCC & 0x2) /* How often do long branches happen?  */
 	  if ((unsigned) (delta + 0x8000) >= 0x10000)
@@ -1039,8 +1039,8 @@
     insnj = NEXT_INSN (PREV_INSN (XVECEXP (final_sequence, 0, 0)));
   else
     insnj = jump_insn;
-  if (insn_addresses[INSN_UID (insnj)]
-      > insn_addresses[INSN_UID (target_label)])
+  if (INSN_ADDRESSES (INSN_UID (insnj))
+      > INSN_ADDRESSES (INSN_UID (target_label)))
     return 0;
 
   /* EQ tests are usually false and NE tests are usually true.  Also,
Index: gcc/config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/pa/pa.c,v
retrieving revision 1.78
diff -u -r1.78 pa.c
--- gcc/config/pa/pa.c	2000/07/17 09:50:03	1.78
+++ gcc/config/pa/pa.c	2000/07/20 09:01:10
@@ -2910,11 +2910,11 @@
      we don't need to accumulate the total number of code bytes.  */
   if (TARGET_GAS && ! TARGET_PORTABLE_RUNTIME)
     total_code_bytes = 0;
-  else if (insn_addresses)
+  else if (INSN_ADDRESSES_SET_P ())
     {
       unsigned int old_total = total_code_bytes;
 
-      total_code_bytes += insn_addresses[INSN_UID (get_last_insn())];
+      total_code_bytes += INSN_ADDRESSES (INSN_UID (get_last_insn()));
       total_code_bytes += FUNCTION_BOUNDARY / BITS_PER_UNIT;
 
       /* Be prepared to handle overflows.  */
@@ -4887,9 +4887,9 @@
 	   taken and untaken branches.  */
 	else if (dbr_sequence_length () == 0
 		 && ! forward_branch_p (insn)
-		 && insn_addresses
-		 && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
-				    - insn_addresses[INSN_UID (insn)] - 8))
+		 && INSN_ADDRESSES_SET_P ()
+		 && VAL_14_BITS_P (INSN_ADDRESSES (INSN_UID (JUMP_LABEL (insn)))
+				    - INSN_ADDRESSES (INSN_UID (insn)) - 8))
 	  {
 	    strcpy (buf, "{com%I2b,|cmp%I2b,}");
 	    if (GET_MODE (operands[1]) == DImode)
@@ -5104,9 +5104,9 @@
 	   taken and untaken branches.  */
 	else if (dbr_sequence_length () == 0
 		 && ! forward_branch_p (insn)
-		 && insn_addresses
-		 && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
-				    - insn_addresses[INSN_UID (insn)] - 8))
+		 && INSN_ADDRESSES_SET_P ()
+		 && VAL_14_BITS_P (INSN_ADDRESSES (INSN_UID (JUMP_LABEL (insn)))
+				    - INSN_ADDRESSES (INSN_UID (insn)) - 8))
 	  {
 	    strcpy (buf, "bb,");
 	    if (GET_MODE (operands[0]) == DImode)
@@ -5252,9 +5252,9 @@
 	   taken and untaken branches.  */
 	else if (dbr_sequence_length () == 0
 		 && ! forward_branch_p (insn)
-		 && insn_addresses
-		 && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
-				    - insn_addresses[INSN_UID (insn)] - 8))
+		 && INSN_ADDRESSES_SET_P ()
+		 && VAL_14_BITS_P (INSN_ADDRESSES (INSN_UID (JUMP_LABEL (insn)))
+				    - INSN_ADDRESSES (INSN_UID (insn)) - 8))
 	  {
 	    strcpy (buf, "{bvb,|bb,}");
 	    if (GET_MODE (operands[0]) == DImode)
@@ -5361,9 +5361,9 @@
 	     taken and untaken branches.  */
 	  else if (dbr_sequence_length () == 0
 		   && ! forward_branch_p (insn)
-		   && insn_addresses
-		   && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
-				      - insn_addresses[INSN_UID (insn)] - 8))
+		   && INSN_ADDRESSES_SET_P ()
+		   && VAL_14_BITS_P (INSN_ADDRESSES (INSN_UID (JUMP_LABEL (insn)))
+				      - INSN_ADDRESSES (INSN_UID (insn)) - 8))
 	      return "addib,%C2 %1,%0,%3%#";
 
 	  /* Handle normal cases.  */
@@ -5469,9 +5469,9 @@
 	     taken and untaken branches.  */
 	  else if (dbr_sequence_length () == 0
 		   && ! forward_branch_p (insn)
-		   && insn_addresses
-		   && VAL_14_BITS_P (insn_addresses[INSN_UID (JUMP_LABEL (insn))]
-				      - insn_addresses[INSN_UID (insn)] - 8))
+		   && INSN_ADDRESSES_SET_P ()
+		   && VAL_14_BITS_P (INSN_ADDRESSES (INSN_UID (JUMP_LABEL (insn)))
+				      - INSN_ADDRESSES (INSN_UID (insn)) - 8))
 	    return "movb,%C2 %1,%0,%3%#";
 	  /* Handle normal cases.  */
 	  if (nullify)
@@ -5644,8 +5644,8 @@
   /* Use the containing sequence insn's address.  */
   seq_insn = NEXT_INSN (PREV_INSN (XVECEXP (final_sequence, 0, 0)));
 
-  distance = insn_addresses[INSN_UID (JUMP_LABEL (NEXT_INSN (insn)))]
-	       - insn_addresses[INSN_UID (seq_insn)] - 8;
+  distance = INSN_ADDRESSES (INSN_UID (JUMP_LABEL (NEXT_INSN (insn))))
+	       - INSN_ADDRESSES (INSN_UID (seq_insn)) - 8;
 
   /* If the branch was too far away, emit a normal call followed
      by a nop, followed by the unconditional branch.
@@ -5917,8 +5917,8 @@
   /* Use the containing sequence insn's address.  */
   seq_insn = NEXT_INSN (PREV_INSN (XVECEXP (final_sequence, 0, 0)));
 
-  distance = insn_addresses[INSN_UID (JUMP_LABEL (NEXT_INSN (insn)))]
-	       - insn_addresses[INSN_UID (seq_insn)] - 8;
+  distance = INSN_ADDRESSES (INSN_UID (JUMP_LABEL (NEXT_INSN (insn))))
+	       - INSN_ADDRESSES (INSN_UID (seq_insn)) - 8;
 
   /* If the branch was too far away, emit a normal call followed
      by a nop, followed by the unconditional branch.
Index: gcc/config/pa/pa.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/pa/pa.md,v
retrieving revision 1.67
diff -u -r1.67 pa.md
--- gcc/config/pa/pa.md	2000/04/11 20:02:45	1.67
+++ gcc/config/pa/pa.md	2000/07/20 09:01:10
@@ -2205,9 +2205,9 @@
   /* If we're trying to load the address of a label that happens to be
      close, then we can use a shorter sequence.  */
   if (GET_CODE (operands[1]) == LABEL_REF
-      && insn_addresses
-      && abs (insn_addresses[INSN_UID (XEXP (operands[1], 0))]
-	        - insn_addresses[INSN_UID (insn)]) < 8100)
+      && INSN_ADDRESSES_SET_P ()
+      && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
+	        - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
     {
       /* Prefixing with R% here is wrong, it extracts just 11 bits and is
 	 always non-negative.  */
Index: gcc/config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/sparc.c,v
retrieving revision 1.124
diff -u -r1.124 sparc.c
--- gcc/config/sparc/sparc.c	2000/06/09 14:31:54	1.124
+++ gcc/config/sparc/sparc.c	2000/07/20 09:01:12
@@ -2625,7 +2625,7 @@
 short_branch (uid1, uid2)
      int uid1, uid2;
 {
-  int delta = insn_addresses[uid1] - insn_addresses[uid2];
+  int delta = INSN_ADDRESSES (uid1) - INSN_ADDRESSES (uid2);
 
   /* Leave a few words of "slop".  */
   if (delta >= -1023 && delta <= 1022)
Index: gcc/config/sparc/sparc.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/sparc.md,v
retrieving revision 1.109
diff -u -r1.109 sparc.md
--- gcc/config/sparc/sparc.md	2000/06/23 20:34:41	1.109
+++ gcc/config/sparc/sparc.md	2000/07/20 09:01:13
@@ -8415,8 +8415,8 @@
      instead.  */
 
   if (! TARGET_V9 && flag_delayed_branch
-      && (insn_addresses[INSN_UID (operands[0])]
-	  == insn_addresses[INSN_UID (insn)]))
+      && (INSN_ADDRESSES (INSN_UID (operands[0]))
+	  == INSN_ADDRESSES (INSN_UID (insn))))
     return \"b\\t%l0%#\";
   else
     return TARGET_V9 ? \"ba,pt%*\\t%%xcc, %l0%(\" : \"b%*\\t%l0%(\";
Index: gcc/config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.c,v
retrieving revision 1.53
diff -u -r1.53 sh.c
--- gcc/config/sh/sh.c	2000/05/23 20:10:17	1.53
+++ gcc/config/sh/sh.c	2000/07/20 09:01:11
@@ -73,10 +73,6 @@
    sh_expand_prologue.  */
 int current_function_anonymous_args;
 
-/* Global variables from toplev.c and final.c that are used within, but
-   not declared in any header file.  */
-extern int *insn_addresses;
-
 /* Global variables for machine-dependent things. */
 
 /* Which cpu are we scheduling for.  */
@@ -696,7 +692,7 @@
   struct { rtx lab, reg, op; } this;
   const char *jump;
   int far;
-  int offset = branch_dest (insn) - insn_addresses[INSN_UID (insn)];
+  int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn));
 
   this.lab = gen_label_rtx ();
 
@@ -818,12 +814,20 @@
 	  /* Following branch not taken */
 	  operands[9] = gen_label_rtx ();
 	  emit_label_after (operands[9], next_insn);
+	  if (INSN_ADDRESSES_SET_P ())
+	    {
+	      if (INSN_ADDRESSES_SIZE () != INSN_UID (operands[9]))
+		abort ();
+	      else
+		INSN_ADDRESSES_PUSH (INSN_ADDRESSES (INSN_UID (next_insn))
+				     + get_attr_length (next_insn));
+	    }
 	  return template;
 	}
       else
 	{
 	  int offset = (branch_dest (next_insn)
-			- insn_addresses[INSN_UID (next_insn)] + 4);
+			- INSN_ADDRESSES (INSN_UID (next_insn)) + 4);
 	  if (offset >= -252 && offset <= 258)
 	    {
 	      if (GET_CODE (src) == IF_THEN_ELSE)
@@ -836,6 +840,14 @@
     }
   operands[9] = gen_label_rtx ();
   emit_label_after (operands[9], insn);
+  if (INSN_ADDRESSES_SET_P ())
+    {
+      if (INSN_ADDRESSES_SIZE () != INSN_UID (operands[9]))
+	abort ();
+      else
+	INSN_ADDRESSES_PUSH (INSN_ADDRESSES (INSN_UID (insn))
+			     + get_attr_length (insn));
+    }
   return template;
 }
 
@@ -2502,7 +2514,7 @@
   dest = XEXP (SET_SRC (PATTERN (jump)), 0);
   /* If the branch is out of range, try to find a scratch register for it.  */
   if (optimize
-      && (insn_addresses[INSN_UID (dest)] - addr + 4092U > 4092 + 4098))
+      && (INSN_ADDRESSES (INSN_UID (dest)) - addr + 4092U > 4092 + 4098))
     {
       rtx scan;
       /* Don't look for the stack pointer as a scratch register,
@@ -2578,8 +2590,9 @@
 	{
 	  dest = JUMP_LABEL (next);
 	  if (dest
-	      && insn_addresses[INSN_UID (dest)] - addr + 4092U > 4092 + 4098)
-	    gen_block_redirect (next, insn_addresses[INSN_UID (next)], -1);
+	      && (INSN_ADDRESSES (INSN_UID (dest)) - addr + 4092U
+		  > 4092 + 4098))
+	    gen_block_redirect (next, INSN_ADDRESSES (INSN_UID (next)), -1);
 	}
     }
 
@@ -3231,7 +3244,7 @@
     }
 
   mdep_reorg_phase = SH_SHORTEN_BRANCHES1;
-  insn_addresses = 0;
+  INSN_ADDRESSES_FREE ();
   split_branches (first);
 
   /* The INSN_REFERENCES_ARE_DELAYED in sh.h is problematic because it
@@ -3330,7 +3343,7 @@
 	      {
 		rtx src = SET_SRC (PATTERN (insn));
 		rtx olabel = XEXP (XEXP (src, 1), 0);
-		int addr = insn_addresses[INSN_UID (insn)];
+		int addr = INSN_ADDRESSES (INSN_UID (insn));
 		rtx label = 0;
 		int dest_uid = get_dest_uid (olabel, max_uid);
 		struct far_branch *bp = uid_branch[dest_uid];
@@ -3409,11 +3422,12 @@
 			    == JUMP_INSN))
 		    && GET_CODE (PATTERN (beyond)) == SET
 		    && recog_memoized (beyond) == CODE_FOR_jump
-		    && ((insn_addresses[INSN_UID (XEXP (SET_SRC (PATTERN (beyond)), 0))]
-			 - insn_addresses[INSN_UID (insn)] + 252U)
+		    && ((INSN_ADDRESSES
+			 (INSN_UID (XEXP (SET_SRC (PATTERN (beyond)), 0)))
+			 - INSN_ADDRESSES (INSN_UID (insn)) + 252U)
 			> 252 + 258 + 2))
 		  gen_block_redirect (beyond,
-				      insn_addresses[INSN_UID (beyond)], 1);
+				      INSN_ADDRESSES (INSN_UID (beyond)), 1);
 	      }
     
 	    next = next_active_insn (insn);
@@ -3422,14 +3436,15 @@
 		 || GET_CODE (next = next_active_insn (next)) == JUMP_INSN)
 		&& GET_CODE (PATTERN (next)) == SET
 		&& recog_memoized (next) == CODE_FOR_jump
-		&& ((insn_addresses[INSN_UID (XEXP (SET_SRC (PATTERN (next)), 0))]
-		     - insn_addresses[INSN_UID (insn)] + 252U)
+		&& ((INSN_ADDRESSES
+		     (INSN_UID (XEXP (SET_SRC (PATTERN (next)), 0)))
+		     - INSN_ADDRESSES (INSN_UID (insn)) + 252U)
 		    > 252 + 258 + 2))
-	      gen_block_redirect (next, insn_addresses[INSN_UID (next)], 1);
+	      gen_block_redirect (next, INSN_ADDRESSES (INSN_UID (next)), 1);
 	  }
 	else if (type == TYPE_JUMP || type == TYPE_RETURN)
 	  {
-	    int addr = insn_addresses[INSN_UID (insn)];
+	    int addr = INSN_ADDRESSES (INSN_UID (insn));
 	    rtx far_label = 0;
 	    int dest_uid = 0;
 	    struct far_branch *bp;
@@ -3524,7 +3539,7 @@
      int noperands ATTRIBUTE_UNUSED;
 {
   if (TARGET_DUMPISIZE)
-    fprintf (asm_out_file, "\n! at %04x\n", insn_addresses[INSN_UID (insn)]);
+    fprintf (asm_out_file, "\n! at %04x\n", INSN_ADDRESSES (INSN_UID (insn)));
 
   if (TARGET_RELAX)
     {
@@ -4792,7 +4807,7 @@
     dest = XEXP (dest, 1);
   dest = XEXP (dest, 0);
   dest_uid = INSN_UID (dest);
-  return insn_addresses[dest_uid];
+  return INSN_ADDRESSES (dest_uid);
 }
 
 /* Return non-zero if REG is not used after INSN.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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