OSDN Git Service

* expr.c (highest_pow2_factor_for_type): Rename into
[pf3gnuchains/gcc-fork.git] / gcc / integrate.c
index 3c0b42a..f30e3b9 100644 (file)
@@ -1,6 +1,6 @@
 /* Procedure integration for GCC.
    Copyright (C) 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GCC.
@@ -74,29 +74,23 @@ typedef struct initial_value_struct GTY(()) {
   initial_value_pair * GTY ((length ("%h.num_entries"))) entries;
 } initial_value_struct;
 
-static void setup_initial_hard_reg_value_integration PARAMS ((struct function *, struct inline_remap *));
-
-static rtvec initialize_for_inline     PARAMS ((tree));
-static void note_modified_parmregs     PARAMS ((rtx, rtx, void *));
-static void integrate_parm_decls       PARAMS ((tree, struct inline_remap *,
-                                                rtvec));
-static tree integrate_decl_tree                PARAMS ((tree,
-                                                struct inline_remap *));
-static void subst_constants            PARAMS ((rtx *, rtx,
-                                                struct inline_remap *, int));
-static void set_block_origin_self      PARAMS ((tree));
-static void set_block_abstract_flags   PARAMS ((tree, int));
-static void process_reg_param          PARAMS ((struct inline_remap *, rtx,
-                                                rtx));
-void set_decl_abstract_flags           PARAMS ((tree, int));
-static void mark_stores                 PARAMS ((rtx, rtx, void *));
-static void save_parm_insns            PARAMS ((rtx, rtx));
-static void copy_insn_list              PARAMS ((rtx, struct inline_remap *,
-                                                rtx));
-static void copy_insn_notes            PARAMS ((rtx, struct inline_remap *,
-                                                int));
-static int compare_blocks               PARAMS ((const PTR, const PTR));
-static int find_block                   PARAMS ((const PTR, const PTR));
+static void setup_initial_hard_reg_value_integration (struct function *,
+                                                     struct inline_remap *);
+
+static rtvec initialize_for_inline (tree);
+static void note_modified_parmregs (rtx, rtx, void *);
+static void integrate_parm_decls (tree, struct inline_remap *, rtvec);
+static tree integrate_decl_tree (tree, struct inline_remap *);
+static void subst_constants (rtx *, rtx, struct inline_remap *, int);
+static void set_block_origin_self (tree);
+static void set_block_abstract_flags (tree, int);
+static void process_reg_param (struct inline_remap *, rtx, rtx);
+static void mark_stores (rtx, rtx, void *);
+static void save_parm_insns (rtx, rtx);
+static void copy_insn_list (rtx, struct inline_remap *, rtx);
+static void copy_insn_notes (rtx, struct inline_remap *, int);
+static int compare_blocks (const void *, const void *);
+static int find_block (const void *, const void *);
 
 /* Used by copy_rtx_and_substitute; this indicates whether the function is
    called for the purpose of inlining or some other purpose (i.e. loop
@@ -110,9 +104,7 @@ static struct function *inlining = 0;
    explosions when the label_map gets very large.  */
 
 rtx
