* rtl.h (note_stores): Add additional paramter.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Oct 1999 19:27:41 +0000 (19:27 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Oct 1999 19:27:41 +0000 (19:27 +0000)
* rtlanal.c (reg_set_p_1): Take additional paramter.
(reg_set_last_1): Likewise.
(reg_set_p): Adjust call to note_stores.
(reg_set_last): Likewise.
(note_stores): Pass data parameter to worker function.
* alias.c (record_set): Take additional parameter.
(init_alias_analysis): Pass it.
* caller-save.c (mark_set_regs): Take additional parameter.
(save_call_clobbered_regs): Pass NULL to note_stores.
* combine.c (set_nonzero_bits_and_sign_copies): Take additional
parameter.
(record_dead_and_set_regs_1): Likewise.
(reg_dead_at_p_1): Likewise.
(combine_instructions): Adjust calls to note_stores.
(try_combine): Likewise.
(record_dead_insn): Remove.
(record_dead_and_set_regs): Adjust calls to note_stores.
(reg_dead_at_p): Likewise.
* cse.c (invalidate_skipped_set): Take additional parameter.
(cse_check_loop_start): Likewise.
(cse_check_loop_start_value): Remove.
(cse_set_around_loop): Adjust calls to note_stores.
* flow.c (notice_stack_pointer_modification): Take additional
parameter.  Remove duplicate declaration.
(record_volatile_insns): Adjust calls to note_stores.
* gcse.c (record_set_info): Take additional parameter.
(record_last_set_info): Likewise.
(invalidate_nonnull_info): Likewise.
(record_set_insn): Remove.
(compute_sets): Adjust calls to note_stores.
(last_set_insn): Remove.
(compute_hash_table): Adjust calls to note_stores.
(insert_insn_end_bb): Likewise.
(delete_null_pointer_checks): Likewise.
* global.c (mark_reg_store): Take additional parameter.
(mark_reg_clobber): Likewise.
(reg_becomes_live): Likewise.
(global_conflicts): Adjust calls to note_stores.
(build_insn_chain): Likewise.
* integrate.c (note_modified_parmregs): Take additional parameter.
(mark_stores): Likewise.  Make it static.
(save_for_inline_nocopy): Adjust calls to note_stores.
(try_constants): Likewise.
* integrate.h (mark_stores): Remove declaration.
* jump.c (mark_modified_reg): Take additional parameter.
(thread_jumps): Adjust calls to note_stores.
* local-alloc.c (validate_equiv_mem_from_store): Take additional
parameter.
(no_equiv): Likewise.
(reg_is_set): Likewise.
(validate_equiv_mem): Adjust calls to note_stores.
(update_equiv_regs): Likewise.
(block_alloc): Likewise.
* loop.c (note_set_pseudo_multiple_uses_retval): Remove.
(note_addr_stored): Take additional parameter.
(note_set_pseudo_multiple_uses): Likewise.
(record_initial): Likewise.
(prescan_loop): Adjust calls to note_stores.
(strength_reduce): Likewise.
(check_dbra_loop): Likewise.
* regmove.c (flags_set_1): Take additional paramter.
(mark_flags_life_zones): Adjust calls to note_stores.
* reload1.c (mark_not_eliminable): Take additional parameter.
(forget_old_reloads_1): Likewise.
(reload_cse_invalidate_rtx): Likewise.
(reload_cse_check_clobber): Likewise.
(reload_combine_note_store): Likewise.
(move2add_note_store): Likewise.
(reload): Adjust calls to note_stores.
(reload_as_needed): Likewise.
(emit_reload_insns): Likewise.
(reload_cse_regs_1): Likewise.
(reload_cse_record_set): Adjust calls to reload_cse_invalidate_rtx.
(reload_combine): Adjust calls to note_stores.
* resource.c (update_live_status): Take additional paramter.
(mark_target_live_regs): Adjust calls to note_stores.
* stupid.c (find_clobbered_regs): Take additional parameter.
(stupid_life_analysis): Adjust calls to note_stores.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30221 138bc75d-0d04-0410-961f-82ee72b054a4

19 files changed:
gcc/ChangeLog
gcc/alias.c
gcc/caller-save.c
gcc/combine.c
gcc/cse.c
gcc/flow.c
gcc/gcse.c
gcc/global.c
gcc/integrate.c
gcc/integrate.h
gcc/jump.c
gcc/local-alloc.c
gcc/loop.c
gcc/regmove.c
gcc/reload1.c
gcc/resource.c
gcc/rtl.h
gcc/rtlanal.c
gcc/stupid.c

index 57c6916..f3cb9de 100644 (file)
@@ -1,3 +1,85 @@
+Wed Oct 27 12:33:40 1999  Mark Mitchell  <mark@codesourcery.com>
+
+       * rtl.h (note_stores): Add additional paramter.
+       * rtlanal.c (reg_set_p_1): Take additional paramter.
+       (reg_set_last_1): Likewise.
+       (reg_set_p): Adjust call to note_stores.
+       (reg_set_last): Likewise.
+       (note_stores): Pass data parameter to worker function.
+       * alias.c (record_set): Take additional parameter.
+       (init_alias_analysis): Pass it.
+       * caller-save.c (mark_set_regs): Take additional parameter.
+       (save_call_clobbered_regs): Pass NULL to note_stores.
+       * combine.c (set_nonzero_bits_and_sign_copies): Take additional
+       parameter.
+       (record_dead_and_set_regs_1): Likewise.
+       (reg_dead_at_p_1): Likewise.
+       (combine_instructions): Adjust calls to note_stores.
+       (try_combine): Likewise.
+       (record_dead_insn): Remove.
+       (record_dead_and_set_regs): Adjust calls to note_stores.
+       (reg_dead_at_p): Likewise.
+       * cse.c (invalidate_skipped_set): Take additional parameter.
+       (cse_check_loop_start): Likewise.
+       (cse_check_loop_start_value): Remove.
+       (cse_set_around_loop): Adjust calls to note_stores.
+       * flow.c (notice_stack_pointer_modification): Take additional
+       parameter.  Remove duplicate declaration.
+       (record_volatile_insns): Adjust calls to note_stores.
+       * gcse.c (record_set_info): Take additional parameter.
+       (record_last_set_info): Likewise.
+       (invalidate_nonnull_info): Likewise.
+       (record_set_insn): Remove.
+       (compute_sets): Adjust calls to note_stores.
+       (last_set_insn): Remove.
+       (compute_hash_table): Adjust calls to note_stores.
+       (insert_insn_end_bb): Likewise.
+       (delete_null_pointer_checks): Likewise.
+       * global.c (mark_reg_store): Take additional parameter.
+       (mark_reg_clobber): Likewise.
+       (reg_becomes_live): Likewise.
+       (global_conflicts): Adjust calls to note_stores.
+       (build_insn_chain): Likewise.
+       * integrate.c (note_modified_parmregs): Take additional parameter.
+       (mark_stores): Likewise.  Make it static.
+       (save_for_inline_nocopy): Adjust calls to note_stores.
+       (try_constants): Likewise.
+       * integrate.h (mark_stores): Remove declaration.
+       * jump.c (mark_modified_reg): Take additional parameter.
+       (thread_jumps): Adjust calls to note_stores.
+       * local-alloc.c (validate_equiv_mem_from_store): Take additional
+       parameter.
+       (no_equiv): Likewise.
+       (reg_is_set): Likewise.
+       (validate_equiv_mem): Adjust calls to note_stores.
+       (update_equiv_regs): Likewise.
+       (block_alloc): Likewise.
+       * loop.c (note_set_pseudo_multiple_uses_retval): Remove.
+       (note_addr_stored): Take additional parameter.
+       (note_set_pseudo_multiple_uses): Likewise.
+       (record_initial): Likewise.
+       (prescan_loop): Adjust calls to note_stores.
+       (strength_reduce): Likewise.
+       (check_dbra_loop): Likewise.
+       * regmove.c (flags_set_1): Take additional paramter.
+       (mark_flags_life_zones): Adjust calls to note_stores.
+       * reload1.c (mark_not_eliminable): Take additional parameter.
+       (forget_old_reloads_1): Likewise.
+       (reload_cse_invalidate_rtx): Likewise.
+       (reload_cse_check_clobber): Likewise.
+       (reload_combine_note_store): Likewise.
+       (move2add_note_store): Likewise.
+       (reload): Adjust calls to note_stores.
+       (reload_as_needed): Likewise.
+       (emit_reload_insns): Likewise.
+       (reload_cse_regs_1): Likewise.
+       (reload_cse_record_set): Adjust calls to reload_cse_invalidate_rtx.
+       (reload_combine): Adjust calls to note_stores.
+       * resource.c (update_live_status): Take additional paramter.
+       (mark_target_live_regs): Adjust calls to note_stores.
+       * stupid.c (find_clobbered_regs): Take additional parameter.
+       (stupid_life_analysis): Adjust calls to note_stores.
+       
 Wed Oct 27 19:26:12 1999  Nick Clifton  <nickc@cygnus.com>
 
        * config/arm/coff.h (STRUCTURE_SIZE_BOUNDARY): Delete
index cdc0019..ebb1e7c 100644 (file)
@@ -82,7 +82,7 @@ static int rtx_equal_for_memref_p     PROTO((rtx, rtx));
 static rtx find_symbolic_term          PROTO((rtx));
 static int memrefs_conflict_p          PROTO((int, rtx, int, rtx,
                                               HOST_WIDE_INT));
-static void record_set                 PROTO((rtx, rtx));
+static void record_set                 PROTO((rtx, rtx, void *));
 static rtx find_base_term              PROTO((rtx));
 static int base_alias_check            PROTO((rtx, rtx, enum machine_mode,
                                               enum machine_mode));
@@ -451,8 +451,9 @@ static char *reg_seen;
 static int unique_id;
 
 static void
-record_set (dest, set)
+record_set (dest, set, data)
      rtx dest, set;
+     void *data ATTRIBUTE_UNUSED;
 {
   register unsigned regno;
   rtx src;
@@ -1652,9 +1653,9 @@ init_alias_analysis ()
 
              if (GET_CODE (PATTERN (insn)) == SET
                  && (find_reg_note (insn, REG_NOALIAS, NULL_RTX)))
-               record_set (SET_DEST (PATTERN (insn)), NULL_RTX);
+               record_set (SET_DEST (PATTERN (insn)), NULL_RTX, NULL);
              else
-               note_stores (PATTERN (insn), record_set);
+               note_stores (PATTERN (insn), record_set, NULL);
 
              set = single_set (insn);
 
index f53b2dd..b58fe87 100644 (file)
@@ -84,7 +84,7 @@ static HARD_REG_SET referenced_regs;
 static HARD_REG_SET this_insn_sets;
 
 
-static void mark_set_regs              PROTO((rtx, rtx));
+static void mark_set_regs              PROTO((rtx, rtx, void *));
 static void mark_referenced_regs       PROTO((rtx));
 static int insert_save                 PROTO((struct insn_chain *, int, int,
                                               HARD_REG_SET *));
@@ -385,7 +385,7 @@ save_call_clobbered_regs ()
              /* Record all registers set in this call insn.  These don't need
                 to be saved.  */
              CLEAR_HARD_REG_SET (this_insn_sets);
-             note_stores (PATTERN (insn), mark_set_regs);
+             note_stores (PATTERN (insn), mark_set_regs, NULL);
 
              /* Compute which hard regs must be saved before this call.  */
              AND_COMPL_HARD_REG_SET (hard_regs_to_save, call_fixed_reg_set);
@@ -465,9 +465,10 @@ save_call_clobbered_regs ()
    been assigned hard regs have had their register number changed already,
    so we can ignore pseudos.  */
 static void
-mark_set_regs (reg, setter)
+mark_set_regs (reg, setter, data)
      rtx reg;
      rtx setter ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   register int regno, endregno, i;
   enum machine_mode mode = GET_MODE (reg);
index 9f30666..f3dcc96 100644 (file)
@@ -354,7 +354,7 @@ static void do_SUBST                        PROTO((rtx *, rtx));
 static void do_SUBST_INT               PROTO((int *, int));
 static void init_reg_last_arrays       PROTO((void));
 static void setup_incoming_promotions   PROTO((void));
-static void set_nonzero_bits_and_sign_copies  PROTO((rtx, rtx));
+static void set_nonzero_bits_and_sign_copies  PROTO((rtx, rtx, void *));
 static int can_combine_p       PROTO((rtx, rtx, rtx, rtx, rtx *, rtx *));
 static int sets_function_arg_p PROTO((rtx));
 static int combinable_i3pat    PROTO((rtx, rtx *, rtx, rtx, int, rtx *));
@@ -401,12 +401,12 @@ static enum rtx_code simplify_comparison  PROTO((enum rtx_code, rtx *, rtx *));
 static int reversible_comparison_p  PROTO((rtx));
 static void update_table_tick  PROTO((rtx));
 static void record_value_for_reg  PROTO((rtx, rtx, rtx));
-static void record_dead_and_set_regs_1  PROTO((rtx, rtx));
+static void record_dead_and_set_regs_1  PROTO((rtx, rtx, void *));
 static void record_dead_and_set_regs  PROTO((rtx));
 static int get_last_value_validate  PROTO((rtx *, rtx, int, int));
 static rtx get_last_value      PROTO((rtx));
 static int use_crosses_set_p   PROTO((rtx, int));
-static void reg_dead_at_p_1    PROTO((rtx, rtx));
+static void reg_dead_at_p_1    PROTO((rtx, rtx, void *));
 static int reg_dead_at_p       PROTO((rtx, rtx));
 static void move_deaths                PROTO((rtx, rtx, int, rtx, rtx *));
 static int reg_bitfield_target_p  PROTO((rtx, rtx));
@@ -569,13 +569,15 @@ combine_instructions (f, nregs)
 
       if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
        {
-         note_stores (PATTERN (insn), set_nonzero_bits_and_sign_copies);
+         note_stores (PATTERN (insn), set_nonzero_bits_and_sign_copies, 
+                      NULL);
          record_dead_and_set_regs (insn);
 
 #ifdef AUTO_INC_DEC
          for (links = REG_NOTES (insn); links; links = XEXP (links, 1))
            if (REG_NOTE_KIND (links) == REG_INC)
-             set_nonzero_bits_and_sign_copies (XEXP (links, 0), NULL_RTX);
+             set_nonzero_bits_and_sign_copies (XEXP (links, 0), NULL_RTX,
+                                               NULL);
 #endif
        }
 
@@ -769,9 +771,10 @@ setup_incoming_promotions ()
    by any set of X.  */
 
 static void
-set_nonzero_bits_and_sign_copies (x, set)
+set_nonzero_bits_and_sign_copies (x, set, data)
      rtx x;
      rtx set;
+     void *data ATTRIBUTE_UNUSED;
 {
   int num;
 
@@ -2557,9 +2560,9 @@ try_combine (i3, i2, i1)
     /* Update reg_nonzero_bits et al for any changes that may have been made
        to this insn.  */
 
-    note_stores (newpat, set_nonzero_bits_and_sign_copies);
+    note_stores (newpat, set_nonzero_bits_and_sign_copies, NULL);
     if (newi2pat)
-      note_stores (newi2pat, set_nonzero_bits_and_sign_copies);
+      note_stores (newi2pat, set_nonzero_bits_and_sign_copies, NULL);
 
     /* If I3 is now an unconditional jump, ensure that it has a 
        BARRIER following it since it may have initially been a
@@ -10753,16 +10756,17 @@ record_value_for_reg (reg, insn, value)
     }
 }
 
-/* Used for communication between the following two routines.  */
-static rtx record_dead_insn;
-
 /* Called via note_stores from record_dead_and_set_regs to handle one
-   SET or CLOBBER in an insn.  */
+   SET or CLOBBER in an insn.  DATA is the instruction in which the
+   set is occurring.  */
 
 static void
-record_dead_and_set_regs_1 (dest, setter)
+record_dead_and_set_regs_1 (dest, setter, data)
      rtx dest, setter;
+     void *data;
 {
+  rtx record_dead_insn = (rtx) data;
+
   if (GET_CODE (dest) == SUBREG)
     dest = SUBREG_REG (dest);
 
@@ -10840,8 +10844,7 @@ record_dead_and_set_regs (insn)
       last_call_cuid = mem_last_set = INSN_CUID (insn);
     }
 
-  record_dead_insn = insn;
-  note_stores (PATTERN (insn), record_dead_and_set_regs_1);
+  note_stores (PATTERN (insn), record_dead_and_set_regs_1, insn);
 }
 \f
 /* Utility routine for the following function.  Verify that all the registers
@@ -11040,9 +11043,10 @@ static int reg_dead_flag;
    reg_dead_flag to 1 if X is a CLOBBER and to -1 it is a SET.  */
 
 static void
-reg_dead_at_p_1 (dest, x)
+reg_dead_at_p_1 (dest, x, data)
      rtx dest;
      rtx x;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno, endregno;
 
@@ -11094,7 +11098,7 @@ reg_dead_at_p (reg, insn)
   for (; insn && GET_CODE (insn) != CODE_LABEL && GET_CODE (insn) != BARRIER;
        insn = prev_nonnote_insn (insn))
     {
-      note_stores (PATTERN (insn), reg_dead_at_p_1);
+      note_stores (PATTERN (insn), reg_dead_at_p_1, NULL);
       if (reg_dead_flag)
        return reg_dead_flag == 1 ? 1 : 0;
 
index d22a200..bc7bd65 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -693,9 +693,9 @@ static int note_mem_written PROTO((rtx));
 static void invalidate_from_clobbers PROTO((rtx));
 static rtx cse_process_notes   PROTO((rtx, rtx));
 static void cse_around_loop    PROTO((rtx));
-static void invalidate_skipped_set PROTO((rtx, rtx));
+static void invalidate_skipped_set PROTO((rtx, rtx, void *));
 static void invalidate_skipped_block PROTO((rtx));
-static void cse_check_loop_start PROTO((rtx, rtx));
+static void cse_check_loop_start PROTO((rtx, rtx, void *));
 static void cse_set_around_loop        PROTO((rtx, rtx, rtx));
 static rtx cse_basic_block     PROTO((rtx, rtx, struct branch_path *, int));
 static void count_reg_usage    PROTO((rtx, int *, rtx, int));
@@ -8205,9 +8205,10 @@ cse_around_loop (loop_start)
    since they are done elsewhere.  This function is called via note_stores.  */
 
 static void
-invalidate_skipped_set (dest, set)
+invalidate_skipped_set (dest, set, data)
      rtx set;
      rtx dest;
+     void *data ATTRIBUTE_UNUSED;
 {
   enum rtx_code code = GET_CODE (dest);
 
@@ -8262,30 +8263,29 @@ invalidate_skipped_block (start)
        }
 
       invalidate_from_clobbers (PATTERN (insn));
-      note_stores (PATTERN (insn), invalidate_skipped_set);
+      note_stores (PATTERN (insn), invalidate_skipped_set, NULL);
     }
 }
 \f
-/* Used for communication between the following two routines; contains a
-   value to be checked for modification.  */
-
-static rtx cse_check_loop_start_value;
-
-/* If modifying X will modify the value in CSE_CHECK_LOOP_START_VALUE,
-   indicate that fact by setting CSE_CHECK_LOOP_START_VALUE to 0.  */
+/* If modifying X will modify the value in *DATA (which is really an
+   `rtx *'), indicate that fact by setting the pointed to value to
+   NULL_RTX.  */
 
 static void
-cse_check_loop_start (x, set)
+cse_check_loop_start (x, set, data)
      rtx x;
      rtx set ATTRIBUTE_UNUSED;
+     void *data;
 {
-  if (cse_check_loop_start_value == 0
+  rtx *cse_check_loop_start_value = (rtx *) data;
+
+  if (*cse_check_loop_start_value == NULL_RTX
       || GET_CODE (x) == CC0 || GET_CODE (x) == PC)
     return;
 
-  if ((GET_CODE (x) == MEM && GET_CODE (cse_check_loop_start_value) == MEM)
-      || reg_overlap_mentioned_p (x, cse_check_loop_start_value))
-    cse_check_loop_start_value = 0;
+  if ((GET_CODE (x) == MEM && GET_CODE (*cse_check_loop_start_value) == MEM)
+      || reg_overlap_mentioned_p (x, *cse_check_loop_start_value))
+    *cse_check_loop_start_value = NULL_RTX;
 }
 
 /* X is a SET or CLOBBER contained in INSN that was found near the start of
@@ -8350,11 +8350,12 @@ cse_set_around_loop (x, insn, loop_start)
                       can modify it, or we would have invalidated it in
                       the hash table.  */
                    rtx q;
-
-                   cse_check_loop_start_value = SET_SRC (x);
+                   rtx cse_check_loop_start_value = SET_SRC (x);
                    for (q = p; q != loop_start; q = NEXT_INSN (q))
                      if (GET_RTX_CLASS (GET_CODE (q)) == 'i')
-                       note_stores (PATTERN (q), cse_check_loop_start);
+                       note_stores (PATTERN (q),
+                                    cse_check_loop_start,
+                                    &cse_check_loop_start_value);
 
                    /* If nothing was changed and we can replace our
                       SET_SRC, add an insn after P to copy its destination
index 8ff7b92..9ce099f 100644 (file)
@@ -328,7 +328,7 @@ static void verify_wide_reg         PROTO((int, rtx, rtx));
 static void verify_local_live_at_start PROTO((regset, basic_block));
 static int set_noop_p                  PROTO((rtx));
 static int noop_move_p                 PROTO((rtx));
-static void notice_stack_pointer_modification PROTO ((rtx, rtx));
+static void notice_stack_pointer_modification PROTO ((rtx, rtx, void *));
 static void record_volatile_insns      PROTO((rtx));
 static void mark_reg                   PROTO((regset, rtx));
 static void mark_regs_live_at_end      PROTO((regset));
@@ -361,7 +361,6 @@ static void add_pred_succ           PROTO ((int, int, int_list_ptr *,
 static void count_reg_sets_1           PROTO ((rtx));
 static void count_reg_sets             PROTO ((rtx));
 static void count_reg_references       PROTO ((rtx));
-static void notice_stack_pointer_modification PROTO ((rtx, rtx));
 static void invalidate_mems_from_autoinc       PROTO ((rtx));
 static void remove_edge                        PROTO ((edge));
 static void remove_fake_successors     PROTO ((basic_block));
@@ -2694,9 +2693,10 @@ noop_move_p (insn)
 }
 
 static void
-notice_stack_pointer_modification (x, pat)
+notice_stack_pointer_modification (x, pat, data)
      rtx x;
      rtx pat ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   if (x == stack_pointer_rtx
       /* The stack pointer is only modified indirectly as the result
@@ -2759,7 +2759,9 @@ record_volatile_insns (f)
       /* Check if insn modifies the stack pointer.  */
       if ( current_function_sp_is_unchanging
           && GET_RTX_CLASS (GET_CODE (insn)) == 'i')
-       note_stores (PATTERN (insn), notice_stack_pointer_modification);
+       note_stores (PATTERN (insn),
+                    notice_stack_pointer_modification,
+                    NULL);
     }
 }
 
