OSDN Git Service

PR c++/17413
[pf3gnuchains/gcc-fork.git] / gcc / f / com.c
index ce821c7..a64ef86 100644 (file)
@@ -264,14 +264,14 @@ struct _ffecom_concat_list_
 
 /* Static functions (internal). */
 
-static tree ffe_type_for_mode PARAMS ((enum machine_mode, int));
-static tree ffe_type_for_size PARAMS ((unsigned int, int));
-static tree ffe_unsigned_type PARAMS ((tree));
-static tree ffe_signed_type PARAMS ((tree));
-static tree ffe_signed_or_unsigned_type PARAMS ((int, tree));
-static bool ffe_mark_addressable PARAMS ((tree));
-static tree ffe_truthvalue_conversion PARAMS ((tree));
-static void ffecom_init_decl_processing PARAMS ((void));
+static tree ffe_type_for_mode (enum machine_mode, int);
+static tree ffe_type_for_size (unsigned int, int);
+static tree ffe_unsigned_type (tree);
+static tree ffe_signed_type (tree);
+static tree ffe_signed_or_unsigned_type (int, tree);
+static bool ffe_mark_addressable (tree);
+static tree ffe_truthvalue_conversion (tree);
+static void ffecom_init_decl_processing (void);
 static tree ffecom_arglist_expr_ (const char *argstring, ffebld args);
 static tree ffecom_widest_expr_type_ (ffebld list);
 static bool ffecom_overlap_ (tree dest_decl, tree dest_offset,
@@ -638,15 +638,16 @@ static GTY(()) tree shadowed_labels;
 \f
 /* Return the subscript expression, modified to do range-checking.
 
-   `array' is the array to be checked against.
+   `array' is the array type to be checked against.
    `element' is the subscript expression to check.
    `dim' is the dimension number (starting at 0).
    `total_dims' is the total number of dimensions (0 for CHARACTER substring).
+   `item' is the array decl or NULL_TREE.
 */
 
 static tree
 ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
-                        const char *array_name)
+                        const char *array_name, tree item)
 {
   tree low = TYPE_MIN_VALUE (TYPE_DOMAIN (array));
   tree high = TYPE_MAX_VALUE (TYPE_DOMAIN (array));
@@ -713,6 +714,10 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
         }
     }
 
+  /* If the array index is safe at compile-time, return element.  */
+  if (integer_nonzerop (cond))
+    return element;
+
   {
     int len;
     char *proc;
@@ -807,13 +812,10 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
   TREE_SIDE_EFFECTS (die) = 1;
   die = convert (void_type_node, die);
 
-  element = ffecom_3 (COND_EXPR,
-                     TREE_TYPE (element),
-                     cond,
-                     element,
-                     die);
+  if (integer_zerop (cond) && item)
+    ffe_mark_addressable (item);
 
-  return element;
+  return ffecom_3 (COND_EXPR, TREE_TYPE (element), cond, element, die);
 }
 
 /* Return the computed element of an array reference.
@@ -899,7 +901,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr)
          element = ffecom_expr_ (dims[i], NULL, NULL, NULL, FALSE, TRUE);
          if (flag_bounds_check)
            element = ffecom_subscript_check_ (array, element, i, total_dims,
-                                              array_name);
+                                              array_name, item);
          if (element == error_mark_node)
            return element;
 
@@ -945,7 +947,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr)
          element = ffecom_expr_ (dims[i], NULL, NULL, NULL, FALSE, TRUE);
          if (flag_bounds_check)
            element = ffecom_subscript_check_ (array, element, i, total_dims,
-                                              array_name);
+                                              array_name, item);
          if (element == error_mark_node)
            return element;
 
@@ -1530,8 +1532,7 @@ ffecom_possible_partial_overlap_ (ffebld expr1, ffebld expr2 ATTRIBUTE_UNUSED)
 
 static bool
 ffecom_overlap_ (tree dest_decl, tree dest_offset, tree dest_size,
-                tree source_tree, ffebld source UNUSED,
-                bool scalar_arg)
+                tree source_tree, ffebld source UNUSED, bool scalar_arg)
 {
   tree source_decl;
   tree source_offset;
@@ -1574,7 +1575,6 @@ ffecom_overlap_ (tree dest_decl, tree dest_offset, tree dest_size,
     case MIN_EXPR:
     case MAX_EXPR:
     case ABS_EXPR:
-    case FFS_EXPR:
     case LSHIFT_EXPR:
     case RSHIFT_EXPR:
     case LROTATE_EXPR:
@@ -1582,7 +1582,6 @@ ffecom_overlap_ (tree dest_decl, tree dest_offset, tree dest_size,
     case BIT_IOR_EXPR:
     case BIT_XOR_EXPR:
     case BIT_AND_EXPR:
-    case BIT_ANDTC_EXPR:
     case BIT_NOT_EXPR:
     case TRUTH_ANDIF_EXPR:
     case TRUTH_ORIF_EXPR:
@@ -1712,9 +1711,8 @@ ffecom_overlap_ (tree dest_decl, tree dest_offset, tree dest_size,
    in a COMMON area the callee might know about (and thus modify).  */
 
 static bool
