IA MCU psABI support: changes to libraries
[gcc.git] / gcc / targhooks.c
index eef3d457b4e23e9ab51c9ce77902f09b41b2b597..4e970573dd4d745a109e7c179b7420bfb4810400 100644 (file)
@@ -1,5 +1,5 @@
 /* Default target hook functions.
-   Copyright (C) 2003-2014 Free Software Foundation, Inc.
+   Copyright (C) 2003-2015 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -50,25 +50,31 @@ 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 "symtab.h"
 #include "tree.h"
+#include "fold-const.h"
 #include "stor-layout.h"
 #include "varasm.h"
+#include "hard-reg-set.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 "hashtab.h"
-#include "hash-set.h"
-#include "vec.h"
-#include "hard-reg-set.h"
-#include "input.h"
-#include "function.h"
 #include "target.h"
 #include "tm_p.h"
-#include "target-def.h"
 #include "regs.h"
 #include "reload.h"
+#include "insn-codes.h"
 #include "optabs.h"
 #include "recog.h"
 #include "intl.h"
@@ -78,7 +84,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimplify.h"
 #include "stringpool.h"
 #include "tree-ssanames.h"
-#include "insn-codes.h"
 
 
 bool
@@ -167,6 +172,14 @@ default_legitimize_address (rtx x, rtx orig_x 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)
 {
@@ -841,11 +854,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
@@ -892,6 +902,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)
 {
@@ -1409,7 +1426,7 @@ default_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED,
 /* For hooks which use the MOVE_RATIO macro, this gives the legacy default
    behaviour.  SPEED_P is true if we are compiling for speed.  */
 
-static unsigned int
+unsigned int
 get_move_ratio (bool speed_p ATTRIBUTE_UNUSED)
 {
   unsigned int move_ratio;
@@ -1430,7 +1447,7 @@ get_move_ratio (bool speed_p ATTRIBUTE_UNUSED)
    a call to memcpy emitted.  */
 
 bool
-default_use_by_pieces_infrastructure_p (unsigned int size,
+default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
                                        unsigned int alignment,
                                        enum by_pieces_operation op,
                                        bool speed_p)
@@ -1634,12 +1651,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.  */
@@ -1700,6 +1713,36 @@ 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,
+                            rtx bnd ATTRIBUTE_UNUSED)
+{
+  gcc_unreachable ();
+}
+
+void
+default_store_bounds_for_arg (rtx val ATTRIBUTE_UNUSED,
+                             rtx addr ATTRIBUTE_UNUSED,
+                             rtx bounds ATTRIBUTE_UNUSED,
+                             rtx to ATTRIBUTE_UNUSED)
+{
+  gcc_unreachable ();
+}
+
+rtx
+default_load_returned_bounds (rtx slot ATTRIBUTE_UNUSED)
+{
+  gcc_unreachable ();
+}
+
+void
+default_store_returned_bounds (rtx slot ATTRIBUTE_UNUSED,
+                              rtx bounds ATTRIBUTE_UNUSED)
+{
+  gcc_unreachable ();
+}
+
 /* Default version of canonicalize_comparison.  */
 
 void
@@ -1738,12 +1781,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)
@@ -1824,6 +1866,62 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
   return build_va_arg_indirect_ref (addr);
 }
 
+tree
+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;
+}
+
+enum machine_mode
+default_chkp_bound_mode (void)
+{
+  return VOIDmode;
+}
+
+tree
+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.  */