index 7732cd3..a40852d 100644 (file)
@@ -521,7 +521,7 @@ static void free_gcse_mem        PROTO ((void));
 static void alloc_reg_set_mem   PROTO ((int));
 static void free_reg_set_mem     PROTO ((void));
 static void record_one_set         PROTO ((int, rtx));
-static void record_set_info       PROTO ((rtx, rtx));
+static void record_set_info       PROTO ((rtx, rtx, void *));
 static void compute_sets             PROTO ((rtx));
 
 static void hash_scan_insn         PROTO ((rtx, int, int));
@@ -542,7 +542,7 @@ static unsigned int hash_set          PROTO ((int, int));
 static int expr_equiv_p               PROTO ((rtx, rtx));
 static void record_last_reg_set_info  PROTO ((rtx, int));
 static void record_last_mem_set_info  PROTO ((rtx));
-static void record_last_set_info      PROTO ((rtx, rtx));
+static void record_last_set_info      PROTO ((rtx, rtx, void *));
 static void compute_hash_table PROTO ((int));
 static void alloc_set_hash_table      PROTO ((int));
 static void free_set_hash_table       PROTO ((void));
@@ -621,7 +621,7 @@ static int can_disregard_other_sets   PROTO ((struct reg_set **, rtx, int));
 static int handle_avail_expr     PROTO ((rtx, struct expr *));
 static int classic_gcse               PROTO ((void));
 static int one_classic_gcse_pass      PROTO ((int));
