https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125925
Bug ID: 125925
Summary: outer conditional go to different bb but inner
conditionals are the same
Product: gcc
Version: 17.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
Target Milestone: ---
Take:
```
int g();
int h();
int j, l;
int f(int a, int *b)
{
if (a == 0)
{
if (b == &j) goto L9; else goto L7;
}
else
{
if (b == &j) goto L9; else goto L7;
}
L7: return g();
L9: return h();
}
```
We should be optimize this without PRE. to just `if (b==&j) return h(); else
return g();`