https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120360
Bug ID: 120360 Summary: Horrible code generation for trivial decrement with test Product: gcc Version: 16.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org CC: jakub at gcc dot gnu.org, torva...@linux-foundation.org Target Milestone: --- Target: x86_64-*-*, i?86-*-* This is like PR 49095 but a little more complex. Take: ``` typedef signed int type; int g(void); int f(type *b) { type a = *b; *b = a - 24; if (a == 24) return g(); return 0; } int f1(type *b) { type a = *b; *b = a - 24; if (*b == 0) return g(); return 0; } ``` f1 is currently solved by PR 49095 but f is not. I noticed this while moving around some single_use for a match pattern.