-static void invalidate_nonnull_info    PROTO ((rtx, rtx));
+static void invalidate_nonnull_info    PROTO ((rtx, rtx, void *));
 static rtx process_insert_insn PROTO ((struct expr *));
 static int pre_edge_insert     PROTO ((struct edge_list *, struct expr **));
 \f
@@ -1130,16 +1130,17 @@ record_one_set (regno, insn)
     }
 }
 
-/* For communication between next two functions (via note_stores).  */
-static rtx record_set_insn;
-
 /* Called from compute_sets via note_stores to handle one
-   SET or CLOBBER in an insn.  */
+   SET or CLOBBER in an insn.  The DATA is really the instruction
+   in which the SET is occurring.  */
 
 static void
-record_set_info (dest, setter)
+record_set_info (dest, setter, data)
      rtx dest, setter ATTRIBUTE_UNUSED;
+     void *data;
 {
+  rtx record_set_insn = (rtx) data;
+
   if (GET_CODE (dest) == SUBREG)
     dest = SUBREG_REG (dest);
 
@@ -1164,10 +1165,7 @@ compute_sets (f)
   while (insn)
     {
       if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
-       {
-         record_set_insn = insn;
-         note_stores (PATTERN (insn), record_set_info);
-       }
+       note_stores (PATTERN (insn), record_set_info, insn);
       insn = NEXT_INSN (insn);
     }
 }