-get_label_from_map (map, i)
-     struct inline_remap *map;
-     int i;
+get_label_from_map (struct inline_remap *map, int i)
 {
   rtx x = map->label_map[i];
 
@@ -125,8 +117,7 @@ get_label_from_map (map, i)
 /* Return false if the function FNDECL cannot be inlined on account of its
    attributes, true otherwise.  */
 bool
-function_attribute_inlinable_p (fndecl)
-     tree fndecl;
+function_attribute_inlinable_p (tree fndecl)
 {
   if (targetm.attribute_table)
     {
@@ -152,8 +143,7 @@ function_attribute_inlinable_p (fndecl)
    for the function's name.  */
 
 const char *
-function_cannot_inline_p (fndecl)
-     tree fndecl;
+function_cannot_inline_p (tree fndecl)
 {
   rtx insn;
   tree last = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
@@ -182,6 +172,9 @@ function_cannot_inline_p (fndecl)
   if (current_function_calls_alloca)
     return N_("function using alloca cannot be inline");
 
+  if (current_function_calls_longjmp)
+    return N_("function using longjmp cannot be inline");
+  
   if (current_function_calls_setjmp)
     return N_("function using setjmp cannot be inline");
 
@@ -198,7 +191,7 @@ function_cannot_inline_p (fndecl)
   if (current_function_cannot_inline)
     return current_function_cannot_inline;
 
-  /* If its not even close, don't even look.  */
+  /* If it's not even close, don't even look.  */
   if (get_max_uid () > 3 * max_insns)
     return N_("function too large to be inline");
 
@@ -286,15 +279,14 @@ static int in_nonparm_insns;
    needed to save FNDECL's insns and info for future inline expansion.  */
 
 static rtvec
-initialize_for_inline (fndecl)
-     tree fndecl;
+initialize_for_inline (tree fndecl)
 {
   int i;
   rtvec arg_vector;
   tree parms;
 
   /* Clear out PARMDECL_MAP.  It was allocated in the caller's frame.  */
-  memset ((char *) parmdecl_map, 0, max_parm_reg * sizeof (tree));
+  memset (parmdecl_map, 0, max_parm_reg * sizeof (tree));
   arg_vector = rtvec_alloc (list_length (DECL_ARGUMENTS (fndecl)));
 
   for (parms = DECL_ARGUMENTS (fndecl), i = 0;
@@ -338,10 +330,7 @@ initialize_for_inline (fndecl)
    TO_FN.  */
 
 tree
-copy_decl_for_inlining (decl, from_fn, to_fn)
-     tree decl;
-     tree from_fn;
-     tree to_fn;
+copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn)
 {
   tree copy;
 
@@ -382,6 +371,8 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
   else
     {
       copy = copy_node (decl);
+      /* The COPY is not abstract; it will be generated in TO_FN.  */
+      DECL_ABSTRACT (copy) = 0;
       (*lang_hooks.dup_lang_specific_decl) (copy);
 
       /* TREE_ADDRESSABLE isn't used to indicate that a label's
@@ -423,8 +414,8 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
 }
 
 /* Make the insns and PARM_DECLs of the current function permanent
-   and record other information in DECL_SAVED_INSNS to allow inlining
-   of this function in subsequent calls.
+   and record other information in DECL_STRUCT_FUNCTION to allow
+   inlining of this function in subsequent calls.
 
    This routine need not copy any insns because we are not going
    to immediately compile the insns in the insn chain.  There
@@ -442,8 +433,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
    functions at the end of compilation.  */
 
 void
-save_for_inline (fndecl)
-     tree fndecl;
+save_for_inline (tree fndecl)
 {
   rtx insn;
   rtvec argvec;
@@ -455,7 +445,7 @@ save_for_inline (fndecl)
      for the parms, prior to elimination of virtual registers.
      These values are needed for substituting parms properly.  */
   if (! flag_no_inline)
-    parmdecl_map = (tree *) xmalloc (max_parm_reg * sizeof (tree));
+    parmdecl_map = xmalloc (max_parm_reg * sizeof (tree));
 
   /* Make and emit a return-label if we have not already done so.  */
 
@@ -505,7 +495,7 @@ save_for_inline (fndecl)
     }
   cfun->original_decl_initial = DECL_INITIAL (fndecl);
   cfun->no_debugging_symbols = (write_symbols == NO_DEBUG);
-  DECL_SAVED_INSNS (fndecl) = cfun;
+  cfun->saved_for_inline = 1;
 
   /* Clean up.  */
   if (! flag_no_inline)
@@ -519,9 +509,7 @@ save_for_inline (fndecl)
    register and track the new register's life.  */
 
 static void
-save_parm_insns (insn, first_nonparm_insn)
-     rtx insn;
-     rtx first_nonparm_insn;
+save_parm_insns (rtx insn, rtx first_nonparm_insn)
 {
   if (insn == NULL_RTX)
     return;
@@ -555,10 +543,7 @@ save_parm_insns (insn, first_nonparm_insn)
 /* Note whether a parameter is modified or not.  */
 
 static void
-note_modified_parmregs (reg, x, data)
-     rtx reg;
-     rtx x ATTRIBUTE_UNUSED;
-     void *data ATTRIBUTE_UNUSED;
+note_modified_parmregs (rtx reg, rtx x ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED)
 {
   if (GET_CODE (reg) == REG && in_nonparm_insns
       && REGNO (reg) < max_parm_reg
@@ -589,9 +574,7 @@ varray_type global_const_equiv_varray;
    Also, don't allow hard registers here; they might not be valid when
    substituted into insns.  */
 static void
-process_reg_param (map, loc, copy)
-     struct inline_remap *map;
-     rtx loc, copy;
+process_reg_param (struct inline_remap *map, rtx loc, rtx copy)
 {
   if ((GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG)
       || (GET_CODE (copy) == REG && REG_USERVAR_P (loc)
@@ -613,9 +596,7 @@ process_reg_param (map, loc, copy)
    two pointers, because it may overflow sizeof(int).  */
 
 static int
-compare_blocks (v1, v2)
-     const PTR v1;
-     const PTR v2;
+compare_blocks (const void *v1, const void *v2)
 {
   tree b1 = *((const tree *) v1);
   tree b2 = *((const tree *) v2);
@@ -631,9 +612,7 @@ compare_blocks (v1, v2)
    an original block; the second to a remapped equivalent.  */
 
 static int
-find_block (v1, v2)
-     const PTR v1;
-     const PTR v2;
+find_block (const void *v1, const void *v2)
 {
   const union tree_node *b1 = (const union tree_node *) v1;
   tree b2 = *((const tree *) v2);
@@ -659,16 +638,11 @@ find_block (v1, v2)
    else an rtx for where the value is stored.  */
 
 rtx
-expand_inline_function (fndecl, parms, target, ignore, type,
-                       structure_value_addr)
-     tree fndecl, parms;
-     rtx target;
-     int ignore;
-     tree type;
-     rtx structure_value_addr;
+expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
+                       tree type, rtx structure_value_addr)
 {
   struct function *inlining_previous;
-  struct function *inl_f = DECL_SAVED_INSNS (fndecl);
+  struct function *inl_f = DECL_STRUCT_FUNCTION (fndecl);
   tree formal, actual, block;
   rtx parm_insns = inl_f->emit->x_first_insn;
   rtx insns = (inl_f->inl_last_parm_insn
@@ -753,8 +727,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
   /* Expand the function arguments.  Do this first so that any
      new registers get created before we allocate the maps.  */
 
-  arg_vals = (rtx *) xmalloc (nargs * sizeof (rtx));
-  arg_trees = (tree *) xmalloc (nargs * sizeof (tree));
+  arg_vals = xmalloc (nargs * sizeof (rtx));
+  arg_trees = xmalloc (nargs * sizeof (tree));
 
   for (formal = DECL_ARGUMENTS (fndecl), actual = parms, i = 0;
        formal;
@@ -797,7 +771,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
                abort ();
 
              /* The mode if LOC and ARG can differ if LOC was a variable
-                that had its mode promoted via PROMOTED_MODE.  */
+                that had its mode promoted.  */
              arg_vals[i] = convert_modes (pmode,
                                           TYPE_MODE (TREE_TYPE (arg)),
                                           expand_expr (arg, NULL_RTX, mode,
@@ -813,10 +787,10 @@ expand_inline_function (fndecl, parms, target, ignore, type,
       /* If the formal type was const but the actual was not, we might
         end up here with an rtx wrongly tagged unchanging in the caller's
         context.  Fix that.  */
-      if (arg_vals[i] != 0 
+      if (arg_vals[i] != 0
          && (GET_CODE (arg_vals[i]) == REG || GET_CODE (arg_vals[i]) == MEM)
          && ! TREE_READONLY (TREE_VALUE (actual)))
-       RTX_UNCHANGING_P (arg_vals[i]) = 0;      
+       RTX_UNCHANGING_P (arg_vals[i]) = 0;
 
       if (arg_vals[i] != 0
          && (! TREE_READONLY (formal)
@@ -849,22 +823,21 @@ expand_inline_function (fndecl, parms, target, ignore, type,
 
   /* Allocate the structures we use to remap things.  */
 
-  map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
+  map = xcalloc (1, sizeof (struct inline_remap));
   map->fndecl = fndecl;
 
   VARRAY_TREE_INIT (map->block_map, 10, "block_map");
-  map->reg_map = (rtx *) xcalloc (max_regno, sizeof (rtx));
+  map->reg_map = xcalloc (max_regno, sizeof (rtx));
 
   /* We used to use alloca here, but the size of what it would try to
      allocate would occasionally cause it to exceed the stack limit and
      cause unpredictable core dumps.  */
-  real_label_map
-    = (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
+  real_label_map = xmalloc ((max_labelno) * sizeof (rtx));
   map->label_map = real_label_map;
   map->local_return_label = NULL_RTX;
 
   inl_max_uid = (inl_f->emit->x_cur_insn_uid + 1);
-  map->insn_map = (rtx *) xcalloc (inl_max_uid, sizeof (rtx));
+  map->insn_map = xcalloc (inl_max_uid, sizeof (rtx));
   map->min_insnno = 0;
   map->max_insnno = inl_max_uid;
 
@@ -898,7 +871,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
      insn that can be used as an insertion point.  */
   map->insns_at_start = get_last_insn ();
   if (map->insns_at_start == 0)
-    map->insns_at_start = emit_note (NULL, NOTE_INSN_DELETED);
+    map->insns_at_start = emit_note (NOTE_INSN_DELETED);
 
   map->regno_pointer_align = inl_f->emit->regno_pointer_align;
   map->x_regno_reg_rtx = inl_f->emit->x_regno_reg_rtx;
@@ -925,8 +898,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
   if (GET_CODE (parm_insns) == NOTE
       && NOTE_LINE_NUMBER (parm_insns) > 0)
     {
-      rtx note = emit_note (NOTE_SOURCE_FILE (parm_insns),
-                           NOTE_LINE_NUMBER (parm_insns));
+      rtx note = emit_note_copy (parm_insns);
+
       if (note)
        RTX_INTEGRATED_P (note) = 1;
     }
@@ -980,7 +953,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
             incoming arg rtx values are expanded now so that we can be
             sure we have enough slots in the const equiv map since the
             store_expr call can easily blow the size estimate.  */
-         if (DECL_SAVED_INSNS (fndecl)->args_size != 0)
+         if (DECL_STRUCT_FUNCTION (fndecl)->args_size != 0)
            copy_rtx_and_substitute (virtual_incoming_args_rtx, map, 0);
        }
       else if (GET_CODE (loc) == REG)
@@ -1017,8 +990,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
          && ! (GET_CODE (XEXP (loc, 0)) == REG
                && REGNO (XEXP (loc, 0)) > LAST_VIRTUAL_REGISTER))
        {
-         rtx note = emit_note (DECL_SOURCE_FILE (formal),
-                               DECL_SOURCE_LINE (formal));
+         rtx note = emit_line_note (DECL_SOURCE_LOCATION (formal));
+
          if (note)
            RTX_INTEGRATED_P (note) = 1;
 
@@ -1040,7 +1013,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
      REG_FUNCTION_RETURN_VALUE_P.  */
 
   map->inline_target = 0;
-  loc = (DECL_RTL_SET_P (DECL_RESULT (fndecl)) 
+  loc = (DECL_RTL_SET_P (DECL_RESULT (fndecl))
         ? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
 
   if (TYPE_MODE (type) == VOIDmode)
@@ -1058,7 +1031,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
       else
        {
          if (! structure_value_addr
-             || ! aggregate_value_p (DECL_RESULT (fndecl)))
+             || ! aggregate_value_p (DECL_RESULT (fndecl), fndecl))
            abort ();
 
          /* Pass the function the address in which to return a structure
@@ -1214,8 +1187,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
 
   /* Initialize label_map.  get_label_from_map will actually make
      the labels.  */
-  memset ((char *) &map->label_map[min_labelno], 0,
-        (max_labelno - min_labelno) * sizeof (rtx));
+  memset (&map->label_map[min_labelno], 0,
+         (max_labelno - min_labelno) * sizeof (rtx));
 
   /* Make copies of the decls of the symbols in the inline function, so that
      the copies of the variables get declared in the current function.  Set
@@ -1305,15 +1278,15 @@ expand_inline_function (fndecl, parms, target, ignore, type,
      This line number note is still needed for debugging though, so we can't
      delete it.  */
   if (flag_test_coverage)
-    emit_note (0, NOTE_INSN_REPEATED_LINE_NUMBER);
+    emit_note (NOTE_INSN_REPEATED_LINE_NUMBER);
 
-  emit_line_note (input_filename, input_line);
+  emit_line_note (input_location);
 
   /* If the function returns a BLKmode object in a register, copy it
      out of the temp register into a BLKmode memory object.  */
   if (target
       && TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == BLKmode
-      && ! aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl))))
+      && ! aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl)), fndecl))
     target = copy_blkmode_from_reg (0, target, TREE_TYPE (TREE_TYPE (fndecl)));
 
   if (structure_value_addr)
@@ -1349,10 +1322,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
    register for the function.  */
 
 static void
-copy_insn_list (insns, map, static_chain_value)
-     rtx insns;
-     struct inline_remap *map;
-     rtx static_chain_value;
+copy_insn_list (rtx insns, struct inline_remap *map, rtx static_chain_value)
 {
   int i;
   rtx insn;
@@ -1451,7 +1421,7 @@ copy_insn_list (insns, map, static_chain_value)
                  gen_rtx_MEM (GET_MODE (static_chain_incoming_rtx),
                               SET_DEST (set));
 
-             /* emit the instruction in case it is used for something
+             /* Emit the instruction in case it is used for something
                 other than setting the static chain; if it's not used,
                 it can always be removed as dead code */
              copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0));
@@ -1546,7 +1516,7 @@ copy_insn_list (insns, map, static_chain_value)
 #else
          try_constants (copy, map);
 #endif
-         INSN_SCOPE (copy) = INSN_SCOPE (insn);
+         INSN_LOCATOR (copy) = INSN_LOCATOR (insn);
          break;
 
        case JUMP_INSN:
@@ -1567,7 +1537,7 @@ copy_insn_list (insns, map, static_chain_value)
          cc0_insn = 0;
 #endif
          try_constants (copy, map);
-         INSN_SCOPE (copy) = INSN_SCOPE (insn);
+         INSN_LOCATOR (copy) = INSN_LOCATOR (insn);
 
          /* If this used to be a conditional jump insn but whose branch
             direction is now know, we must do something special.  */
@@ -1635,7 +1605,7 @@ copy_insn_list (insns, map, static_chain_value)
 
          SIBLING_CALL_P (copy) = SIBLING_CALL_P (insn);
          CONST_OR_PURE_CALL_P (copy) = CONST_OR_PURE_CALL_P (insn);
-         INSN_SCOPE (copy) = INSN_SCOPE (insn);
+         INSN_LOCATOR (copy) = INSN_LOCATOR (insn);
 
          /* Because the USAGE information potentially contains objects other
             than hard registers, we need to copy it.  */
@@ -1687,12 +1657,12 @@ copy_insn_list (insns, map, static_chain_value)
              && NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_BEG
              && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED)
            {
-             copy = emit_note (NOTE_SOURCE_FILE (insn),
-                               NOTE_LINE_NUMBER (insn));
-             if (copy
-                 && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
-                     || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
-                 && NOTE_BLOCK (insn))
+             copy = emit_note_copy (insn);
+             if (!copy)
+               /*Copied a line note, but line numbering is off*/;
+             else if ((NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
+                       || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
+                      && NOTE_BLOCK (insn))
                {
                  tree *mapped_block_p;
 
@@ -1708,8 +1678,7 @@ copy_insn_list (insns, map, static_chain_value)
                  else
                    NOTE_BLOCK (copy) = *mapped_block_p;
                }
-             else if (copy
-                      && NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
+             else if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
                NOTE_EXPECTED_VALUE (copy)
                  = copy_rtx_and_substitute (NOTE_EXPECTED_VALUE (insn),
                                             map, 0);
@@ -1734,10 +1703,7 @@ copy_insn_list (insns, map, static_chain_value)
    that are valid across the entire function.  */
 
 static void
-copy_insn_notes (insns, map, eh_region_offset)
-     rtx insns;
-     struct inline_remap *map;
-     int eh_region_offset;
+copy_insn_notes (rtx insns, struct inline_remap *map, int eh_region_offset)
 {
   rtx insn, new_insn;
 
@@ -1793,10 +1759,7 @@ copy_insn_notes (insns, map, eh_region_offset)
    push all of those decls and give each one the corresponding home.  */
 
 static void
-integrate_parm_decls (args, map, arg_vector)
-     tree args;
-     struct inline_remap *map;
-     rtvec arg_vector;
+integrate_parm_decls (tree args, struct inline_remap *map, rtvec arg_vector)
 {
   tree tail;
   int i;
@@ -1829,9 +1792,7 @@ integrate_parm_decls (args, map, arg_vector)
    no mapping is necessary.  */
 
 static tree
-integrate_decl_tree (let, map)
-     tree let;
-     struct inline_remap *map;
+integrate_decl_tree (tree let, struct inline_remap *map)
 {
   tree t;
   tree new_block;
@@ -1900,10 +1861,7 @@ integrate_decl_tree (let, map)
    calling `force_const_mem'.  */
 
 rtx
-copy_rtx_and_substitute (orig, map, for_lhs)
-     rtx orig;
-     struct inline_remap *map;
-     int for_lhs;
+copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs)
 {
   rtx copy, temp;
   int i, j;
@@ -1928,7 +1886,8 @@ copy_rtx_and_substitute (orig, map, for_lhs)
       regno = REGNO (orig);
       if (regno <= LAST_VIRTUAL_REGISTER
          || (map->integrating
-             && DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer == orig))
+             && DECL_STRUCT_FUNCTION (map->fndecl)->internal_arg_pointer
+                == orig))
        {
          /* Some hard registers are also mapped,
             but others are not translated.  */
@@ -1946,10 +1905,11 @@ copy_rtx_and_substitute (orig, map, for_lhs)
          else if (regno == VIRTUAL_STACK_VARS_REGNUM)
            {
              rtx loc, seq;
-             int size = get_func_frame_size (DECL_SAVED_INSNS (map->fndecl));
+             int size
+               = get_func_frame_size (DECL_STRUCT_FUNCTION (map->fndecl));
 #ifdef FRAME_GROWS_DOWNWARD
              int alignment
-               = (DECL_SAVED_INSNS (map->fndecl)->stack_alignment_needed
+               = (DECL_STRUCT_FUNCTION (map->fndecl)->stack_alignment_needed
                   / BITS_PER_UNIT);
 
              /* In this case, virtual_stack_vars_rtx points to one byte
@@ -1984,13 +1944,13 @@ copy_rtx_and_substitute (orig, map, for_lhs)
            }
          else if (regno == VIRTUAL_INCOMING_ARGS_REGNUM
                   || (map->integrating
-                      && (DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer
+                      && (DECL_STRUCT_FUNCTION (map->fndecl)->internal_arg_pointer
                           == orig)))
            {
              /* Do the same for a block to contain any arguments referenced
                 in memory.  */
              rtx loc, seq;
-             int size = DECL_SAVED_INSNS (map->fndecl)->args_size;
+             int size = DECL_STRUCT_FUNCTION (map->fndecl)->args_size;
 
              start_sequence ();
              loc = assign_stack_temp (BLKmode, size, 1);
@@ -2052,7 +2012,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
            {
              if (!map->leaf_reg_map[regno][mode])
                map->leaf_reg_map[regno][mode] = gen_rtx_REG (mode, regno);
-             return map->leaf_reg_map[regno][mode]; 
+             return map->leaf_reg_map[regno][mode];
            }
 #endif
          else
@@ -2132,7 +2092,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
       if (NOTE_LINE_NUMBER (orig) != NOTE_INSN_DELETED_LABEL)
        break;
 
-      /* ... FALLTHRU ...  */
+      /* Fall through.  */
     case CODE_LABEL:
       LABEL_PRESERVE_P (get_label_from_map (map, CODE_LABEL_NUMBER (orig)))
        = LABEL_PRESERVE_P (orig);
@@ -2202,11 +2162,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
 #endif
 
              temp = XEXP (temp, 0);
-
-#ifdef POINTERS_EXTEND_UNSIGNED
-             if (GET_MODE (temp) != GET_MODE (orig))
-               temp = convert_memory_address (GET_MODE (orig), temp);
-#endif
+             temp = convert_memory_address (GET_MODE (orig), temp);
              return temp;
            }
          else if (GET_CODE (constant) == LABEL_REF)
@@ -2215,6 +2171,8 @@ copy_rtx_and_substitute (orig, map, for_lhs)
                          copy_rtx_and_substitute (constant, map, for_lhs)),
                         0);
        }
+      else if (TREE_CONSTANT_POOL_ADDRESS_P (orig) && inlining)
+       notice_rtl_inlining_of_deferred_constant ();
 
       return orig;
 
@@ -2280,7 +2238,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
          MEM_COPY_ATTRIBUTES (copy, XEXP (orig, 0));
 
          return
-           gen_rtx_CALL (GET_MODE (orig), copy, 
+           gen_rtx_CALL (GET_MODE (orig), copy,
                          copy_rtx_and_substitute (XEXP (orig, 1), map, 0));
        }
       break;
@@ -2385,8 +2343,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
       switch (*format_ptr++)
        {
        case '0':
-         /* Copy this through the wide int field; that's safest.  */
-         X0WINT (copy, i) = X0WINT (orig, i);
+         X0ANY (copy, i) = X0ANY (orig, i);
          break;
 
        case 'e':
@@ -2447,9 +2404,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
 /* Substitute known constant values into INSN, if that is valid.  */
 
 void
-try_constants (insn, map)
-     rtx insn;
-     struct inline_remap *map;
+try_constants (rtx insn, struct inline_remap *map)
 {
   int i;
 
@@ -2464,6 +2419,14 @@ try_constants (insn, map)
   subst_constants (&PATTERN (insn), insn, map, 0);
   apply_change_group ();
 
+  /* Enforce consistency between the addresses in the regular insn flow
+     and the ones in CALL_INSN_FUNCTION_USAGE lists, if any.  */
+  if (GET_CODE (insn) == CALL_INSN && CALL_INSN_FUNCTION_USAGE (insn))
+    {
+      subst_constants (&CALL_INSN_FUNCTION_USAGE (insn), insn, map, 1);
+      apply_change_group ();
+    }
+
   /* Show we don't know the value of anything stored or clobbered.  */
   note_stores (PATTERN (insn), mark_stores, NULL);
   map->last_pc_value = 0;
@@ -2513,11 +2476,7 @@ try_constants (insn, map)
    If MEMONLY is nonzero, only make changes inside a MEM.  */
 
 static void
-subst_constants (loc, insn, map, memonly)
-     rtx *loc;
-     rtx insn;
-     struct inline_remap *map;
-     int memonly;
+subst_constants (rtx *loc, rtx insn, struct inline_remap *map, int memonly)
 {
   rtx x = *loc;
   int i, j;
@@ -2591,7 +2550,7 @@ subst_constants (loc, insn, map, memonly)
             integral mode and extracting the low part.  */
          subst_constants (&inner, NULL_RTX, map, 0);
          new = simplify_gen_subreg (GET_MODE (x), inner,
-                                    GET_MODE (SUBREG_REG (x)),
+                                    GET_MODE (SUBREG_REG (x)),
                                     SUBREG_BYTE (x));
 
          if (new)
@@ -2752,7 +2711,8 @@ subst_constants (loc, insn, map, memonly)
   /* If this is a commutative operation, move a constant to the second
      operand unless the second operand is already a CONST_INT.  */
   if (! memonly
-      && (GET_RTX_CLASS (code) == 'c' || code == NE || code == EQ)
+      && (GET_RTX_CLASS (code) == RTX_COMM_ARITH
+         || GET_RTX_CLASS (code) == RTX_COMM_COMPARE)
       && CONSTANT_P (XEXP (x, 0)) && GET_CODE (XEXP (x, 1)) != CONST_INT)
     {
       rtx tem = XEXP (x, 0);
@@ -2764,14 +2724,15 @@ subst_constants (loc, insn, map, memonly)
   if (! memonly)
     switch (GET_RTX_CLASS (code))
       {
-      case '1':
+      case RTX_UNARY:
        if (op0_mode == MAX_MACHINE_MODE)
          abort ();
        new = simplify_unary_operation (code, GET_MODE (x),
                                        XEXP (x, 0), op0_mode);
        break;
 
-      case '<':
+      case RTX_COMPARE:
+      case RTX_COMM_COMPARE:
        {
          enum machine_mode op_mode = GET_MODE (XEXP (x, 0));
 
@@ -2798,14 +2759,14 @@ subst_constants (loc, insn, map, memonly)
          break;
        }
 
-      case '2':
-      case 'c':
+      case RTX_BIN_ARITH:
+      case RTX_COMM_ARITH:
        new = simplify_binary_operation (code, GET_MODE (x),
                                         XEXP (x, 0), XEXP (x, 1));
        break;
 
-      case 'b':
-      case '3':
+      case RTX_BITFIELD_OPS:
+      case RTX_TERNARY:
        if (op0_mode == MAX_MACHINE_MODE)
          abort ();
 
@@ -2813,7 +2774,7 @@ subst_constants (loc, insn, map, memonly)
          {
            rtx op0 = XEXP (x, 0);
 
-           if (GET_RTX_CLASS (GET_CODE (op0)) == '<'
+           if (COMPARISON_P (op0)
                && GET_MODE (op0) == VOIDmode
                && ! side_effects_p (op0)
                && XEXP (op0, 0) == map->compare_src
@@ -2838,6 +2799,9 @@ subst_constants (loc, insn, map, memonly)
                                            XEXP (x, 0), XEXP (x, 1),
                                            XEXP (x, 2));
        break;
+
+      default:
+       break;
       }
 
   if (new)
@@ -2848,10 +2812,7 @@ subst_constants (loc, insn, map, memonly)
    called from note_stores with parts of the new insn.  */
 
 static void
-mark_stores (dest, x, data)
-     rtx dest;
-     rtx x ATTRIBUTE_UNUSED;
-     void *data ATTRIBUTE_UNUSED;
+mark_stores (rtx dest, rtx x ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED)
 {
   int regno = -1;
   enum machine_mode mode = VOIDmode;
@@ -2876,7 +2837,7 @@ mark_stores (dest, x, data)
     {
       unsigned int uregno = regno;
       unsigned int last_reg = (uregno >= FIRST_PSEUDO_REGISTER ? uregno
-                              : uregno + HARD_REGNO_NREGS (uregno, mode) - 1);
+                              : uregno + hard_regno_nregs[uregno][mode] - 1);
       unsigned int i;
 
       /* Ignore virtual stack var or virtual arg register since those
@@ -2900,8 +2861,7 @@ mark_stores (dest, x, data)
    values to point to themselves.  */
 
 static void
-set_block_origin_self (stmt)
-     tree stmt;
+set_block_origin_self (tree stmt)
 {
   if (BLOCK_ABSTRACT_ORIGIN (stmt) == NULL_TREE)
     {
@@ -2939,8 +2899,7 @@ set_block_origin_self (stmt)
    point to themselves.  */
 
 void
-set_decl_origin_self (decl)
-     tree decl;
+set_decl_origin_self (tree decl)
 {
   if (DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE)
     {
@@ -2964,9 +2923,7 @@ set_decl_origin_self (decl)
    (recursively) which are contained therein.  */
 
 static void
-set_block_abstract_flags (stmt, setting)
-     tree stmt;
-     int setting;
+set_block_abstract_flags (tree stmt, int setting)
 {
   tree local_decl;
   tree subblock;
@@ -2991,9 +2948,7 @@ set_block_abstract_flags (stmt, setting)
    blocks and sub-blocks (recursively) to the same setting.  */
 
 void
-set_decl_abstract_flags (decl, setting)
-     tree decl;
-     int setting;
+set_decl_abstract_flags (tree decl, int setting)
 {
   DECL_ABSTRACT (decl) = setting;
   if (TREE_CODE (decl) == FUNCTION_DECL)
@@ -3008,19 +2963,18 @@ set_decl_abstract_flags (decl, setting)
     }
 }
 \f
-/* Output the assembly language code for the function FNDECL
-   from its DECL_SAVED_INSNS.  Used for inline functions that are output
+/* Output the assembly language code for the function FNDECL from
+   its DECL_STRUCT_FUNCTION.  Used for inline functions that are output
    at end of compilation instead of where they came in the source.  */
 
 static GTY(()) struct function *old_cfun;
 
 void
-output_inline_function (fndecl)
-     tree fndecl;
+output_inline_function (tree fndecl)
 {
   enum debug_info_type old_write_symbols = write_symbols;
   const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks;
-  struct function *f = DECL_SAVED_INSNS (fndecl);
+  struct function *f = DECL_STRUCT_FUNCTION (fndecl);
 
   old_cfun = cfun;
   cfun = f;
@@ -3059,9 +3013,7 @@ output_inline_function (fndecl)
    the function.  */
 
 rtx
-get_hard_reg_initial_reg (fun, reg)
-     struct function *fun;
-     rtx reg;
+get_hard_reg_initial_reg (struct function *fun, rtx reg)
 {
   struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
   int i;
@@ -3077,9 +3029,7 @@ get_hard_reg_initial_reg (fun, reg)
 }
 
 rtx
-has_func_hard_reg_initial_val (fun, reg)
-     struct function *fun;
-     rtx reg;
+has_func_hard_reg_initial_val (struct function *fun, rtx reg)
 {
   struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
   int i;
@@ -3095,9 +3045,7 @@ has_func_hard_reg_initial_val (fun, reg)
 }
 
 rtx
-get_func_hard_reg_initial_val (fun, reg)
-     struct function *fun;
-     rtx reg;
+get_func_hard_reg_initial_val (struct function *fun, rtx reg)
 {
   struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
   rtx rv = has_func_hard_reg_initial_val (fun, reg);
@@ -3107,20 +3055,19 @@ get_func_hard_reg_initial_val (fun, reg)
 
   if (ivs == 0)
     {
-      fun->hard_reg_initial_vals = (void *) ggc_alloc (sizeof (initial_value_struct));
+      fun->hard_reg_initial_vals = ggc_alloc (sizeof (initial_value_struct));
       ivs = fun->hard_reg_initial_vals;
       ivs->num_entries = 0;
       ivs->max_entries = 5;
-      ivs->entries = (initial_value_pair *) ggc_alloc (5 * sizeof (initial_value_pair));
+      ivs->entries = ggc_alloc (5 * sizeof (initial_value_pair));
     }
 
   if (ivs->num_entries >= ivs->max_entries)
     {
       ivs->max_entries += 5;
-      ivs->entries = 
-       (initial_value_pair *) ggc_realloc (ivs->entries,
-                                           ivs->max_entries
-                                           * sizeof (initial_value_pair));
+      ivs->entries = ggc_realloc (ivs->entries,
+                                 ivs->max_entries
+                                 * sizeof (initial_value_pair));
     }
 
   ivs->entries[ivs->num_entries].hard_reg = reg;
@@ -3130,25 +3077,19 @@ get_func_hard_reg_initial_val (fun, reg)
 }
 
 rtx
-get_hard_reg_initial_val (mode, regno)
-     enum machine_mode mode;
-     int regno;
+get_hard_reg_initial_val (enum machine_mode mode, int regno)
 {
   return get_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno));
 }
 
 rtx
-has_hard_reg_initial_val (mode, regno)
-     enum machine_mode mode;
-     int regno;
+has_hard_reg_initial_val (enum machine_mode mode, int regno)
 {
   return has_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno));
 }
 
 static void
-setup_initial_hard_reg_value_integration (inl_f, remap)
-     struct function *inl_f;
-     struct inline_remap *remap;
+setup_initial_hard_reg_value_integration (struct function *inl_f, struct inline_remap *remap)
 {
   struct initial_value_struct *ivs = inl_f->hard_reg_initial_vals;
   int i;
@@ -3163,7 +3104,7 @@ setup_initial_hard_reg_value_integration (inl_f, remap)
 
 
 void
-emit_initial_value_sets ()
+emit_initial_value_sets (void)
 {
   struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;
   int i;
@@ -3184,8 +3125,7 @@ emit_initial_value_sets ()
 /* If the backend knows where to allocate pseudos for hard
    register initial values, register these allocations now.  */
 void
-allocate_initial_values (reg_equiv_memory_loc)
-     rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED;
+allocate_initial_values (rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED)
 {
 #ifdef ALLOCATE_INITIAL_VALUE
   struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;