[AArch64 Testsuite] vld1_lane.c: Remove unused test data
[platform/upstream/gcc.git] / gcc / targhooks.c
index 6c08385..3eca47e 100644 (file)
@@ -1,5 +1,5 @@
 /* Default target hook functions.
-   Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   Copyright (C) 2003-2015 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -50,36 +50,42 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "machmode.h"
 #include "rtl.h"
+#include "alias.h"
 #include "tree.h"
+#include "fold-const.h"
 #include "stor-layout.h"
 #include "varasm.h"
+#include "function.h"
+#include "flags.h"
+#include "insn-config.h"
+#include "expmed.h"
+#include "dojump.h"
+#include "explow.h"
+#include "calls.h"
+#include "emit-rtl.h"
+#include "stmt.h"
 #include "expr.h"
 #include "output.h"
 #include "diagnostic-core.h"
-#include "function.h"
 #include "target.h"
 #include "tm_p.h"
-#include "target-def.h"
-#include "ggc.h"
-#include "hard-reg-set.h"
 #include "regs.h"
 #include "reload.h"
+#include "insn-codes.h"
 #include "optabs.h"
 #include "recog.h"
 #include "intl.h"
 #include "opts.h"
-#include "gimple.h"
+#include "tree-ssa-alias.h"
+#include "gimple-expr.h"
 #include "gimplify.h"
 #include "stringpool.h"
 #include "tree-ssanames.h"
-#include "tree-ssa-alias.h"
-#include "insn-codes.h"
 
 
 bool
-default_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+default_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED,
                              rtx addr ATTRIBUTE_UNUSED,
                              bool strict ATTRIBUTE_UNUSED)
 {
@@ -120,9 +126,9 @@ default_unspec_may_trap_p (const_rtx x, unsigned flags)
   return 0;
 }
 
-enum machine_mode
+machine_mode
 default_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
-                              enum machine_mode mode,
+                              machine_mode mode,
                               int *punsignedp ATTRIBUTE_UNUSED,
                               const_tree funtype ATTRIBUTE_UNUSED,
                               int for_return ATTRIBUTE_UNUSED)
@@ -132,9 +138,9 @@ default_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
   return mode;
 }
 
-enum machine_mode
+machine_mode
 default_promote_function_mode_always_promote (const_tree type,
-                                             enum machine_mode mode,
+                                             machine_mode mode,
                                              int *punsignedp,
                                              const_tree funtype ATTRIBUTE_UNUSED,
                                              int for_return ATTRIBUTE_UNUSED)
@@ -142,8 +148,8 @@ default_promote_function_mode_always_promote (const_tree type,
   return promote_mode (type, mode, punsignedp);
 }
 
-enum machine_mode
-default_cc_modes_compatible (enum machine_mode m1, enum machine_mode m2)
+machine_mode
+default_cc_modes_compatible (machine_mode m1, machine_mode m2)
 {
   if (m1 == m2)
     return m1;
@@ -159,11 +165,19 @@ default_return_in_memory (const_tree type,
 
 rtx
 default_legitimize_address (rtx x, rtx orig_x ATTRIBUTE_UNUSED,
-                           enum machine_mode mode ATTRIBUTE_UNUSED)
+                           machine_mode mode ATTRIBUTE_UNUSED)
 {
   return x;
 }
 
+bool
+default_legitimize_address_displacement (rtx *disp ATTRIBUTE_UNUSED,
+                                        rtx *offset ATTRIBUTE_UNUSED,
+                                        machine_mode mode ATTRIBUTE_UNUSED)
+{
+  return false;
+}
+
 rtx
 default_expand_builtin_saveregs (void)
 {
@@ -173,7 +187,7 @@ default_expand_builtin_saveregs (void)
 
 void
 default_setup_incoming_varargs (cumulative_args_t ca ATTRIBUTE_UNUSED,
-                               enum machine_mode mode ATTRIBUTE_UNUSED,
+                               machine_mode mode ATTRIBUTE_UNUSED,
                                tree type ATTRIBUTE_UNUSED,
                                int *pretend_arg_size ATTRIBUTE_UNUSED,
                                int second_time ATTRIBUTE_UNUSED)
@@ -203,25 +217,25 @@ default_pretend_outgoing_varargs_named (cumulative_args_t ca ATTRIBUTE_UNUSED)
          != default_setup_incoming_varargs);
 }
 
-enum machine_mode
+machine_mode
 default_eh_return_filter_mode (void)
 {
   return targetm.unwind_word_mode ();
 }
 
-enum machine_mode
+machine_mode
 default_libgcc_cmp_return_mode (void)
 {
   return word_mode;
 }
 
-enum machine_mode
+machine_mode
 default_libgcc_shift_count_mode (void)
 {
   return word_mode;
 }
 
-enum machine_mode
+machine_mode
 default_unwind_word_mode (void)
 {
   return word_mode;
@@ -230,7 +244,7 @@ default_unwind_word_mode (void)
 /* The default implementation of TARGET_SHIFT_TRUNCATION_MASK.  */
 
 unsigned HOST_WIDE_INT