-ffecom_args_overlapping_ (tree dest_tree, ffebld dest UNUSED,
-                         tree args, tree callee_commons,
-                         bool scalar_args)
+ffecom_args_overlapping_ (tree dest_tree, ffebld dest UNUSED, tree args,
+                         tree callee_commons, bool scalar_args)
 {
   tree arg;
   tree dest_decl;
@@ -1788,10 +1786,9 @@ ffecom_build_f2c_string_ (int i, const char *s)
    to the arglist a pointer to a temporary to receive the return value.         */
 
 static tree
-ffecom_call_ (tree fn, ffeinfoKindtype kt, bool is_f2c_complex,
-             tree type, tree args, tree dest_tree,
-             ffebld dest, bool *dest_used, tree callee_commons,
-             bool scalar_args, tree hook)
+ffecom_call_ (tree fn, ffeinfoKindtype kt, bool is_f2c_complex, tree type,
+             tree args, tree dest_tree, ffebld dest, bool *dest_used,
+             tree callee_commons, bool scalar_args, tree hook)
 {
   tree item;
   tree tempvar;
@@ -1849,9 +1846,9 @@ ffecom_call_ (tree fn, ffeinfoKindtype kt, bool is_f2c_complex,
 
 static tree
 ffecom_call_binop_ (tree fn, ffeinfoKindtype kt, bool is_f2c_complex,
-                   tree type, ffebld left, ffebld right,
-                   tree dest_tree, ffebld dest, bool *dest_used,
-                   tree callee_commons, bool scalar_args, bool ref, tree hook)
+                   tree type, ffebld left, ffebld right, tree dest_tree,
+                   ffebld dest, bool *dest_used, tree callee_commons,
+                   bool scalar_args, bool ref, tree hook)
 {
   tree left_tree;
   tree right_tree;
@@ -2042,7 +2039,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null)
                end_tree = ffecom_expr (end);
                if (flag_bounds_check)
                  end_tree = ffecom_subscript_check_ (array, end_tree, 1, 0,
-                                                     char_name);
+                                                     char_name, NULL_TREE);
                end_tree = convert (ffecom_f2c_ftnlen_type_node,
                                    end_tree);
 
@@ -2060,7 +2057,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null)
            start_tree = ffecom_expr (start);
            if (flag_bounds_check)
              start_tree = ffecom_subscript_check_ (array, start_tree, 0, 0,
-                                                   char_name);
+                                                   char_name, NULL_TREE);
            start_tree = convert (ffecom_f2c_ftnlen_type_node,
                                  start_tree);
 
