https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100609
Bug ID: 100609 Summary: bool - 1 is not simplified to -a Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Blocks: 25290 Target Milestone: --- Take: int f(_Bool a) { int t = a; return t - 1; } int g(_Bool a) { int t = a; return -t; } ---- CUT ---- Both of these are the same and should produce the same code gen. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25290 [Bug 25290] PHI-OPT could be rewritten so that is uses match