-default_shift_truncation_mask (enum machine_mode mode)
+default_shift_truncation_mask (machine_mode mode)
 {
   return SHIFT_COUNT_TRUNCATED ? GET_MODE_BITSIZE (mode) - 1 : 0;
 }
@@ -238,7 +252,7 @@ default_shift_truncation_mask (enum machine_mode mode)
 /* The default implementation of TARGET_MIN_DIVISIONS_FOR_RECIP_MUL.  */
 
 unsigned int
-default_min_divisions_for_recip_mul (enum machine_mode mode ATTRIBUTE_UNUSED)
+default_min_divisions_for_recip_mul (machine_mode mode ATTRIBUTE_UNUSED)
 {
   return have_insn_for (DIV, mode) ? 3 : 2;
 }
@@ -246,8 +260,8 @@ default_min_divisions_for_recip_mul (enum machine_mode mode ATTRIBUTE_UNUSED)
 /* The default implementation of TARGET_MODE_REP_EXTENDED.  */
 
 int
-default_mode_rep_extended (enum machine_mode mode ATTRIBUTE_UNUSED,
-                          enum machine_mode mode_rep ATTRIBUTE_UNUSED)
+default_mode_rep_extended (machine_mode mode ATTRIBUTE_UNUSED,
+                          machine_mode mode_rep ATTRIBUTE_UNUSED)
 {
   return UNKNOWN;
 }
@@ -262,7 +276,7 @@ hook_bool_CUMULATIVE_ARGS_true (cumulative_args_t a ATTRIBUTE_UNUSED)
 
 /* Return machine mode for non-standard suffix
    or VOIDmode if non-standard suffixes are unsupported.  */