@@ -2069,16 +2067,17 @@ record_last_mem_set_info (insn)
   mem_set_in_block[BLOCK_NUM (insn)] = 1;
 }
 
-/* Used for communicating between next two routines.  */
-static rtx last_set_insn;
-
 /* Called from compute_hash_table via note_stores to handle one
-   SET or CLOBBER in an insn.  */
+   SET or CLOBBER in an insn.  DATA is really the instruction in which
+   the SET is taking place.  */
 
 static void
-record_last_set_info (dest, setter)
+record_last_set_info (dest, setter, data)
      rtx dest, setter ATTRIBUTE_UNUSED;
+     void *data;
 {
+  rtx last_set_insn = (rtx) data;
+
   if (GET_CODE (dest) == SUBREG)
     dest = SUBREG_REG (dest);
 
@@ -2183,8 +2182,7 @@ compute_hash_table (set_p)
                record_last_mem_set_info (insn);
            }
 
-         last_set_insn = insn;
-         note_stores (PATTERN (insn), record_last_set_info);
+         note_stores (PATTERN (insn), record_last_set_info, insn);
        }
 
       /* The next pass builds the hash table.  */
@@ -4433,8 +4431,7 @@ insert_insn_end_bb (expr, bb, pre)
          set_block_num (insn, bb);
          if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
            add_label_notes (PATTERN (insn), new_insn);
-         record_set_insn = insn;
-         note_stores (PATTERN (insn), record_set_info);
+         note_stores (PATTERN (insn), record_set_info, insn);
        }
     }
   else
@@ -4930,9 +4927,10 @@ static sbitmap *nonnull_killed;
 
    We ignore hard registers.  */
 static void
-invalidate_nonnull_info (x, setter)
+invalidate_nonnull_info (x, setter, data)
      rtx x;
      rtx setter ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   int offset, regno;
 
@@ -5058,7 +5056,7 @@ delete_null_pointer_checks (f)
          set = single_set (insn);
          if (!set)
            {
-             note_stores (PATTERN (insn), invalidate_nonnull_info);
+             note_stores (PATTERN (insn), invalidate_nonnull_info, NULL);
              continue;
            }
 
@@ -5072,7 +5070,7 @@ delete_null_pointer_checks (f)
                     REGNO (XEXP (SET_SRC (set), 0)));
 
          /* Now invalidate stuff clobbered by this insn.  */
-         note_stores (PATTERN (insn), invalidate_nonnull_info);
+         note_stores (PATTERN (insn), invalidate_nonnull_info, NULL);
 
          /* And handle stores, we do these last since any sets in INSN can
             not kill the nonnull property if it is derived from a MEM
index 44564e8..0b8aedd 100644 (file)
@@ -264,14 +264,14 @@ static void prune_preferences     PROTO((void));
 static void find_reg           PROTO((int, HARD_REG_SET, int, int, int));
 static void record_one_conflict PROTO((int));
 static void record_conflicts   PROTO((int *, int));
-static void mark_reg_store     PROTO((rtx, rtx));
-static void mark_reg_clobber   PROTO((rtx, rtx));
+static void mark_reg_store     PROTO((rtx, rtx, void *));
+static void mark_reg_clobber   PROTO((rtx, rtx, void *));
 static void mark_reg_conflicts PROTO((rtx));
 static void mark_reg_death     PROTO((rtx));
 static void mark_reg_live_nc   PROTO((int, enum machine_mode));
 static void set_preference     PROTO((rtx, rtx));
 static void dump_conflicts     PROTO((FILE *));
-static void reg_becomes_live   PROTO((rtx, rtx));
+static void reg_becomes_live   PROTO((rtx, rtx, void *));
 static void reg_dies           PROTO((int, enum machine_mode));
 static void build_insn_chain   PROTO((rtx));
 \f
@@ -722,7 +722,7 @@ global_conflicts ()
              /* Mark any registers clobbered by INSN as live,
                 so they conflict with the inputs.  */
 
-             note_stores (PATTERN (insn), mark_reg_clobber);
+             note_stores (PATTERN (insn), mark_reg_clobber, NULL);
 
              /* Mark any registers dead after INSN as dead now.  */
 
@@ -735,12 +735,12 @@ global_conflicts ()
                 Clobbers are processed again, so they conflict with
                 the registers that are set.  */
 
-             note_stores (PATTERN (insn), mark_reg_store);
+             note_stores (PATTERN (insn), mark_reg_store, NULL);
 
 #ifdef AUTO_INC_DEC
              for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
                if (REG_NOTE_KIND (link) == REG_INC)
-                 mark_reg_store (XEXP (link, 0), NULL_RTX);
+                 mark_reg_store (XEXP (link, 0), NULL_RTX, NULL);
 #endif
 
              /* If INSN has multiple outputs, then any reg that dies here
@@ -1341,8 +1341,9 @@ record_conflicts (allocno_vec, len)
    a REG_INC note was found for it).  */
 
 static void
-mark_reg_store (reg, setter)
+mark_reg_store (reg, setter, data)
      rtx reg, setter;
+     void *data ATTRIBUTE_UNUSED;
 {
   register int regno;
 
@@ -1398,11 +1399,12 @@ mark_reg_store (reg, setter)
 /* Like mark_reg_set except notice just CLOBBERs; ignore SETs.  */
 
 static void
-mark_reg_clobber (reg, setter)
+mark_reg_clobber (reg, setter, data)
      rtx reg, setter;
+     void *data ATTRIBUTE_UNUSED;
 {
   if (GET_CODE (setter) == CLOBBER)
-    mark_reg_store (reg, setter);
+    mark_reg_store (reg, setter, data);
 }
 
 /* Record that REG has conflicts with all the regs currently live.
@@ -1623,9 +1625,10 @@ static regset live_relevant_regs;
 /* Record in live_relevant_regs that register REG became live.  This
    is called via note_stores.  */
 static void
-reg_becomes_live (reg, setter)
+reg_becomes_live (reg, setter, data)
      rtx reg;
      rtx setter ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno;
 
@@ -1718,7 +1721,7 @@ build_insn_chain (first)
 
              /* Mark everything born in this instruction as live.  */
 
-             note_stores (PATTERN (first), reg_becomes_live);
+             note_stores (PATTERN (first), reg_becomes_live, NULL);
            }
 
          /* Remember which registers are live at the end of the insn, before
index 16e47ce..6205e21 100644 (file)
@@ -63,7 +63,7 @@ extern struct obstack *function_maybepermanent_obstack;
 #endif
 \f
 static rtvec initialize_for_inline     PROTO((tree));
-static void note_modified_parmregs     PROTO((rtx, rtx));
+static void note_modified_parmregs     PROTO((rtx, rtx, void *));
 static void integrate_parm_decls       PROTO((tree, struct inline_remap *,
                                               rtvec));
 static tree integrate_decl_tree                PROTO((tree,
@@ -78,6 +78,7 @@ static void process_reg_param         PROTO((struct inline_remap *, rtx,
 void set_decl_abstract_flags           PROTO((tree, int));
 static tree copy_and_set_decl_abstract_origin PROTO((tree));
 static rtx expand_inline_function_eh_labelmap PROTO((rtx));
+static void mark_stores                 PROTO((rtx, rtx, void *));
 
 /* The maximum number of instructions accepted for inlining a
    function.  Increasing values mean more agressive inlining.
@@ -385,7 +386,7 @@ save_for_inline_nocopy (fndecl)
 
       if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
        /* Record what interesting things happen to our parameters.  */
