OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / gcse.c
index 4665133..224dd6b 100644 (file)
@@ -386,7 +386,11 @@ static int *uid_cuid;
 static int max_uid;
 
 /* Get the cuid of an insn.  */
+#ifdef ENABLE_CHECKING
+#define INSN_CUID(INSN) (INSN_UID (INSN) > max_uid ? (abort (), 0) : uid_cuid[INSN_UID (INSN)])
+#else
 #define INSN_CUID(INSN) (uid_cuid[INSN_UID (INSN)])
+#endif
 
 /* Number of cuids.  */
 static int max_cuid;
@@ -896,9 +900,9 @@ alloc_gcse_mem (f)
   for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
     {
       if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
-       INSN_CUID (insn) = i++;
+       uid_cuid[INSN_UID (insn)] = i++;
       else
-       INSN_CUID (insn) = i;
+       uid_cuid[INSN_UID (insn)] = i;
     }
 
   /* Create a table mapping cuids to insns.  */
@@ -1136,21 +1140,8 @@ record_one_set (regno, insn)
                                                   sizeof (struct reg_set));
   bytes_used += sizeof (struct reg_set);
   new_reg_info->insn = insn;
-  new_reg_info->next = NULL;
-  if (reg_set_table[regno] == NULL)
-    reg_set_table[regno] = new_reg_info;
-  else
-    {
-      reg_info_ptr1 = reg_info_ptr2 = reg_set_table[regno];
-      /* ??? One could keep a "last" pointer to speed this up.  */
-      while (reg_info_ptr1 != NULL)
-       {
-         reg_info_ptr2 = reg_info_ptr1;
-         reg_info_ptr1 = reg_info_ptr1->next;
-       }
-
-      reg_info_ptr2->next = new_reg_info;
-    }
+  new_reg_info->next = reg_set_table[regno];
+  reg_set_table[regno] = new_reg_info;
 }
 
 /* Called from compute_sets via note_stores to handle one SET or CLOBBER in
@@ -4118,10 +4109,24 @@ free_pre_mem ()
 static void
 compute_pre_data ()
 {
+  int i;
+
   compute_local_properties (transp, comp, antloc, 0);
   compute_transpout ();
   sbitmap_vector_zero (ae_kill, n_basic_blocks);
-  compute_ae_kill (comp, ae_kill);
+
+  /* Compute ae_kill for each basic block using:
+
+     ~(TRANSP | COMP)
+
+     This is significantly faster than compute_ae_kill.  */
+
+  for (i = 0; i < n_basic_blocks; i++)
+    {
+      sbitmap_a_or_b (ae_kill[i], transp[i], comp[i]);
+      sbitmap_not (ae_kill[i], ae_kill[i]);
+    }
+
   edge_list = pre_edge_lcm (gcse_file, n_exprs, transp, comp, antloc,
                            ae_kill, &pre_insert_map, &pre_delete_map);
 }
@@ -4346,10 +4351,9 @@ insert_insn_end_bb (expr, bb, pre)
         If we inserted before the CODE_LABEL, then we would be putting
         the insn in the wrong basic block.  In that case, put the insn
         after the CODE_LABEL.  Also, respect NOTE_INSN_BASIC_BLOCK.  */
-      if (GET_CODE (insn) == CODE_LABEL)
-       insn = NEXT_INSN (insn);
-      else if (GET_CODE (insn) == NOTE
-              && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK)
+      while (GET_CODE (insn) == CODE_LABEL
+            || (GET_CODE (insn) == NOTE
+                && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK))
        insn = NEXT_INSN (insn);
 
       new_insn = emit_block_insn_before (pat, insn, BASIC_BLOCK (bb));