diff options
Diffstat (limited to 'gcc/config/nvptx/nvptx.cc')
-rw-r--r-- | gcc/config/nvptx/nvptx.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index d1648d5..022037f 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -245,6 +245,9 @@ default_ptx_version_option (void) warp convergence. */ res = MAX (res, PTX_VERSION_6_0); + /* Pick at least 6.3, to enable PTX '.alias'. */ + res = MAX (res, PTX_VERSION_6_3); + /* For sm_52+, pick at least 7.3, to enable PTX 'alloca'. */ if (ptx_isa_option >= PTX_ISA_SM52) res = MAX (res, PTX_VERSION_7_3); @@ -7710,6 +7713,30 @@ nvptx_asm_output_def_from_decls (FILE *stream, tree name, { if (nvptx_alias == 0 || !TARGET_PTX_6_3) { + /* Symbol aliases are not supported here. */ + +#ifdef ACCEL_COMPILER + if (DECL_CXX_CONSTRUCTOR_P (name) + || DECL_CXX_DESTRUCTOR_P (name)) + { + /* ..., but symbol aliases are supported and used in the host system, + via 'gcc/cp/optimize.cc:can_alias_cdtor'. */ + + gcc_assert (!lookup_attribute ("weak", DECL_ATTRIBUTES (name))); + gcc_assert (TREE_CODE (name) == FUNCTION_DECL); + + /* In this specific case, use PTX '.alias', if available, even for + (default) '-mno-alias'. */ + if (TARGET_PTX_6_3) + { + DECL_ATTRIBUTES (name) + = tree_cons (get_identifier ("symbol alias handled"), + NULL_TREE, DECL_ATTRIBUTES (name)); + goto emit_ptx_alias; + } + } +#endif + /* Copied from assemble_alias. */ error_at (DECL_SOURCE_LOCATION (name), "alias definitions not supported in this configuration"); @@ -7741,6 +7768,8 @@ nvptx_asm_output_def_from_decls (FILE *stream, tree name, return; } + emit_ptx_alias: + cgraph_node *cnode = cgraph_node::get (name); if (!cnode->referred_to_p ()) /* Prevent "Internal error: reference to deleted section". */ |