From 82ed9db65b84713ba47319d8afaea89ea3549fda Mon Sep 17 00:00:00 2001 From: Travis Liu Date: Thu, 18 Apr 2024 12:15:38 -0400 Subject: [PATCH 1/2] AFMV ADDED --- gcc/multiple_target.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc index 1fdd279da04a7..37276af0a92ec 100644 --- a/gcc/multiple_target.cc +++ b/gcc/multiple_target.cc @@ -305,6 +305,7 @@ static bool expand_target_clones (struct cgraph_node *node, bool definition) { int i; + definition = true; /* Parsing target attributes separated by comma. */ tree attr_target = lookup_attribute ("target_clones", DECL_ATTRIBUTES (node->decl)); @@ -385,9 +386,10 @@ expand_target_clones (struct cgraph_node *node, bool definition) before = decl1_v; DECL_FUNCTION_VERSIONED (node->decl) = 1; + char attrs2[num_attrs][5] = {"sve","sve2"}; for (i = 0; i < attrnum; i++) { - char *attr = attrs[i]; + char *attr = attrs2[i]; /* Create new target clone. */ tree attributes = make_attribute (new_attr_name, attr, From 6f905ce2f613985e8e6e602cf789f57870cfb8a0 Mon Sep 17 00:00:00 2001 From: Travis Liu Date: Fri, 19 Apr 2024 19:00:35 -0400 Subject: [PATCH 2/2] ADDED num_attrs const int --- gcc/multiple_target.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc index 37276af0a92ec..36e9c05868c91 100644 --- a/gcc/multiple_target.cc +++ b/gcc/multiple_target.cc @@ -386,6 +386,7 @@ expand_target_clones (struct cgraph_node *node, bool definition) before = decl1_v; DECL_FUNCTION_VERSIONED (node->decl) = 1; + const int num_attrs = 2; char attrs2[num_attrs][5] = {"sve","sve2"}; for (i = 0; i < attrnum; i++) {