Commit afd6b56
authored
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.1 parent 80b917a commit afd6b56
1 file changed
+37
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| 436 | + | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| |||
2675 | 2677 | | |
2676 | 2678 | | |
2677 | 2679 | | |
| 2680 | + | |
| 2681 | + | |
2678 | 2682 | | |
| 2683 | + | |
2679 | 2684 | | |
2680 | 2685 | | |
2681 | | - | |
2682 | 2686 | | |
2683 | 2687 | | |
2684 | 2688 | | |
| |||
2687 | 2691 | | |
2688 | 2692 | | |
2689 | 2693 | | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
2690 | 2703 | | |
2691 | 2704 | | |
2692 | 2705 | | |
2693 | 2706 | | |
2694 | | - | |
2695 | | - | |
2696 | | - | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
2697 | 2710 | | |
2698 | 2711 | | |
2699 | 2712 | | |
2700 | 2713 | | |
2701 | | - | |
2702 | | - | |
2703 | | - | |
2704 | | - | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
2705 | 2734 | | |
2706 | 2735 | | |
2707 | 2736 | | |
| |||
0 commit comments