Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated AFMV FIX #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gcc/multiple_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -385,9 +386,11 @@ 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++)
{
char *attr = attrs[i];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems like it would break attributes normally?
You're not parsing attrs[i] anymore and you're replacing it with your own.

Can you create a copy of the attrs char array and add the two extra strings for sve and sve2?

char *attr = attrs2[i];

/* Create new target clone. */
tree attributes = make_attribute (new_attr_name, attr,
Expand Down