This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66573] Unexpected change in static, branch-prediction cost from O1 to O2.
- From: "jmcguiness at liquidcapital dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Jun 2015 08:55:07 +0000
- Subject: [Bug c++/66573] Unexpected change in static, branch-prediction cost from O1 to O2.
- Auto-submitted: auto-generated
- References: <bug-66573-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #1 from Jason McG <jmcguiness at liquidcapital dot com> ---
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(bool)
testb %dil, %dil
je .LBB0_2
jmp bar1() # TAILCALL
.LBB0_2:
jmp bar2() # TAILCALL
With bar1() being the statically-predicted branch, as per icc and Intel's own
documentation (as referenced in the link in the initial comment).