-       note_stores (PATTERN (insn), note_modified_parmregs);
+       note_stores (PATTERN (insn), note_modified_parmregs, NULL);
     }
 
   /* We have now allocated all that needs to be allocated permanently
@@ -404,9 +405,10 @@ save_for_inline_nocopy (fndecl)
 /* Note whether a parameter is modified or not.  */
 
 static void
-note_modified_parmregs (reg, x)
+note_modified_parmregs (reg, x, data)
      rtx reg;
      rtx x ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   if (GET_CODE (reg) == REG && in_nonparm_insns
       && REGNO (reg) < max_parm_reg
@@ -1951,7 +1953,7 @@ try_constants (insn, map)
   apply_change_group ();
 
   /* Show we don't know the value of anything stored or clobbered.  */
-  note_stores (PATTERN (insn), mark_stores);
+  note_stores (PATTERN (insn), mark_stores, NULL);
   map->last_pc_value = 0;
 #ifdef HAVE_cc0
   map->last_cc0_value = 0;
@@ -2268,9 +2270,10 @@ subst_constants (loc, insn, map)
    called from note_stores with parts of the new insn.  */
 
 void
-mark_stores (dest, x)
+mark_stores (dest, x, data)
      rtx dest;
      rtx x ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno = -1;
   enum machine_mode mode = VOIDmode;
index 615998b..a80f882 100644 (file)
@@ -118,8 +118,6 @@ extern rtx copy_rtx_and_substitute PROTO((rtx, struct inline_remap *));
 
 extern void try_constants PROTO((rtx, struct inline_remap *));
 
-extern void mark_stores PROTO((rtx, rtx));
-
 /* Return the label indicated.  */
 extern rtx get_label_from_map PROTO((struct inline_remap *, int));
 
index 9a16ac5..72a1358 100644 (file)
@@ -122,7 +122,7 @@ static void mark_jump_label         PROTO((rtx, rtx, int));
 static void delete_computation         PROTO((rtx));
 static void delete_from_jump_chain     PROTO((rtx));
 static int delete_labelref_insn                PROTO((rtx, rtx, int));
-static void mark_modified_reg          PROTO((rtx, rtx));
+static void mark_modified_reg          PROTO((rtx, rtx, void *));
 static void redirect_tablejump         PROTO((rtx, rtx));
 static void jump_optimize_1            PROTO ((rtx, int, int, int, int));
 #if ! defined(HAVE_cc0) && ! defined(HAVE_conditional_arithmetic)
@@ -5091,9 +5091,10 @@ static int modified_mem;
    branch and the second branch.  It marks any changed registers.  */
 
 static void
-mark_modified_reg (dest, x)
+mark_modified_reg (dest, x, data)
      rtx dest;
      rtx x ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno, i;
 
@@ -5205,7 +5206,7 @@ thread_jumps (f, max_reg, flag_before_loop)
                      modified_regs[i] = 1;
                }
 
-             note_stores (PATTERN (b2), mark_modified_reg);
+             note_stores (PATTERN (b2), mark_modified_reg, NULL);
            }
 
          /* Check the next candidate branch insn from the label
index bcc8cbb..6b07326 100644 (file)
@@ -243,13 +243,13 @@ static rtx *reg_equiv_init_insns;
 static int recorded_label_ref;
 
 static void alloc_qty          PROTO((int, enum machine_mode, int, int));
-static void validate_equiv_mem_from_store PROTO((rtx, rtx));
+static void validate_equiv_mem_from_store PROTO((rtx, rtx, void *));
 static int validate_equiv_mem  PROTO((rtx, rtx, rtx));
 static int contains_replace_regs PROTO((rtx, char *));
 static int memref_referenced_p PROTO((rtx, rtx));
 static int memref_used_between_p PROTO((rtx, rtx, rtx));
 static void update_equiv_regs  PROTO((void));
-static void no_equiv           PROTO((rtx, rtx));
+static void no_equiv           PROTO((rtx, rtx, void *));
 static void block_alloc                PROTO((int));
 static int qty_sugg_compare            PROTO((int, int));
 static int qty_sugg_compare_1  PROTO((const PTR, const PTR));
@@ -258,7 +258,7 @@ static int qty_compare_1    PROTO((const PTR, const PTR));
 static int combine_regs                PROTO((rtx, rtx, int, int, rtx, int));
 static int reg_meets_class_p   PROTO((int, enum reg_class));
 static void update_qty_class   PROTO((int, int));
-static void reg_is_set         PROTO((rtx, rtx));
+static void reg_is_set         PROTO((rtx, rtx, void *));
 static void reg_is_born                PROTO((rtx, int));
 static void wipe_dead_reg      PROTO((rtx, int));
 static int find_free_reg       PROTO((enum reg_class, enum machine_mode,
@@ -436,9 +436,10 @@ static int equiv_mem_modified;
    Called via note_stores.  */
 
 static void
-validate_equiv_mem_from_store (dest, set)
+validate_equiv_mem_from_store (dest, set, data)
      rtx dest;
      rtx set ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   if ((GET_CODE (dest) == REG
        && reg_overlap_mentioned_p (dest, equiv_mem))
@@ -483,7 +484,7 @@ validate_equiv_mem (start, reg, memref)
          && ! CONST_CALL_P (insn))
        return 0;
 
-      note_stores (PATTERN (insn), validate_equiv_mem_from_store);
+      note_stores (PATTERN (insn), validate_equiv_mem_from_store, NULL);
 
       /* If a register mentioned in MEMREF is modified via an
         auto-increment, we lose the equivalence.  Do the same if one
@@ -708,7 +709,7 @@ update_equiv_regs ()
 
       for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
        if (REG_NOTE_KIND (note) == REG_INC)
-         no_equiv (XEXP (note, 0), note);
+         no_equiv (XEXP (note, 0), note, NULL);
 
       set = single_set (insn);
 
@@ -716,7 +717,7 @@ update_equiv_regs ()
         only mark all destinations as having no known equivalence.  */
       if (set == 0)
        {
-         note_stores (PATTERN (insn), no_equiv);
+         note_stores (PATTERN (insn), no_equiv, NULL);
          continue;
        }
       else if (GET_CODE (PATTERN (insn)) == PARALLEL)
@@ -727,7 +728,7 @@ update_equiv_regs ()
            {
              rtx part = XVECEXP (PATTERN (insn), 0, i);
              if (part != set)
-               note_stores (part, no_equiv);
+               note_stores (part, no_equiv, NULL);
            }
        }
 
@@ -792,7 +793,7 @@ update_equiv_regs ()
        {
          /* This might be seting a SUBREG of a pseudo, a pseudo that is
             also set somewhere else to a constant.  */
-         note_stores (set, no_equiv);
+         note_stores (set, no_equiv, NULL);
          continue;
        }
       /* Don't handle the equivalence if the source is in a register
@@ -801,7 +802,7 @@ update_equiv_regs ()
          && REGNO (src) >= FIRST_PSEUDO_REGISTER
          && CLASS_LIKELY_SPILLED_P (reg_preferred_class (REGNO (src))))
        {
-         no_equiv (dest, set);
+         no_equiv (dest, set, NULL);
          continue;
        }
 
@@ -814,7 +815,7 @@ update_equiv_regs ()
                  && ! rtx_equal_p (XEXP (note, 0),
                                    reg_equiv_replacement[regno]))))
        {
-         no_equiv (dest, set);
+         no_equiv (dest, set, NULL);
          continue;
        }
       /* Record this insn as initializing this register.  */
@@ -1009,8 +1010,9 @@ update_equiv_regs ()
    assignment - a SET, CLOBBER or REG_INC note.  It is currently not used,
    but needs to be there because this function is called from note_stores.  */
 static void
-no_equiv (reg, store)
+no_equiv (reg, store, data)
      rtx reg, store ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno;
   rtx list;
@@ -1259,7 +1261,7 @@ block_alloc (b)
             that are born (set) in this instruction.
             A pseudo that already has a qty is not changed.  */
 
-         note_stores (PATTERN (insn), reg_is_set);
+         note_stores (PATTERN (insn), reg_is_set, NULL);
 
          /* If anything is set in this insn and then unused, mark it as dying
             after this insn, so it will conflict with our outputs.  This
@@ -1802,9 +1804,10 @@ update_qty_class (qty, reg)
    carry info from `block_alloc'.  */
 
 static void
