This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66584] gcc differs in static, branch-prediction cost from icc in switch.
- 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 15:33:14 +0000
- Subject: [Bug c++/66584] gcc differs in static, branch-prediction cost from icc in switch.
- Auto-submitted: auto-generated
- References: <bug-66584-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66584
Jason McG <jmcguiness at liquidcapital dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |---
--- Comment #5 from Jason McG <jmcguiness at liquidcapital dot com> ---
(In reply to Andrew Pinski from comment #3)
> More than that, documenting gcc's branch heuristics is just in the code. And
...
I am sorry, but I do not agree. As per my other reply, in comment 4, I think it
is entirely reasonable to request that an additional statement along the lines
of "code generation for switch statements may not follow a top-down approach
nor prefer the default case (if it exists) in terms of static
branch-prediction. The __builtin_expected() intrinsic has no effect" is
included in the web-based documentation in a suitable sub-section. If some
algorithm were used, then adding a link to the web site to the appropriate
paper might be a quick remedy?
This would ensure that developers are not mislead by the argument that
__builtin_expected() takes thinking they could use that, nor would they be
mislead by lore assuming that the default or a lexographic top-down approach to
static branch-prediction were used.