Displaying 1 result from an estimated 1 matches for "1062934".
Did you mean:
1052934
2017 Apr 18
3
__builtin_expect hint ignored
https://godbolt.org/g/VvrbFZ
For the code below generated assembly is the worst possible - test 1, else test 3, else test 2 with expected value of 2 last ... Whats going on?
long case_2();
long case_3();
long case_1();
long case_else();
long test(long a) {
switch (__builtin_expect(a, 2)) {
case 2: return case_2();
case 3: return case_3();
case 1: return case_1();