https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102153
Bug ID: 102153 Summary: Better expansion of __builtin_*_overflow should be done Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: internal-improvement, missed-optimization Severity: enhancement Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- One thing I noticed is that __builtin_*_overflow is always expanded as: result = 0; if (overflow) result = 1; Which then later on get changed to result = overflow during ifcvt or jump threaded. Why not instead just use cstore instead.