https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67328
Bug ID: 67328 Summary: range test rather than single bit test for code testing enum values Product: gcc Version: 5.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: amodra at gmail dot com Target Milestone: --- The attached file generates ideal code, a test of a single bit, for the condition in test_pic or test_exe depending on -DALT. gcc ought to be able to optimise to a single bit test for both functions whether or not -DALT. It looks like gcc incorrectly prefers a range test.