[Bug c++/66573] Unexpected change in static, branch-prediction cost from O1 to O2.

2015-06-18 Thread jmcguiness at liquidcapital dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573 --- Comment #2 from Jason McG --- If I try with this code: #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) extern void bar1(); extern void bar2(); void foo(bool i) { // if (i) if (likely(i))

[Bug c++/66573] Unexpected change in static, branch-prediction cost from O1 to O2.

2015-06-18 Thread jmcguiness at liquidcapital dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573 --- Comment #1 from Jason McG --- Note that clang++ for all tested versions (3.0, 3.2, 3.3, 3.4.1, 3.5, 3.5.1, 3.6 (rc2), 3.7 (experimental)) produce the same assembler output for -O1, -O2 & -O3: foo(bool):# @foo(