https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112402
Bug ID: 112402
Summary: [11/12/13/14 Regression] Path splitting causes
if-conversion miss
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: 94274
Target Milestone: ---
Similar to PR 68541 except instead of having a diamond, we just have a
triangle.
Testcase:
```
int
foo(signed char *p, int n)
{
int s = 0;
int i;
for (i = 0; i < n; i++) {
int t;
if (p[i] >= 0)
t=1;
else
t=-1;
s+=t;
}
return s;
}
```
I noticed this while working on fixing PR 94274.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94274
[Bug 94274] fold phi whose incoming args are defined from binary operations