This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26367] New: multiple levels of __builtin_expect
- From: "acahalan at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2006 20:29:28 -0000
- Subject: [Bug c/26367] New: multiple levels of __builtin_expect
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
My expectation may be:
a. certain (OK if the code crashes when I lie)
b. strong
c. weak
This could be expressed as an optional 3rd argument to state the estimated
probability. Alternately, stuff like __builtin_expect_strongly() could be used.
I'd like to use this to inform gcc that certain bit patterns or value ranges
are impossible. The main hope is that gcc can optimize switch() better by
letting all the can't-happen cases do undefined behavior. Math should be better
too, for example not needing to worry about the sign bit (more instruction
choice, etc.) if I tell gcc that it will never be set.
--
Summary: multiple levels of __builtin_expect
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: acahalan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26367