nvptx.c (nvptx_use_anchors_for_symbol_p): New.
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 20 Nov 2015 14:23:18 +0000 (14:23 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 20 Nov 2015 14:23:18 +0000 (14:23 +0000)
* config/nvptx/nvptx.c (nvptx_use_anchors_for_symbol_p): New.
(TARGET_USE_ANCHORS_FOR_SYMBOL_P): Override.

Co-Authored-By: James Norris <jnorris@codesourcery.com>
From-SVN: r230659

gcc/ChangeLog
gcc/config/nvptx/nvptx.c

index b9beee772a7b44e55ee97311b75ec3cb2258e656..03e6993ac0be783c52536bcec58155b5f7606bc1 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-20  Nathan Sidwell  <nathan@codesourcery.com>
+           James Norris  <jnorris@codesourcery.com>
+
+       * config/nvptx/nvptx.c (nvptx_use_anchors_for_symbol_p): New.
+       (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Override.
+
 2015-11-20  Alan Hayward <alan.hayward@arm.com>
 
        PR tree-optimization/68413
index 044f545378477811418356caa0a35c701bdeeaa5..fdeb78af140244441ea5e462899f1c0d8b9fca9f 100644 (file)
@@ -3895,6 +3895,19 @@ nvptx_cannot_copy_insn_p (rtx_insn *insn)
       return false;
     }
 }
+
+/* Section anchors do not work.  Initialization for flag_section_anchor
+   probes the existence of the anchoring target hooks and prevents
+   anchoring if they don't exist.  However, we may be being used with
+   a host-side compiler that does support anchoring, and hence see
+   the anchor flag set (as it's not recalculated).  So provide an
+   implementation denying anchoring.  */
+
+static bool
+nvptx_use_anchors_for_symbol_p (const_rtx ARG_UNUSED (a))
+{
+  return false;
+}
 \f
 /* Record a symbol for mkoffload to enter into the mapping table.  */
 
@@ -4914,6 +4927,9 @@ nvptx_goacc_reduction (gcall *call)
 #undef TARGET_CANNOT_COPY_INSN_P
 #define TARGET_CANNOT_COPY_INSN_P nvptx_cannot_copy_insn_p
 
+#undef TARGET_USE_ANCHORS_FOR_SYMBOL_P
+#define TARGET_USE_ANCHORS_FOR_SYMBOL_P nvptx_use_anchors_for_symbol_p
+
 #undef TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS nvptx_init_builtins
 #undef TARGET_EXPAND_BUILTIN