You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor modification to FMV rules for scope and signatures (#363)
Hi all,
While attempting to implement FMV in the GCC front-end some questions
were raised that I think are worth clarifying here.
This PR changes the rules to use the default function to determine the
signature and scope of the versioned function set.
This clears up some cases such as:
```C
int fn (int c = 1);
int __attribute__((target_version("sve"))) fn (int c = 2);
int bar() { return fn(); }
```
Where there are conflicting signatures and which default should be used
is not clear at the moment.
```C
int fn (int c[]);
int __attribute__((target_version("default"))) fn (int c[1]) {
}
int __attribute__((target_version("sve"))) fn (int c[2]) {
}
```
Where if this should be considered a conflicting signature is not clear.
```C
int __attribute__((target_version("default"))) fn (int x) {
return 1;
}
void bar () {
int __attribute__((target_version("sve2"))) fn (int);
fn(1);
}
```
Where the scope of multi-versioned functions differs.
And
```C
// TU 1
#import TU2
int fn (int c = 1);
int bar() { return fn(); }
// TU 2
int __attribute__((target_version("sve"))) fn (int c = 2);
int __attribute__((target_version("sve2"))) fn (int c = 2);
int bar() { return fn(); }
```
Where it is possible calls in different TU's could use different default
argument values.
0 commit comments