https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111078
Bug ID: 111078 Summary: csneg is not used for (cset) * 2 - 1 Product: gcc Version: 14.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 Target Milestone: --- Target: aarch64 Take: ``` int f(int a, int b) { return a == b ? 1 : -1; } int f0(int a, int b) { int t = a == b; return t * 2 - 1; } ``` These 2 should produce the same code on aarch64 but currently only the first one produces: ``` cmp w0, w1 mov w0, 1 csneg w0, w0, w0, eq ret ```