@@ -2093,7 +2090,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null)
                end_tree = ffecom_expr (end);
                if (flag_bounds_check)
                  end_tree = ffecom_subscript_check_ (array, end_tree, 1, 0,
-                                                     char_name);
+                                                     char_name, NULL_TREE);
                end_tree = convert (ffecom_f2c_ftnlen_type_node,
                                    end_tree);
 
@@ -2929,8 +2926,8 @@ ffecom_do_entry_ (ffesymbol fn, int entrynum)
    made, destination used instead, and dest_used flag set TRUE.  */
 
 static tree
-ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
-             bool *dest_used, bool assignp, bool widenp)
+ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest, bool *dest_used,
+             bool assignp, bool widenp)
 {
   tree item;
   tree list;
@@ -3795,8 +3792,8 @@ ffecom_expr_ (ffebld expr, tree dest_tree, ffebld dest,
    subroutines.  */
 
 static tree
-ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree,
-                       ffebld dest, bool *dest_used)
+ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree, ffebld dest,
+                       bool *dest_used)
 {
   tree expr_tree;
   tree saved_expr1;            /* For those who need it. */
@@ -5901,8 +5898,7 @@ ffecom_f2c_make_type_ (tree *type, int tcode, const char *name)
    given size.  */
 
 static void
-ffecom_f2c_set_lio_code_ (ffeinfoBasictype bt, int size,
-                         int code)
+ffecom_f2c_set_lio_code_ (ffeinfoBasictype bt, int size, int code)
 {
   int j;
   tree t;
@@ -6308,8 +6304,7 @@ ffecom_init_zero_ (tree decl)
 }
 
 static tree
-ffecom_intrinsic_ichar_ (tree tree_type, ffebld arg,
-                        tree *maybe_tree)
+ffecom_intrinsic_ichar_ (tree tree_type, ffebld arg, tree *maybe_tree)
 {
   tree expr_tree;
   tree length_tree;
@@ -7052,7 +7047,7 @@ ffecom_push_dummy_decls_ (ffebld dummy_list, bool stmtfunc)
    equivalent of a Fortran program unit.  */
 
 static void
-ffecom_start_progunit_ ()
+ffecom_start_progunit_ (void)
 {
   ffesymbol fn = ffecom_primary_entry_;
   ffebld arglist;
@@ -7926,6 +7921,7 @@ ffecom_sym_transform_ (ffesymbol s)
              {
                ffetargetOffset offset;
                ffestorag cst;
+               tree toffset;
 
                cst = ffestorag_parent (st);
                assert (cst == ffesymbol_storage (cs));
@@ -7942,9 +7938,10 @@ ffecom_sym_transform_ (ffesymbol s)
                             ffecom_1 (ADDR_EXPR,
                                       build_pointer_type (TREE_TYPE (ct)),
                                       ct));
+               toffset = build_int_2 (offset, 0);
+               TREE_TYPE (toffset) = ssizetype;
                t = ffecom_2 (PLUS_EXPR, TREE_TYPE (t),
-                             t,
-                             build_int_2 (offset, 0));
+                             t, toffset);
                t = convert (build_pointer_type (type),
                             t);
                TREE_CONSTANT (t) = 1;
@@ -8078,8 +8075,8 @@ ffecom_sym_transform_ (ffesymbol s)
          DECL_EXTERNAL (t) = 1;
          TREE_PUBLIC (t) = 1;
 
-         t = start_decl (t, FALSE);
-         finish_decl (t, NULL_TREE, FALSE);
+         t = start_decl (t, ffe_is_globals ());
+         finish_decl (t, NULL_TREE, ffe_is_globals ());
 
          if ((g != NULL)
              && ((ffeglobal_type (g) == FFEGLOBAL_typeSUBR)
@@ -8764,8 +8761,7 @@ ffecom_transform_namelist_ (ffesymbol s)
    taking into account different units of measurements for offsets.  */
 
 static void
-ffecom_tree_canonize_ptr_ (tree *decl, tree *offset,
-                          tree t)
+ffecom_tree_canonize_ptr_ (tree *decl, tree *offset, tree t)
 {
   switch (TREE_CODE (t))
     {
@@ -8850,8 +8846,7 @@ ffecom_tree_canonize_ptr_ (tree *decl, tree *offset,
    reveal the overlap.  */
 
 static void
-ffecom_tree_canonize_ref_ (tree *decl, tree *offset,
-                          tree *size, tree t)
+ffecom_tree_canonize_ref_ (tree *decl, tree *offset, tree *size, tree t)
 {
   /* The default path is to report a nonexistant decl.  */
   *decl = NULL_TREE;
@@ -8890,7 +8885,6 @@ ffecom_tree_canonize_ref_ (tree *decl, tree *offset,
     case MIN_EXPR:
     case MAX_EXPR:
     case ABS_EXPR:
-    case FFS_EXPR:
     case LSHIFT_EXPR:
     case RSHIFT_EXPR:
     case LROTATE_EXPR:
@@ -8898,7 +8892,6 @@ ffecom_tree_canonize_ref_ (tree *decl, tree *offset,
     case BIT_IOR_EXPR:
     case BIT_XOR_EXPR:
     case BIT_AND_EXPR:
-    case BIT_ANDTC_EXPR:
     case BIT_NOT_EXPR:
     case TRUTH_ANDIF_EXPR:
     case TRUTH_ORIF_EXPR:
@@ -9004,9 +8997,8 @@ ffecom_tree_canonize_ref_ (tree *decl, tree *offset,
 /* Do divide operation appropriate to type of operands.  */
 
 static tree
-ffecom_tree_divide_ (tree tree_type, tree left, tree right,
-                    tree dest_tree, ffebld dest, bool *dest_used,
-                    tree hook)
+ffecom_tree_divide_ (tree tree_type, tree left, tree right, tree dest_tree,
+                    ffebld dest, bool *dest_used, tree hook)
 {
   if ((left == error_mark_node)
       || (right == error_mark_node))
@@ -9093,8 +9085,7 @@ ffecom_tree_divide_ (tree tree_type, tree left, tree right,
 /* Build type info for non-dummy variable.  */
 
 static tree
-ffecom_type_localvar_ (ffesymbol s, ffeinfoBasictype bt,
-                      ffeinfoKindtype kt)
+ffecom_type_localvar_ (ffesymbol s, ffeinfoBasictype bt, ffeinfoKindtype kt)
 {
   tree type;
   ffebld dl;
@@ -9152,7 +9143,7 @@ ffecom_type_localvar_ (ffesymbol s, ffeinfoBasictype bt,
 
 static GTY(()) tree ffecom_type_namelist_var;
 static tree
-ffecom_type_namelist_ ()
+ffecom_type_namelist_ (void)
 {
   if (ffecom_type_namelist_var == NULL_TREE)
     {
@@ -9183,7 +9174,7 @@ ffecom_type_namelist_ ()
 
 static GTY(()) tree ffecom_type_vardesc_var;
 static tree
-ffecom_type_vardesc_ ()
+ffecom_type_vardesc_ (void)
 {
   if (ffecom_type_vardesc_var == NULL_TREE)
     {
@@ -9547,8 +9538,7 @@ ffecom_1_fn (tree node)
    checking for certain housekeeping things.  */
 
 tree
-ffecom_2 (enum tree_code code, tree type, tree node1,
-         tree node2)
+ffecom_2 (enum tree_code code, tree type, tree node1, tree node2)
 {
   tree item;
 
@@ -9903,8 +9893,7 @@ ffecom_2pass_do_entrypoint (ffesymbol entry)
    TREE_SIDE_EFFECTS.  */
 
 tree
-ffecom_2s (enum tree_code code, tree type, tree node1,
-          tree node2)
+ffecom_2s (enum tree_code code, tree type, tree node1, tree node2)
 {
   tree item;
 
@@ -9922,8 +9911,7 @@ ffecom_2s (enum tree_code code, tree type, tree node1,
    checking for certain housekeeping things.  */
 
 tree
-ffecom_3 (enum tree_code code, tree type, tree node1,
-         tree node2, tree node3)
+ffecom_3 (enum tree_code code, tree type, tree node1, tree node2, tree node3)
 {
   tree item;
 
@@ -9945,8 +9933,7 @@ ffecom_3 (enum tree_code code, tree type, tree node1,
    TREE_SIDE_EFFECTS.  */
 
 tree
-ffecom_3s (enum tree_code code, tree type, tree node1,
-          tree node2, tree node3)
+ffecom_3s (enum tree_code code, tree type, tree node1, tree node2, tree node3)
 {
   tree item;
 
@@ -10561,8 +10548,8 @@ ffecom_constantunion (ffebldConstantUnion *cu, ffeinfoBasictype bt,
 /* Transform constant-union to tree, with the type known.  */
 
 tree
-ffecom_constantunion_with_type (ffebldConstantUnion *cu,
-                     tree tree_type, ffebldConst ct)
+ffecom_constantunion_with_type (ffebldConstantUnion *cu, tree tree_type,
+                               ffebldConst ct)
 {
   tree item;
 
@@ -10675,8 +10662,7 @@ ffecom_const_expr (ffebld expr)
 /* Handy way to make a field in a struct/union.  */
 
 tree
-ffecom_decl_field (tree context, tree prevfield,
-                  const char *name, tree type)
+ffecom_decl_field (tree context, tree prevfield, const char *name, tree type)
 {
   tree field;
 
@@ -10711,7 +10697,7 @@ ffecom_end_compstmt (void)
    Calls ffecom_sym_end_transition for each global and local symbol.  */
 
 void
-ffecom_end_transition ()
+ffecom_end_transition (void)
 {
   ffebld item;
 
@@ -10787,7 +10773,7 @@ ffecom_end_transition ()
    Make sure error updating not inhibited.  */
 
 void
-ffecom_exec_transition ()
+ffecom_exec_transition (void)
 {
   bool inhibited;
 
@@ -10977,7 +10963,7 @@ ffecom_expr_w (tree type, ffebld expr)
 /* Do global stuff.  */
 
 void
-ffecom_finish_compile ()
+ffecom_finish_compile (void)
 {
   assert (ffecom_outer_function_decl_ == NULL_TREE);
   assert (current_function_decl == NULL_TREE);
@@ -10997,7 +10983,7 @@ ffecom_finish_decl (tree decl, tree init, bool is_top_level)
 /* Finish a program unit.  */
 
 void
-ffecom_finish_progunit ()
+ffecom_finish_progunit (void)
 {
   ffecom_end_compstmt ();
 
@@ -11121,7 +11107,7 @@ ffecom_gfrt_kindtype (ffecomGfrt gfrt)
 }
 
 void
-ffecom_init_0 ()
+ffecom_init_0 (void)
 {
   tree endlink;
   int i;
@@ -11832,13 +11818,8 @@ ffecom_init_0 ()
 
   ffecom_float_zero_ = build_real (float_type_node, dconst0);
   ffecom_double_zero_ = build_real (double_type_node, dconst0);
-  {
-    REAL_VALUE_TYPE point_5;
-
-    REAL_ARITHMETIC (point_5, RDIV_EXPR, dconst1, dconst2);
-    ffecom_float_half_ = build_real (float_type_node, point_5);
-    ffecom_double_half_ = build_real (double_type_node, point_5);
-  }
+  ffecom_float_half_ = build_real (float_type_node, dconsthalf);
+  ffecom_double_half_ = build_real (double_type_node, dconsthalf);
 
   /* Do "extern int xargc;".  */
 
@@ -11889,7 +11870,7 @@ ffecom_init_0 ()
    ffecom_init_2();  */
 
 void
-ffecom_init_2 ()
+ffecom_init_2 (void)
 {
   assert (ffecom_outer_function_decl_ == NULL_TREE);
   assert (current_function_decl == NULL_TREE);
@@ -12049,8 +12030,7 @@ ffecom_lookup_label (ffelab label)
    the MODIFY_EXPR.  */
 
 tree
-ffecom_modify (tree newtype, tree lhs,
-              tree rhs)
+ffecom_modify (tree newtype, tree lhs, tree rhs)
 {
   if (lhs == error_mark_node || rhs == error_mark_node)
     return error_mark_node;
@@ -12992,7 +12972,7 @@ ffecom_sym_retract (ffesymbol s UNUSED)
 /* Create temporary gcc label.  */
 
 tree
-ffecom_temp_label ()
+ffecom_temp_label (void)
 {
   tree glabel;
   static int mynumber = 0;
@@ -13106,7 +13086,7 @@ ffecom_type_expr (ffebld expr)
    first ENTRY statement, and so on).  */
 
 tree
-ffecom_which_entrypoint_decl ()
+ffecom_which_entrypoint_decl (void)
 {
   assert (ffecom_which_entrypoint_decl_ != NULL_TREE);
 
@@ -13129,16 +13109,16 @@ ffecom_which_entrypoint_decl ()
    "bison_rule_foo_" so they are easy to find.  */
 
 static void
-bison_rule_pushlevel_ ()
+bison_rule_pushlevel_ (void)
 {
-  emit_line_note (input_filename, input_line);
+  emit_line_note (input_location);
   pushlevel (0);
   clear_last_expr ();
   expand_start_bindings (0);
 }
 
 static tree
-bison_rule_compstmt_ ()
+bison_rule_compstmt_ (void)
 {
   tree t;
   int keep = kept_level_p ();
@@ -13147,7 +13127,7 @@ bison_rule_compstmt_ ()
   if (! keep)
     current_binding_level->names = NULL_TREE;
 
-  emit_line_note (input_filename, input_line);
+  emit_line_note (input_location);
   expand_end_bindings (getdecls (), keep, 0);
   t = poplevel (keep, 1, 0);
 
@@ -13165,8 +13145,7 @@ bison_rule_compstmt_ ()
 
 tree
 builtin_function (const char *name, tree type, int function_code,
-                 enum built_in_class class,
-                 const char *library_name,
+                 enum built_in_class class, const char *library_name,
                  tree attrs ATTRIBUTE_UNUSED)
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
@@ -13322,8 +13301,7 @@ duplicate_decls (tree newdecl, tree olddecl)
       if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
          || (DECL_CONTEXT (newdecl) != 0 && DECL_CONTEXT (olddecl) == 0))
        {
-         DECL_SOURCE_LINE (newdecl) = DECL_SOURCE_LINE (olddecl);
-         DECL_SOURCE_FILE (newdecl) = DECL_SOURCE_FILE (olddecl);
+         DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
 
          if (DECL_CONTEXT (olddecl) == 0
              && TREE_CODE (newdecl) != FUNCTION_DECL)
@@ -13604,7 +13582,7 @@ finish_function (int nested)
 
       /* Obey `register' declarations if `setjmp' is called in this fn.  */
       /* Generate rtl for function exit.  */
-      expand_function_end (input_filename, input_line, 0);
+      expand_function_end ();
 
       /* If this is a nested function, protect the local variables in the stack
         above us from being collected while we're compiling this function.  */
@@ -13742,7 +13720,7 @@ lookup_name_current_level (tree name)
 /* Create a new `struct f_binding_level'.  */
 
 static struct f_binding_level *
-make_binding_level ()
+make_binding_level (void)
 {
   /* NOSTRICT */
   return ggc_alloc (sizeof (struct f_binding_level));
@@ -13765,7 +13743,7 @@ struct f_function *f_function_chain;
 /* Restore the variables used during compilation of a C function.  */
 
 static void
-pop_f_function_context ()
+pop_f_function_context (void)
 {
   struct f_function *p = f_function_chain;
   tree link;
@@ -13801,10 +13779,9 @@ pop_f_function_context ()
    used during compilation of a C function.  */
 
 static void
-push_f_function_context ()
+push_f_function_context (void)
 {
-  struct f_function *p
-  = (struct f_function *) xmalloc (sizeof (struct f_function));
+  struct f_function *p = xmalloc (sizeof (struct f_function));
 
   push_function_context ();
 
@@ -13884,11 +13861,9 @@ store_parm_decls (int is_main_program UNUSED)
   DECL_ARGUMENTS (fndecl) = storedecls (nreverse (getdecls ()));
 
   /* Initialize the RTL code for the function.  */
-
-  init_function_start (fndecl, input_filename, input_line);
+  init_function_start (fndecl);
 
   /* Set up parameters and prepare for return, for the function.  */
-
   expand_function_start (fndecl, 0);
 }
 
@@ -14069,7 +14044,7 @@ convert (tree type, tree expr)
    store the result back using `storedecls' or you will lose.  */
 
 tree
-getdecls ()
+getdecls (void)
 {
   return current_binding_level->names;
 }
@@ -14077,13 +14052,13 @@ getdecls ()
 /* Nonzero if we are currently in the global binding level.  */
 
 int
-global_bindings_p ()
+global_bindings_p (void)
 {
   return current_binding_level == global_binding_level;
 }
 
 static void
-ffecom_init_decl_processing ()
+ffecom_init_decl_processing (void)
 {
   malloc_init ();
 
@@ -14122,11 +14097,10 @@ insert_block (tree block)
 }
 
 /* Each front end provides its own.  */
-static bool ffe_init PARAMS ((void));
-static void ffe_finish PARAMS ((void));
-static bool ffe_post_options PARAMS ((const char **));
-static int ffe_init_options PARAMS ((void));
-static void ffe_print_identifier PARAMS ((FILE *, tree, int));
+static bool ffe_init (void);
+static void ffe_finish (void);
+static bool ffe_post_options (const char **);
+static void ffe_print_identifier (FILE *, tree, int);
 
 struct language_function GTY(())
 {
@@ -14211,8 +14185,7 @@ const char *const tree_code_name[] = {
 #undef DEFTREECODE
 
 static bool
-ffe_post_options (pfilename)
-     const char **pfilename;
+ffe_post_options (const char **pfilename)
 {
   const char *filename = *pfilename;
 
@@ -14233,10 +14206,10 @@ ffe_post_options (pfilename)
 
 
 static bool
-ffe_init ()
+ffe_init (void)
 {
 #ifdef IO_BUFFER_SIZE
-  setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
+  setvbuf (finput, xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
 #endif
 
   ffecom_init_decl_processing ();
@@ -14249,13 +14222,15 @@ ffe_init ()
      to try doing this.  */
   ffelex_hash_kludge (finput);
 
+  push_srcloc (input_filename, 0);
+
   /* FIXME: The ffelex_hash_kludge code needs to be cleaned up to
      set the new file name.  Maybe in ffe_post_options.  */
   return true;
 }
 
 static void
-ffe_finish ()
+ffe_finish (void)
 {
   ffe_terminate_0 ();
 
@@ -14265,20 +14240,6 @@ ffe_finish ()
   fclose (finput);
 }
 
-static int
-ffe_init_options ()
-{
-  /* Set default options for Fortran.  */
-  flag_move_all_movables = 1;
-  flag_reduce_all_givs = 1;
-  flag_argument_noalias = 2;
-  flag_merge_constants = 2;
-  flag_errno_math = 0;
-  flag_complex_divide_method = 1;
-
-  return 0;
-}
-
 static bool
 ffe_mark_addressable (tree exp)
 {
@@ -14611,7 +14572,7 @@ pushdecl (tree x)
 /* Nonzero if the current level needs to have a BLOCK made.  */
 
 static int
-kept_level_p ()
+kept_level_p (void)
 {
   tree decl;
 
@@ -14841,7 +14802,6 @@ ffe_truthvalue_conversion (tree expr)
     case NEGATE_EXPR:
     case ABS_EXPR:
     case FLOAT_EXPR:
-    case FFS_EXPR:
       /* These don't change whether an object is nonzero or zero.  */
       return ffe_truthvalue_conversion (TREE_OPERAND (expr, 0));
 
@@ -15140,7 +15100,6 @@ static struct file_buf {
 } instack[INPUT_STACK_MAX];
 
 static int last_error_tick = 0;           /* Incremented each time we print it.  */
-static int input_file_stack_tick = 0;  /* Incremented when status changes.  */
 
 /* Current nesting level of input sources.
    `instack[indepth]' is the level currently being read.  */
@@ -15169,7 +15128,8 @@ static struct file_name_map *read_name_map (const char *dirname);
    FIRST is the beginning of the chain to append, and LAST is the end.  */
 
 static void
-append_include_chain (struct file_name_list *first, struct file_name_list *last)
+append_include_chain (struct file_name_list *first,
+                     struct file_name_list *last)
 {
   struct file_name_list *dir;
 
@@ -15258,7 +15218,7 @@ open_include_file (char *filename, struct file_name_list *searchptr)
     }
   else
     {
-      dir = (char *) xmalloc (p - filename + 1);
+      dir = xmalloc (p - filename + 1);
       memcpy (dir, filename, p - filename);
       dir[p - filename] = '\0';
       from = p + 1;
@@ -15389,8 +15349,7 @@ read_name_map (const char *dirname)
     if (! strcmp (map_list_ptr->map_list_name, dirname))
       return map_list_ptr->map_list_map;
 
-  map_list_ptr = ((struct file_name_map_list *)
-                 xmalloc (sizeof (struct file_name_map_list)));
+  map_list_ptr = xmalloc (sizeof (struct file_name_map_list));
   map_list_ptr->map_list_name = xstrdup (dirname);
   map_list_ptr->map_list_map = NULL;
 
@@ -15420,8 +15379,7 @@ read_name_map (const char *dirname)
            ;
          to = read_filename_string (ch, f);
 
-         ptr = ((struct file_name_map *)
-                xmalloc (sizeof (struct file_name_map)));
+         ptr = xmalloc (sizeof (struct file_name_map));
          ptr->map_from = from;
 
          /* Make the real filename absolute.  */
@@ -15461,7 +15419,7 @@ ffecom_file_ (const char *name)
      early #line directives (when -g is in effect).  */
 
   fp = &instack[++indepth];
-  memset ((char *) fp, 0, sizeof (FILE_BUF));
+  memset (fp, 0, sizeof (FILE_BUF));
   if (name == NULL)
     name = "";
   fp->nominal_fname = fp->fname = name;
@@ -15486,8 +15444,8 @@ ffecom_decode_include_option (const char *dir)
     ignore_srcdir = 1;
   else
     {
-      struct file_name_list *dirtmp = (struct file_name_list *)
-       xmalloc (sizeof (struct file_name_list));
+      struct file_name_list *dirtmp
+       xmalloc (sizeof (struct file_name_list));
       dirtmp->next = 0;                /* New one goes on the end */
       dirtmp->fname = dir;
       dirtmp->got_name_map = 0;
@@ -15679,7 +15637,7 @@ ffecom_open_include_ (char *name, ffewhereLine l, ffewhereColumn c)
   instack[indepth].column = ffewhere_column_use (c);
 
   fp = &instack[indepth + 1];
-  memset ((char *) fp, 0, sizeof (FILE_BUF));
+  memset (fp, 0, sizeof (FILE_BUF));
   fp->nominal_fname = fp->fname = fname;
   fp->dir = searchptr;