===================================================================
@@ -4198,8 +4198,10 @@ ipa_tm_create_version_alias (struct cgra
TREE_SYMBOL_REFERENCED (tm_name) = 1;
/* Perform the same remapping to the comdat group. */
- if (DECL_COMDAT (new_decl))
+ if (DECL_COMDAT (new_decl) && HAVE_COMDAT_GROUP)
DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl));
+ else
+ DECL_COMDAT_GROUP (new_decl) = DECL_COMDAT_GROUP (old_decl);
new_node = cgraph_same_body_alias (NULL, new_decl, info->new_decl);
new_node->tm_clone = true;
@@ -4233,8 +4235,10 @@ ipa_tm_create_version (struct cgraph_nod
TREE_SYMBOL_REFERENCED (tm_name) = 1;
/* Perform the same remapping to the comdat group. */
- if (DECL_COMDAT (new_decl))
+ if (DECL_COMDAT (new_decl) && HAVE_COMDAT_GROUP)
DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl));
+ else
+ DECL_COMDAT_GROUP (new_decl) = DECL_COMDAT_GROUP (old_decl);
new_node = cgraph_copy_node_for_versioning (old_node, new_decl, NULL, NULL);
new_node->lowered = true;