warp convergence. */
res = MAX (res, PTX_VERSION_6_0);
- /* Pick at least 6.3. */
+ /* 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 (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");
return;
}
+ emit_ptx_alias:
+
cgraph_node *cnode = cgraph_node::get (name);
if (!cnode->referred_to_p ())
/* Prevent "Internal error: reference to deleted section". */
IDENTIFIER_POINTER (target));
# endif
/* If symbol aliases aren't actually supported... */
- if (!TARGET_SUPPORTS_ALIASES)
+ if (!TARGET_SUPPORTS_ALIASES
+# ifdef ACCEL_COMPILER
+ /* ..., and unless special-cased... */
+ && !lookup_attribute ("symbol alias handled", DECL_ATTRIBUTES (decl))
+# endif
+ )
/* ..., 'ASM_OUTPUT_DEF{,_FROM_DECLS}' better have raised an error. */
gcc_checking_assert (seen_error ());
#elif defined (ASM_OUTPUT_WEAK_ALIAS) || defined (ASM_WEAKEN_DECL)