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