-reg_is_set (reg, setter)
+reg_is_set (reg, setter, data)
      rtx reg;
      rtx setter;
+     void *data ATTRIBUTE_UNUSED;
 {
   /* Note that note_stores will only pass us a SUBREG if it is a SUBREG of
      a hard register.  These may actually not exist any more.  */
index 2b2a837..62df8b0 100644 (file)
@@ -269,9 +269,6 @@ static struct movable *the_movables;
 
 FILE *loop_dump_stream;
 
-/* For communicating return values from note_set_pseudo_multiple_uses.  */
-static int note_set_pseudo_multiple_uses_retval;
-
 /* Forward declarations.  */
 
 static void verify_dominator PROTO((int));
@@ -285,8 +282,8 @@ static void count_one_set PROTO((rtx, rtx, varray_type, rtx *));
 
 static void count_loop_regs_set PROTO((rtx, rtx, varray_type, varray_type,
                                       int *, int)); 
-static void note_addr_stored PROTO((rtx, rtx));
-static void note_set_pseudo_multiple_uses PROTO((rtx, rtx));
+static void note_addr_stored PROTO((rtx, rtx, void *));
+static void note_set_pseudo_multiple_uses PROTO((rtx, rtx, void *));
 static int loop_reg_used_before_p PROTO((rtx, rtx, rtx, rtx, rtx));
 static void scan_loop PROTO((rtx, rtx, rtx, int, int));
 #if 0
@@ -327,7 +324,7 @@ static int product_cheap_p PROTO((rtx, rtx));
 static int maybe_eliminate_biv PROTO((struct iv_class *, rtx, rtx, int, int, int));
 static int maybe_eliminate_biv_1 PROTO((rtx, rtx, struct iv_class *, int, rtx));
 static int last_use_this_basic_block PROTO((rtx, rtx));
-static void record_initial PROTO((rtx, rtx));
+static void record_initial PROTO((rtx, rtx, void *));
 static void update_reg_last_use PROTO((rtx, rtx));
 static rtx next_insn_in_loop PROTO((rtx, rtx, rtx, rtx));
 static void load_mems_and_recount_loop_regs_set PROTO((rtx, rtx, rtx,
@@ -2476,7 +2473,7 @@ prescan_loop (start, end, loop_info)
                  || GET_CODE (PATTERN (insn)) == ADDR_VEC))
            loop_info->has_tablejump = 1;
          
-         note_stores (PATTERN (insn), note_addr_stored);
+         note_stores (PATTERN (insn), note_addr_stored, NULL);
          if (! first_loop_store_insn && loop_store_mems)
            first_loop_store_insn = insn;
 
@@ -3156,9 +3153,10 @@ labels_in_range_p (insn, end)
 /* Record that a memory reference X is being set.  */
 
 static void
-note_addr_stored (x, y)
+note_addr_stored (x, y, data)
      rtx x;
      rtx y ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   if (x == 0 || GET_CODE (x) != MEM)
     return;
@@ -3180,12 +3178,14 @@ note_addr_stored (x, y)
 /* X is a value modified by an INSN that references a biv inside a loop
    exit test (ie, X is somehow related to the value of the biv).  If X
    is a pseudo that is used more than once, then the biv is (effectively)
-   used more than once.  */
+   used more than once.  DATA is really an `int *', and is set if the
+   biv is used more than once.  */
 
 static void
-note_set_pseudo_multiple_uses (x, y)
+note_set_pseudo_multiple_uses (x, y, data)
      rtx x;
      rtx y ATTRIBUTE_UNUSED;
+     void *data;
 {
   if (x == 0)
     return;
@@ -3204,7 +3204,7 @@ note_set_pseudo_multiple_uses (x, y)
   if (REGNO (x) >= max_reg_before_loop
       || ! VARRAY_RTX (reg_single_usage, REGNO (x))
       || VARRAY_RTX (reg_single_usage, REGNO (x)) == const0_rtx)
-    note_set_pseudo_multiple_uses_retval = 1;
+    *((int *) data) = 1;
 }
 \f
 /* Return nonzero if the rtx X is invariant over the current loop.
@@ -3998,7 +3998,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
 
       if (GET_CODE (p) == INSN || GET_CODE (p) == JUMP_INSN
          || GET_CODE (p) == CALL_INSN)
-       note_stores (PATTERN (p), record_initial);
+       note_stores (PATTERN (p), record_initial, NULL);
 
       /* Record any test of a biv that branches around the loop if no store
         between it and the start of loop.  We only care about tests with
@@ -7976,8 +7976,9 @@ check_dbra_loop (loop_end, insn_count, loop_start, loop_info)
                       that has more than one usage, then the biv has uses
                       other than counting since it's used to derive a value
                       that is used more than one time.  */
-                   note_set_pseudo_multiple_uses_retval = 0;
-                   note_stores (PATTERN (p), note_set_pseudo_multiple_uses);
+                   int note_set_pseudo_multiple_uses_retval = 0;
+                   note_stores (PATTERN (p), note_set_pseudo_multiple_uses,
+                                &note_set_pseudo_multiple_uses_retval);
                    if (note_set_pseudo_multiple_uses_retval)
                      {
                        no_use_except_counting = 0;
@@ -8902,9 +8903,10 @@ last_use_this_basic_block (reg, insn)
    just record the location of the set and process it later.  */
 
 static void
-record_initial (dest, set)
+record_initial (dest, set, data)
      rtx dest;
      rtx set;
+     void *data ATTRIBUTE_UNUSED;
 {
   struct iv_class *bl;
 
index c637743..7b0b74a 100644 (file)
@@ -57,7 +57,7 @@ struct match {
 
 static rtx discover_flags_reg PROTO((void));
 static void mark_flags_life_zones PROTO((rtx));
-static void flags_set_1 PROTO((rtx, rtx));
+static void flags_set_1 PROTO((rtx, rtx, void *));
 
 static int try_auto_increment PROTO((rtx, rtx, rtx, rtx, HOST_WIDE_INT, int));
 static int find_matches PROTO((rtx, struct match *));
@@ -302,7 +302,7 @@ mark_flags_life_zones (flags)
              /* In either case, birth is denoted simply by it's presence
                 as the destination of a set.  */
              flags_set_1_set = 0;
-             note_stores (PATTERN (insn), flags_set_1);
+             note_stores (PATTERN (insn), flags_set_1, NULL);
              if (flags_set_1_set)
                {
                  live = 1;
@@ -322,8 +322,9 @@ mark_flags_life_zones (flags)
 /* A subroutine of mark_flags_life_zones, called through note_stores.  */
 
 static void
-flags_set_1 (x, pat)
+flags_set_1 (x, pat, data)
      rtx x, pat;
+     void *data ATTRIBUTE_UNUSED;
 {
   if (GET_CODE (pat) == SET
       && reg_overlap_mentioned_p (x, flags_set_1_rtx))
index 0a3371f..2909519 100644 (file)
@@ -398,7 +398,7 @@ static void check_eliminable_occurrences    PROTO((rtx));
 static void elimination_effects                PROTO((rtx, enum machine_mode));
 static int eliminate_regs_in_insn      PROTO((rtx, int));
 static void update_eliminable_offsets  PROTO((void));
-static void mark_not_eliminable                PROTO((rtx, rtx));
+static void mark_not_eliminable                PROTO((rtx, rtx, void *));
 static void set_initial_elim_offsets   PROTO((void));
 static void verify_initial_elim_offsets        PROTO((void));
 static void set_initial_label_offsets  PROTO((void));
@@ -413,7 +413,7 @@ static int hard_reg_use_compare             PROTO((const PTR, const PTR));
 static void count_pseudo               PROTO((struct hard_reg_n_uses *, int));
 static void order_regs_for_reload      PROTO((struct insn_chain *));
 static void reload_as_needed           PROTO((int));
-static void forget_old_reloads_1       PROTO((rtx, rtx));
+static void forget_old_reloads_1       PROTO((rtx, rtx, void *));
 static int reload_reg_class_lower      PROTO((const PTR, const PTR));
 static void mark_reload_reg_in_use     PROTO((int, int, enum reload_type,
                                               enum machine_mode));
@@ -437,18 +437,18 @@ static void reload_cse_regs_1             PROTO((rtx));
 static void reload_cse_invalidate_regno        PROTO((int, enum machine_mode, int));
 static int reload_cse_mem_conflict_p   PROTO((rtx, rtx));
 static void reload_cse_invalidate_mem  PROTO((rtx));
-static void reload_cse_invalidate_rtx  PROTO((rtx, rtx));
+static void reload_cse_invalidate_rtx  PROTO((rtx, rtx, void *));
 static int reload_cse_regno_equal_p    PROTO((int, rtx, enum machine_mode));
 static int reload_cse_noop_set_p       PROTO((rtx, rtx));
 static int reload_cse_simplify_set     PROTO((rtx, rtx));
 static int reload_cse_simplify_operands        PROTO((rtx));
-static void reload_cse_check_clobber   PROTO((rtx, rtx));
+static void reload_cse_check_clobber   PROTO((rtx, rtx, void *));
 static void reload_cse_record_set      PROTO((rtx, rtx));
 static void reload_combine PROTO((void));
 static void reload_combine_note_use PROTO((rtx *, rtx));
-static void reload_combine_note_store PROTO((rtx, rtx));
+static void reload_combine_note_store PROTO((rtx, rtx, void *));
 static void reload_cse_move2add PROTO((rtx));
-static void move2add_note_store PROTO((rtx, rtx));
+static void move2add_note_store PROTO((rtx, rtx, void *));
 #ifdef AUTO_INC_DEC
 static void add_auto_inc_notes PROTO((rtx, rtx));
 #endif
@@ -805,7 +805,7 @@ reload (first, global, dumpfile)
   for (insn = first; insn && num_eliminable; insn = NEXT_INSN (insn))
     if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN
        || GET_CODE (insn) == CALL_INSN)
-      note_stores (PATTERN (insn), mark_not_eliminable);
+      note_stores (PATTERN (insn), mark_not_eliminable, NULL);
 
   maybe_fix_stack_asms ();
 
@@ -3631,9 +3631,10 @@ update_eliminable_offsets ()
    the insns of the function.  */
 
 static void
-mark_not_eliminable (dest, x)
+mark_not_eliminable (dest, x, data)
      rtx dest;
      rtx x;
+     void *data ATTRIBUTE_UNUSED;
 {
   register unsigned int i;
 
@@ -4424,13 +4425,13 @@ reload_as_needed (live_known)
             for this insn in order to be stored in
             (obeying register constraints).  That is correct; such reload
             registers ARE still valid.  */
-         note_stores (oldpat, forget_old_reloads_1);
+         note_stores (oldpat, forget_old_reloads_1, NULL);
 
          /* There may have been CLOBBER insns placed after INSN.  So scan
             between INSN and NEXT and use them to forget old reloads.  */
          for (x = NEXT_INSN (insn); x != old_next; x = NEXT_INSN (x))
            if (GET_CODE (x) == INSN && GET_CODE (PATTERN (x)) == CLOBBER)
-             note_stores (PATTERN (x), forget_old_reloads_1);
+             note_stores (PATTERN (x), forget_old_reloads_1, NULL);
 
 #ifdef AUTO_INC_DEC
          /* Likewise for regs altered by auto-increment in this insn.
@@ -4512,7 +4513,8 @@ reload_as_needed (live_known)
                          reg_has_output_reload[REGNO (XEXP (in_reg, 0))] = 1;
                        }
                      else
-                       forget_old_reloads_1 (XEXP (in_reg, 0), NULL_RTX);
+                       forget_old_reloads_1 (XEXP (in_reg, 0), NULL_RTX, 
+                                             NULL);
                    }
                  else if ((code == PRE_INC || code == PRE_DEC)
                           && TEST_HARD_REG_BIT (reg_reloaded_valid,
@@ -4542,7 +4544,7 @@ reload_as_needed (live_known)
                    break;
 
                if (i == n_reloads)
-                 forget_old_reloads_1 (XEXP (x, 0), NULL_RTX);
+                 forget_old_reloads_1 (XEXP (x, 0), NULL_RTX, NULL);
              }
 #endif
        }
@@ -4579,9 +4581,10 @@ reload_as_needed (live_known)
    or it may be a pseudo reg that was reloaded from.  */
 
 static void
-forget_old_reloads_1 (x, ignored)
+forget_old_reloads_1 (x, ignored, data)
      rtx x;
      rtx ignored ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   register int regno;
   int nr;
@@ -7312,7 +7315,7 @@ emit_reload_insns (chain)
                   clear any memory of reloaded copies of the pseudo reg.
                   If this output reload comes from a spill reg,
                   reg_has_output_reload will make this do nothing.  */
-               note_stores (pat, forget_old_reloads_1);
+               note_stores (pat, forget_old_reloads_1, NULL);
 
                if (reg_mentioned_p (rld[j].reg_rtx, pat))
                  {
@@ -8680,9 +8683,10 @@ reload_cse_invalidate_mem (mem_rtx)
    note_stores; it is ignored.  */
 
 static void
-reload_cse_invalidate_rtx (dest, ignore)
+reload_cse_invalidate_rtx (dest, ignore, data)
      rtx dest;
      rtx ignore ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   while (GET_CODE (dest) == STRICT_LOW_PART
         || GET_CODE (dest) == SIGN_EXTRACT
@@ -8895,11 +8899,11 @@ reload_cse_regs_1 (first)
              if (GET_CODE (x) == SET)
                reload_cse_record_set (x, body);
              else
-               note_stores (x, reload_cse_invalidate_rtx);
+               note_stores (x, reload_cse_invalidate_rtx, NULL);
            }
        }
       else
-       note_stores (body, reload_cse_invalidate_rtx);
+       note_stores (body, reload_cse_invalidate_rtx, NULL);
 
 #ifdef AUTO_INC_DEC
       /* Clobber any registers which appear in REG_INC notes.  We
@@ -8910,7 +8914,7 @@ reload_cse_regs_1 (first)
 
        for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
          if (REG_NOTE_KIND (x) == REG_INC)
-           reload_cse_invalidate_rtx (XEXP (x, 0), NULL_RTX);
+           reload_cse_invalidate_rtx (XEXP (x, 0), NULL_RTX, NULL);
       }
 #endif
 
@@ -8922,7 +8926,8 @@ reload_cse_regs_1 (first)
 
          for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1))
            if (GET_CODE (XEXP (x, 0)) == CLOBBER)
-             reload_cse_invalidate_rtx (XEXP (XEXP (x, 0), 0), NULL_RTX);
+             reload_cse_invalidate_rtx (XEXP (XEXP (x, 0), 0), NULL_RTX,
+                                        NULL);
        }
     }
 
@@ -9367,9 +9372,10 @@ static rtx reload_cse_check_src;
    second argument, which is passed by note_stores, is ignored.  */
 
 static void
-reload_cse_check_clobber (dest, ignore)
+reload_cse_check_clobber (dest, ignore, data)
      rtx dest;
      rtx ignore ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   if (reg_overlap_mentioned_p (dest, reload_cse_check_src))
     reload_cse_check_clobbered = 1;
@@ -9405,8 +9411,8 @@ reload_cse_record_set (set, body)
     x = XEXP (x, 0);
   if (push_operand (x, GET_MODE (x)))
     {
-      reload_cse_invalidate_rtx (stack_pointer_rtx, NULL_RTX);
-      reload_cse_invalidate_rtx (dest, NULL_RTX);
+      reload_cse_invalidate_rtx (stack_pointer_rtx, NULL_RTX, NULL);
+      reload_cse_invalidate_rtx (dest, NULL_RTX, NULL);
       return;
     }
 
@@ -9418,7 +9424,7 @@ reload_cse_record_set (set, body)
       || side_effects_p (src)
       || side_effects_p (dest))
     {
-      reload_cse_invalidate_rtx (dest, NULL_RTX);
+      reload_cse_invalidate_rtx (dest, NULL_RTX, NULL);
       return;
     }
 
@@ -9428,7 +9434,7 @@ reload_cse_record_set (set, body)
   if (reg_mentioned_p (cc0_rtx, src)
       || reg_mentioned_p (cc0_rtx, dest))
     {
-      reload_cse_invalidate_rtx (dest, NULL_RTX);
+      reload_cse_invalidate_rtx (dest, NULL_RTX, NULL);
       return;
     }
 #endif
@@ -9449,10 +9455,10 @@ reload_cse_record_set (set, body)
 
          reload_cse_check_clobbered = 0;
          reload_cse_check_src = src;
-         note_stores (x, reload_cse_check_clobber);
+         note_stores (x, reload_cse_check_clobber, NULL);
          if (reload_cse_check_clobbered)
            {
-             reload_cse_invalidate_rtx (dest, NULL_RTX);
+             reload_cse_invalidate_rtx (dest, NULL_RTX, NULL);
              return;
            }
        }
@@ -9767,7 +9773,7 @@ reload_combine ()
                }
            }
        }
-      note_stores (PATTERN (insn), reload_combine_note_store);
+      note_stores (PATTERN (insn), reload_combine_note_store, NULL);
       if (GET_CODE (insn) == CALL_INSN)
        {
          rtx link;
@@ -9830,8 +9836,9 @@ reload_combine ()
    update reg_state[regno].store_ruid and reg_state[regno].use_index
    accordingly.  Called via note_stores from reload_combine.  */
 static void
-reload_combine_note_store (dst, set)
+reload_combine_note_store (dst, set, data)
      rtx dst, set;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno = 0;
   int i;
@@ -10157,7 +10164,7 @@ reload_cse_move2add (first)
                }
            }
        }
-      note_stores (PATTERN (insn), move2add_note_store);
+      note_stores (PATTERN (insn), move2add_note_store, NULL);
       /* If this is a CALL_INSN, all call used registers are stored with
         unknown values.  */
       if (GET_CODE (insn) == CALL_INSN)
@@ -10178,8 +10185,9 @@ reload_cse_move2add (first)
    Update reg_set_luid, reg_offset and reg_base_reg accordingly.
    Called from reload_cse_move2add via note_stores.  */
 static void
-move2add_note_store (dst, set)
+move2add_note_store (dst, set, data)
      rtx dst, set;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno = 0;
   int i;
index d56552a..335b14e 100644 (file)
@@ -73,7 +73,7 @@ static HARD_REG_SET current_live_regs;
 
 static HARD_REG_SET pending_dead_regs;
 \f
-static void update_live_status         PROTO ((rtx, rtx));
+static void update_live_status         PROTO ((rtx, rtx, void *));
 static rtx next_insn_no_annul          PROTO ((rtx));
 static rtx find_dead_or_set_registers  PROTO ((rtx, struct resources*,
                                                rtx*, int, struct resources,
@@ -83,9 +83,10 @@ static rtx find_dead_or_set_registers        PROTO ((rtx, struct resources*,
    It deadens any CLOBBERed registers and livens any SET registers.  */
 
 static void
-update_live_status (dest, x)
+update_live_status (dest, x, data)
      rtx dest;
      rtx x;
+     void *data ATTRIBUTE_UNUSED;
 {
   int first_regno, last_regno;
   int i;
@@ -973,7 +974,7 @@ mark_target_live_regs (insns, target, res)
                      SET_HARD_REG_BIT (pending_dead_regs, i);
                  }
 
-             note_stores (PATTERN (real_insn), update_live_status);
+             note_stores (PATTERN (real_insn), update_live_status, NULL);
 
              /* If any registers were unused after this insn, kill them.
                 These notes will always be accurate.  */
index ccc89eb..e1e1b66 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1103,7 +1103,7 @@ extern int multiple_sets          PROTO((rtx));
 extern rtx find_last_value             PROTO((rtx, rtx *, rtx, int));
 extern int refers_to_regno_p           PROTO((int, int, rtx, rtx *));
 extern int reg_overlap_mentioned_p     PROTO((rtx, rtx));
-extern void note_stores                        PROTO((rtx, void (*)(rtx, rtx)));
+extern void note_stores                        PROTO((rtx, void (*)(rtx, rtx, void *), void *));
 extern rtx reg_set_last                        PROTO((rtx, rtx));
 extern int rtx_equal_p                 PROTO((rtx, rtx));
 extern int dead_or_set_p               PROTO((rtx, rtx));
index 012f6db..573bed0 100644 (file)
@@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA.  */
 #include "rtl.h"
 
 static int rtx_addr_can_trap_p PROTO((rtx));
-static void reg_set_p_1                PROTO((rtx, rtx));
-static void reg_set_last_1     PROTO((rtx, rtx));
+static void reg_set_p_1                PROTO((rtx, rtx, void *));
+static void reg_set_last_1     PROTO((rtx, rtx, void *));
 
 
 /* Forward declarations */
@@ -473,9 +473,10 @@ static rtx reg_set_reg;
 static int reg_set_flag;
 
 static void
-reg_set_p_1 (x, pat)
+reg_set_p_1 (x, pat, data)
      rtx x;
      rtx pat ATTRIBUTE_UNUSED;
+     void *data ATTRIBUTE_UNUSED;
 {
   /* We don't want to return 1 if X is a MEM that contains a register
      within REG_SET_REG.  */
@@ -514,7 +515,7 @@ reg_set_p (reg, insn)
 
   reg_set_reg = reg;
   reg_set_flag = 0;
-  note_stores (body, reg_set_p_1);
+  note_stores (body, reg_set_p_1, NULL);
   return reg_set_flag;
 }
 
@@ -980,9 +981,10 @@ static int reg_set_last_first_regno, reg_set_last_last_regno;
 /* Called via note_stores from reg_set_last.  */
 
 static void
-reg_set_last_1 (x, pat)
+reg_set_last_1 (x, pat, data)
      rtx x;
      rtx pat;
+     void *data ATTRIBUTE_UNUSED;
 {
   int first, last;
 
@@ -1047,7 +1049,7 @@ reg_set_last (x, insn)
        insn = PREV_INSN (insn))
     if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
       {
-       note_stores (PATTERN (insn), reg_set_last_1);
+       note_stores (PATTERN (insn), reg_set_last_1, NULL);
        if (reg_set_last_unknown)
          return 0;
        else if (reg_set_last_value)
@@ -1184,9 +1186,10 @@ rtx_equal_p (x, y)
   the SUBREG will be passed.  */
      
 void
-note_stores (x, fun)
+note_stores (x, fun, data)
      register rtx x;
-     void (*fun) PROTO ((rtx, rtx));
+     void (*fun) PROTO ((rtx, rtx, void *));
+     void *data;
 {
   if ((GET_CODE (x) == SET || GET_CODE (x) == CLOBBER))
     {
@@ -1204,10 +1207,10 @@ note_stores (x, fun)
        {
          register int i;
          for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
-           (*fun) (SET_DEST (XVECEXP (dest, 0, i)), x);
+           (*fun) (SET_DEST (XVECEXP (dest, 0, i)), x, data);
        }
       else
-       (*fun) (dest, x);
+       (*fun) (dest, x, data);
     }
   else if (GET_CODE (x) == PARALLEL)
     {
@@ -1231,10 +1234,10 @@ note_stores (x, fun)
                {
                  register int i;
                  for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
-                   (*fun) (SET_DEST (XVECEXP (dest, 0, i)), y);
+                   (*fun) (SET_DEST (XVECEXP (dest, 0, i)), y, data);
                }
              else
-               (*fun) (dest, y);
+               (*fun) (dest, y, data);
            }
        }
     }
index 09ea8ba..0d5a581 100644 (file)
@@ -128,7 +128,7 @@ static int stupid_reg_compare       PROTO((const PTR,const PTR));
 static int stupid_find_reg     PROTO((int, enum reg_class, enum machine_mode,
                                       int, int, int));
 static void stupid_mark_refs   PROTO((rtx, struct insn_chain *));
-static void find_clobbered_regs        PROTO((rtx, rtx));
+static void find_clobbered_regs        PROTO((rtx, rtx, void *));
 \f
 /* For communication between stupid_life_analysis and find_clobbered_regs.  */
 static struct insn_chain *current_chain;
@@ -138,8 +138,9 @@ static struct insn_chain *current_chain;
    of the appropriate insn_chain structure.  */
 
 static void
-find_clobbered_regs (reg, setter)
+find_clobbered_regs (reg, setter, data)
      rtx reg, setter;
+     void *data ATTRIBUTE_UNUSED;
 {
   int regno, nregs;
   if (setter == 0 || GET_CODE (setter) != CLOBBER)
@@ -344,7 +345,7 @@ stupid_life_analysis (f, nregs, file)
             pattern.  */
          current_chain = chain;
          if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
-           note_stores (PATTERN (insn), find_clobbered_regs);
+           note_stores (PATTERN (insn), find_clobbered_regs, NULL);
        }
 
       if (GET_CODE (insn) == JUMP_INSN && computed_jump_p (insn))