https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90293
Bug ID: 90293
Summary: New function attribute: expect_return
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
I have an idea of new function attribute: expect_return. It would allow to
specify value usually returned from function, so it could help with
optimization in similar way like __builtin_expect() does.
Example use:
__attribute__((expect_return(false)))
bool DebugModeEnabled();
__attribute__((expect_return(false)))
bool IsErrorCode(int code);