-enum machine_mode
+machine_mode
 default_mode_for_suffix (char suffix ATTRIBUTE_UNUSED)
 {
   return VOIDmode;
@@ -291,7 +305,7 @@ default_cxx_get_cookie_size (tree type)
 
   sizetype_size = size_in_bytes (sizetype);
   type_align = size_int (TYPE_ALIGN_UNIT (type));
-  if (INT_CST_LT_UNSIGNED (type_align, sizetype_size))
+  if (tree_int_cst_lt (type_align, sizetype_size))
     cookie_size = sizetype_size;
   else
     cookie_size = type_align;
@@ -304,7 +318,7 @@ default_cxx_get_cookie_size (tree type)
 
 bool
 hook_pass_by_reference_must_pass_in_stack (cumulative_args_t c ATTRIBUTE_UNUSED,
-       enum machine_mode mode ATTRIBUTE_UNUSED, const_tree type ATTRIBUTE_UNUSED,
+       machine_mode mode ATTRIBUTE_UNUSED, const_tree type ATTRIBUTE_UNUSED,
        bool named_arg ATTRIBUTE_UNUSED)
 {
   return targetm.calls.must_pass_in_stack (mode, type);
@@ -315,7 +329,7 @@ hook_pass_by_reference_must_pass_in_stack (cumulative_args_t c ATTRIBUTE_UNUSED,
 
 bool
 hook_callee_copies_named (cumulative_args_t ca ATTRIBUTE_UNUSED,
-                         enum machine_mode mode ATTRIBUTE_UNUSED,
+                         machine_mode mode ATTRIBUTE_UNUSED,
                          const_tree type ATTRIBUTE_UNUSED, bool named)
 {
   return named;
@@ -382,7 +396,7 @@ default_mangle_assembler_name (const char *name ATTRIBUTE_UNUSED)
    supported by optabs.c.  */
 
 bool
-default_scalar_mode_supported_p (enum machine_mode mode)
+default_scalar_mode_supported_p (machine_mode mode)
 {
   int precision = GET_MODE_PRECISION (mode);
 
@@ -425,6 +439,33 @@ default_scalar_mode_supported_p (enum machine_mode mode)
     }
 }
 
+/* Return true if libgcc supports floating-point mode MODE (known to
+   be supported as a scalar mode).  */
+
+bool
+default_libgcc_floating_mode_supported_p (machine_mode mode)
+{
+  switch (mode)
+    {
+#ifdef HAVE_SFmode
+    case SFmode:
+#endif
+#ifdef HAVE_DFmode
+    case DFmode:
+#endif
+#ifdef HAVE_XFmode
+    case XFmode:
+#endif
+#ifdef HAVE_TFmode
+    case TFmode:
+#endif
+      return true;
+
+    default:
+      return false;
+    }
+}
+
 /* Make some target macros useable by target-independent code.  */
 bool
 targhook_words_big_endian (void)
@@ -486,7 +527,7 @@ default_has_ifunc_p (void)
    these cases.  */
 
 const char *
-default_invalid_within_doloop (const_rtx insn)
+default_invalid_within_doloop (const rtx_insn *insn)
 {
   if (CALL_P (insn))
     return "Function call in loop.";
@@ -570,7 +611,7 @@ default_builtin_reciprocal (unsigned int fn ATTRIBUTE_UNUSED,
 bool
 hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false (
        cumulative_args_t ca ATTRIBUTE_UNUSED,
-       enum machine_mode mode ATTRIBUTE_UNUSED,
+       machine_mode mode ATTRIBUTE_UNUSED,
        const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
 {
   return false;
@@ -579,7 +620,7 @@ hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false (
 bool
 hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true (
        cumulative_args_t ca ATTRIBUTE_UNUSED,
-       enum machine_mode mode ATTRIBUTE_UNUSED,
+       machine_mode mode ATTRIBUTE_UNUSED,
        const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
 {
   return true;
@@ -588,7 +629,7 @@ hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true (
 int
 hook_int_CUMULATIVE_ARGS_mode_tree_bool_0 (
        cumulative_args_t ca ATTRIBUTE_UNUSED,
-       enum machine_mode mode ATTRIBUTE_UNUSED,
+       machine_mode mode ATTRIBUTE_UNUSED,
        tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
 {
   return 0;
@@ -596,7 +637,7 @@ hook_int_CUMULATIVE_ARGS_mode_tree_bool_0 (
 
 void
 default_function_arg_advance (cumulative_args_t ca ATTRIBUTE_UNUSED,
-                             enum machine_mode mode ATTRIBUTE_UNUSED,
+                             machine_mode mode ATTRIBUTE_UNUSED,
                              const_tree type ATTRIBUTE_UNUSED,
                              bool named ATTRIBUTE_UNUSED)
 {
@@ -605,7 +646,7 @@ default_function_arg_advance (cumulative_args_t ca ATTRIBUTE_UNUSED,
 
 rtx
 default_function_arg (cumulative_args_t ca ATTRIBUTE_UNUSED,
-                     enum machine_mode mode ATTRIBUTE_UNUSED,
+                     machine_mode mode ATTRIBUTE_UNUSED,
                      const_tree type ATTRIBUTE_UNUSED,
                      bool named ATTRIBUTE_UNUSED)
 {
@@ -614,7 +655,7 @@ default_function_arg (cumulative_args_t ca ATTRIBUTE_UNUSED,
 
 rtx
 default_function_incoming_arg (cumulative_args_t ca ATTRIBUTE_UNUSED,
-                              enum machine_mode mode ATTRIBUTE_UNUSED,
+                              machine_mode mode ATTRIBUTE_UNUSED,
                               const_tree type ATTRIBUTE_UNUSED,
                               bool named ATTRIBUTE_UNUSED)
 {
@@ -622,14 +663,14 @@ default_function_incoming_arg (cumulative_args_t ca ATTRIBUTE_UNUSED,
 }
 
 unsigned int
-default_function_arg_boundary (enum machine_mode mode ATTRIBUTE_UNUSED,
+default_function_arg_boundary (machine_mode mode ATTRIBUTE_UNUSED,
                               const_tree type ATTRIBUTE_UNUSED)
 {
   return PARM_BOUNDARY;
 }
 
 unsigned int
-default_function_arg_round_boundary (enum machine_mode mode ATTRIBUTE_UNUSED,
+default_function_arg_round_boundary (machine_mode mode ATTRIBUTE_UNUSED,
                                     const_tree type ATTRIBUTE_UNUSED)
 {
   return PARM_BOUNDARY;
@@ -773,7 +814,7 @@ default_function_value (const_tree ret_type ATTRIBUTE_UNUSED,
 }
 
 rtx
-default_libcall_value (enum machine_mode mode ATTRIBUTE_UNUSED,
+default_libcall_value (machine_mode mode ATTRIBUTE_UNUSED,
                       const_rtx fun ATTRIBUTE_UNUSED)
 {
 #ifdef LIBCALL_VALUE
@@ -811,11 +852,8 @@ default_internal_arg_pointer (void)
 }
 
 rtx
-default_static_chain (const_tree fndecl, bool incoming_p)
+default_static_chain (const_tree ARG_UNUSED (fndecl_or_type), bool incoming_p)
 {
-  if (!DECL_STATIC_CHAIN (fndecl))
-    return NULL;
-
   if (incoming_p)
     {
 #ifdef STATIC_CHAIN_INCOMING_REGNUM
@@ -862,6 +900,13 @@ default_branch_target_register_class (void)
   return NO_REGS;
 }
 
+reg_class_t
+default_ira_change_pseudo_allocno_class (int regno ATTRIBUTE_UNUSED,
+                                        reg_class_t cl)
+{
+  return cl;
+}
+
 extern bool
 default_lra_p (void)
 {
@@ -889,7 +934,7 @@ default_different_addr_displacement_p (void)
 reg_class_t
 default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
                          reg_class_t reload_class_i ATTRIBUTE_UNUSED,
-                         enum machine_mode reload_mode ATTRIBUTE_UNUSED,
+                         machine_mode reload_mode ATTRIBUTE_UNUSED,
                          secondary_reload_info *sri)
 {
   enum reg_class rclass = NO_REGS;
@@ -920,7 +965,6 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
       else if (icode != CODE_FOR_nothing)
        {
          const char *insn_constraint, *scratch_constraint;
-         char insn_letter, scratch_letter;
          enum reg_class insn_class, scratch_class;
 
          gcc_assert (insn_data[(int) icode].n_operands == 3);
@@ -934,11 +978,8 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
                  gcc_assert (*insn_constraint == '=');
                  insn_constraint++;
                }
-             insn_letter = *insn_constraint;
-             insn_class
-               = (insn_letter == 'r' ? GENERAL_REGS
-                  : REG_CLASS_FROM_CONSTRAINT ((unsigned char) insn_letter,
-                                               insn_constraint));
+             insn_class = (reg_class_for_constraint
+                           (lookup_constraint (insn_constraint)));
              gcc_assert (insn_class != NO_REGS);
            }
 
@@ -952,11 +993,8 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
          scratch_constraint++;
          if (*scratch_constraint == '&')
            scratch_constraint++;
-         scratch_letter = *scratch_constraint;
-         scratch_class
-           = (scratch_letter == 'r' ? GENERAL_REGS
-              : REG_CLASS_FROM_CONSTRAINT ((unsigned char) scratch_letter,
-                                           scratch_constraint));
+         scratch_class = (reg_class_for_constraint
+                          (lookup_constraint (scratch_constraint)));
 
          if (reg_class_subset_p (reload_class, insn_class))
            {
@@ -1018,7 +1056,7 @@ default_builtin_vector_alignment_reachable (const_tree type, bool is_packed)
    memory access if it supports movmisalign patten.
    is_packed is true if the memory access is defined in a packed struct.  */
 bool
-default_builtin_support_vector_misalignment (enum machine_mode mode,
+default_builtin_support_vector_misalignment (machine_mode mode,
                                             const_tree type
                                             ATTRIBUTE_UNUSED,
                                             int misalignment
@@ -1034,8 +1072,8 @@ default_builtin_support_vector_misalignment (enum machine_mode mode,
 /* By default, only attempt to parallelize bitwise operations, and
    possibly adds/subtracts using bit-twiddling.  */
 
-enum machine_mode
-default_preferred_simd_mode (enum machine_mode mode ATTRIBUTE_UNUSED)
+machine_mode
+default_preferred_simd_mode (machine_mode mode ATTRIBUTE_UNUSED)
 {
   return word_mode;
 }
@@ -1074,8 +1112,8 @@ default_add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind,
   unsigned retval = 0;
 
   tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE;
-  int stmt_cost = default_builtin_vectorization_cost (kind, vectype,
-                                                         misalign);
+  int stmt_cost = targetm.vectorize.builtin_vectorization_cost (kind, vectype,
+                                                               misalign);
    /* Statements in an inner loop relative to the loop being
       vectorized are weighted more heavily.  The value here is
       arbitrary and could potentially be improved with analysis.  */
@@ -1111,7 +1149,7 @@ default_destroy_cost_data (void *data)
 /* Determine whether or not a pointer mode is valid. Assume defaults
    of ptr_mode or Pmode - can be overridden.  */
 bool
-default_valid_pointer_mode (enum machine_mode mode)
+default_valid_pointer_mode (machine_mode mode)
 {
   return (mode == ptr_mode || mode == Pmode);
 }
@@ -1146,7 +1184,7 @@ default_ref_may_alias_errno (ao_ref *ref)
 /* Return the mode for a pointer to a given ADDRSPACE, defaulting to ptr_mode
    for the generic address space only.  */
 
-enum machine_mode
+machine_mode
 default_addr_space_pointer_mode (addr_space_t addrspace ATTRIBUTE_UNUSED)
 {
   gcc_assert (ADDR_SPACE_GENERIC_P (addrspace));
@@ -1156,7 +1194,7 @@ default_addr_space_pointer_mode (addr_space_t addrspace ATTRIBUTE_UNUSED)
 /* Return the mode for an address in a given ADDRSPACE, defaulting to Pmode
    for the generic address space only.  */
 
-enum machine_mode
+machine_mode
 default_addr_space_address_mode (addr_space_t addrspace ATTRIBUTE_UNUSED)
 {
   gcc_assert (ADDR_SPACE_GENERIC_P (addrspace));
@@ -1166,7 +1204,7 @@ default_addr_space_address_mode (addr_space_t addrspace ATTRIBUTE_UNUSED)
 /* Named address space version of valid_pointer_mode.  */
 
 bool
-default_addr_space_valid_pointer_mode (enum machine_mode mode, addr_space_t as)
+default_addr_space_valid_pointer_mode (machine_mode mode, addr_space_t as)
 {
   if (!ADDR_SPACE_GENERIC_P (as))
     return (mode == targetm.addr_space.pointer_mode (as)
@@ -1194,7 +1232,7 @@ target_default_pointer_address_modes_p (void)
 /* Named address space version of legitimate_address_p.  */
 
 bool
-default_addr_space_legitimate_address_p (enum machine_mode mode, rtx mem,
+default_addr_space_legitimate_address_p (machine_mode mode, rtx mem,
                                         bool strict, addr_space_t as)
 {
   if (!ADDR_SPACE_GENERIC_P (as))
@@ -1207,7 +1245,7 @@ default_addr_space_legitimate_address_p (enum machine_mode mode, rtx mem,
 
 rtx
 default_addr_space_legitimize_address (rtx x, rtx oldx,
-                                      enum machine_mode mode, addr_space_t as)
+                                      machine_mode mode, addr_space_t as)
 {
   if (!ADDR_SPACE_GENERIC_P (as))
     return x;
@@ -1299,10 +1337,6 @@ default_target_can_inline_p (tree caller, tree callee)
   return ret;
 }
 
-#ifndef HAVE_casesi
-# define HAVE_casesi 0
-#endif
-
 /* If the machine does not have a case insn that compares the bounds,
    this means extra overhead for dispatch tables, which raises the
    threshold for using them.  */
@@ -1310,7 +1344,7 @@ default_target_can_inline_p (tree caller, tree callee)
 unsigned int
 default_case_values_threshold (void)
 {
-  return (HAVE_casesi ? 4 : 5);
+  return (targetm.have_casesi () ? 4 : 5);
 }
 
 bool
@@ -1323,6 +1357,31 @@ default_have_conditional_execution (void)
 #endif
 }
 
+/* By default we assume that c99 functions are present at the runtime,
+   but sincos is not.  */
+bool
+default_libc_has_function (enum function_class fn_class)
+{
+  if (fn_class == function_c94
+      || fn_class == function_c99_misc
+      || fn_class == function_c99_math_complex)
+    return true;
+
+  return false;
+}
+
+bool
+gnu_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
+{
+  return true;
+}
+
+bool
+no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
+{
+  return false;
+}
+
 tree
 default_builtin_tm_load_store (tree ARG_UNUSED (type))
 {
@@ -1332,7 +1391,7 @@ default_builtin_tm_load_store (tree ARG_UNUSED (type))
 /* Compute cost of moving registers to/from memory.  */
 
 int
-default_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+default_memory_move_cost (machine_mode mode ATTRIBUTE_UNUSED,
                          reg_class_t rclass ATTRIBUTE_UNUSED,
                          bool in ATTRIBUTE_UNUSED)
 {
@@ -1347,7 +1406,7 @@ default_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
    TO, using MODE.  */
 
 int
-default_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+default_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED,
                             reg_class_t from ATTRIBUTE_UNUSED,
                             reg_class_t to ATTRIBUTE_UNUSED)
 {
@@ -1358,6 +1417,61 @@ default_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
 #endif
 }
 
+/* For hooks which use the MOVE_RATIO macro, this gives the legacy default
+   behaviour.  SPEED_P is true if we are compiling for speed.  */
+
+unsigned int
+get_move_ratio (bool speed_p ATTRIBUTE_UNUSED)
+{
+  unsigned int move_ratio;
+#ifdef MOVE_RATIO
+  move_ratio = (unsigned int) MOVE_RATIO (speed_p);
+#else
+#if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti)
+  move_ratio = 2;
+#else /* No movmem patterns, pick a default.  */
+  move_ratio = ((speed_p) ? 15 : 3);
+#endif
+#endif
+  return move_ratio;
+}
+
+/* Return TRUE if the move_by_pieces/set_by_pieces infrastructure should be
+   used; return FALSE if the movmem/setmem optab should be expanded, or
+   a call to memcpy emitted.  */
+
+bool
+default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
+                                       unsigned int alignment,
+                                       enum by_pieces_operation op,
+                                       bool speed_p)
+{
+  unsigned int max_size = 0;
+  unsigned int ratio = 0;
+
+  switch (op)
+    {
+      case CLEAR_BY_PIECES:
+       max_size = STORE_MAX_PIECES;
+       ratio = CLEAR_RATIO (speed_p);
+       break;
+      case MOVE_BY_PIECES:
+       max_size = MOVE_MAX_PIECES;
+       ratio = get_move_ratio (speed_p);
+       break;
+      case SET_BY_PIECES:
+       max_size = STORE_MAX_PIECES;
+       ratio = SET_RATIO (speed_p);
+       break;
+      case STORE_BY_PIECES:
+       max_size = STORE_MAX_PIECES;
+       ratio = get_move_ratio (speed_p);
+       break;
+    }
+
+  return move_by_pieces_ninsns (size, alignment, max_size + 1) < ratio;
+}
+
 bool
 default_profile_before_prologue (void)
 {
@@ -1409,7 +1523,7 @@ default_class_likely_spilled_p (reg_class_t rclass)
 
 unsigned char
 default_class_max_nregs (reg_class_t rclass ATTRIBUTE_UNUSED,
-                        enum machine_mode mode ATTRIBUTE_UNUSED)
+                        machine_mode mode ATTRIBUTE_UNUSED)
 {
 #ifdef CLASS_MAX_NREGS
   return (unsigned char) CLASS_MAX_NREGS ((enum reg_class) rclass, mode);
@@ -1439,15 +1553,37 @@ default_debug_unwind_info (void)
   return UI_NONE;
 }
 
+/* Determine the correct mode for a Dwarf frame register that represents
+   register REGNO.  */
+
+machine_mode
+default_dwarf_frame_reg_mode (int regno)
+{
+  machine_mode save_mode = reg_raw_mode[regno];
+
+  if (HARD_REGNO_CALL_PART_CLOBBERED (regno, save_mode))
+    save_mode = choose_hard_reg_mode (regno, 1, true);
+  return save_mode;
+}
+
 /* To be used by targets where reg_raw_mode doesn't return the right
    mode for registers used in apply_builtin_return and apply_builtin_arg.  */
 
-enum machine_mode
+machine_mode
 default_get_reg_raw_mode (int regno)
 {
   return reg_raw_mode[regno];
 }
 
+/* Return true if a leaf function should stay leaf even with profiling
+   enabled.  */
+
+bool
+default_keep_leaf_when_profiled ()
+{
+  return false;
+}
+
 /* Return true if the state of option OPTION should be stored in PCH files
    and checked by default_pch_valid_p.  Store the option's current state
    in STATE if so.  */
@@ -1457,6 +1593,8 @@ option_affects_pch_p (int option, struct cl_option_state *state)
 {
   if ((cl_options[option].flags & CL_TARGET) == 0)
     return false;
+  if ((cl_options[option].flags & CL_PCH_IGNORE) != 0)
+    return false;
   if (option_flag_var (option, &global_options) == &target_flags)
     if (targetm.check_pch_target_flags)
       return false;
@@ -1507,12 +1645,8 @@ default_get_pch_validity (size_t *sz)
 static const char *
 pch_option_mismatch (const char *option)
 {
-  char *r;
-
-  asprintf (&r, _("created and used with differing settings of '%s'"), option);
-  if (r == NULL)
-    return _("out of memory");
-  return r;
+  return xasprintf (_("created and used with differing settings of '%s'"),
+                   option);
 }
 
 /* Default version of pch_valid_p.  */
@@ -1559,7 +1693,7 @@ default_pch_valid_p (const void *data_p, size_t len)
 
 /* Default version of cstore_mode.  */
 
-enum machine_mode
+machine_mode
 default_cstore_mode (enum insn_code icode)
 {
   return insn_data[(int) icode].operand[0].mode;
@@ -1568,10 +1702,11 @@ default_cstore_mode (enum insn_code icode)
 /* Default version of member_type_forces_blk.  */
 
 bool
-default_member_type_forces_blk (const_tree, enum machine_mode)
+default_member_type_forces_blk (const_tree, machine_mode)
 {
   return false;
 }
+
 rtx
 default_load_bounds_for_arg (rtx addr ATTRIBUTE_UNUSED,
                             rtx ptr ATTRIBUTE_UNUSED,
@@ -1589,10 +1724,17 @@ default_store_bounds_for_arg (rtx val ATTRIBUTE_UNUSED,
   gcc_unreachable ();
 }
 
-tree
-default_fn_abi_va_list_bounds_size (tree fndecl ATTRIBUTE_UNUSED)
+rtx
+default_load_returned_bounds (rtx slot ATTRIBUTE_UNUSED)
+{
+  gcc_unreachable ();
+}
+
+void
+default_store_returned_bounds (rtx slot ATTRIBUTE_UNUSED,
+                              rtx bounds ATTRIBUTE_UNUSED)
 {
-  return integer_zero_node;
+  gcc_unreachable ();
 }
 
 /* Default version of canonicalize_comparison.  */
@@ -1633,12 +1775,11 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
   unsigned HOST_WIDE_INT align, boundary;
   bool indirect;
 
-#ifdef ARGS_GROW_DOWNWARD
   /* All of the alignment and movement below is for args-grow-up machines.
      As of 2004, there are only 3 ARGS_GROW_DOWNWARD targets, and they all
      implement their own specialized gimplify_va_arg_expr routines.  */
-  gcc_unreachable ();
-#endif
+  if (ARGS_GROW_DOWNWARD)
+    gcc_unreachable ();
 
   indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
   if (indirect)
@@ -1724,6 +1865,8 @@ default_chkp_bound_type (void)
 {
   tree res = make_node (POINTER_BOUNDS_TYPE);
   TYPE_PRECISION (res) = TYPE_PRECISION (size_type_node) * 2;
+  TYPE_NAME (res) = get_identifier ("__bounds_type");
+  SET_TYPE_MODE (res, targetm.chkp_bound_mode ());
   layout_type (res);
   return res;
 }
@@ -1740,11 +1883,44 @@ default_builtin_chkp_function (unsigned int fcode ATTRIBUTE_UNUSED)
   return NULL_TREE;
 }
 
+rtx
+default_chkp_function_value_bounds (const_tree ret_type ATTRIBUTE_UNUSED,
+                                   const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+                                   bool outgoing ATTRIBUTE_UNUSED)
+{
+  gcc_unreachable ();
+}
+
+tree
+default_chkp_make_bounds_constant (HOST_WIDE_INT lb ATTRIBUTE_UNUSED,
+                                  HOST_WIDE_INT ub ATTRIBUTE_UNUSED)
+{
+  return NULL_TREE;
+}
+
+int
+default_chkp_initialize_bounds (tree var ATTRIBUTE_UNUSED,
+                               tree lb ATTRIBUTE_UNUSED,
+                               tree ub ATTRIBUTE_UNUSED,
+                               tree *stmts ATTRIBUTE_UNUSED)
+{
+  return 0;
+}
+
+void
+default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED,
+                                     enum machine_mode mode ATTRIBUTE_UNUSED,
+                                     tree type ATTRIBUTE_UNUSED,
+                                     int *pretend_arg_size ATTRIBUTE_UNUSED,
+                                     int second_time ATTRIBUTE_UNUSED)
+{
+}
+
 /* An implementation of TARGET_CAN_USE_DOLOOP_P for targets that do
    not support nested low-overhead loops.  */
 
 bool
-can_use_doloop_if_innermost (double_int, double_int,
+can_use_doloop_if_innermost (const widest_int &, const widest_int &,
                             unsigned int loop_depth, bool)
 {
   return loop_depth == 1;