https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110009
Bug ID: 110009 Summary: Another missing ABS detection Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Blocks: 109907 Target Milestone: --- Take: ``` unsigned f1 (int v) { unsigned int d_6; int b_5; unsigned int v1_2; unsigned int _7; int _9; b_5 = v>>(sizeof(v)*8 - 1); _9 = b_5 | 1; d_6 = (unsigned int) _9; v1_2 = (unsigned int) v; _7 = v1_2 * d_6; return _7; } ``` This currently does not get converted to `return ABSU<v>`. I found this while implementing a different match pattern and found that the testcase pr103245-1.c was failing. This blocks PR 109907 because the patch which is to fix a regression from the patch of bug 109907 comment #25 introduces this. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109907 [Bug 109907] Missed optimization for bit extraction (uses shift instead of single bit-test)