[Bug tree-optimization/110903] [14 Regression] Dead Code Elimination Regression since r14-1597-g64d90d06d2d
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 4 17:58:10 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110903
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the original testcase has some obvious use of an uninitialized variable.
Anyways here is a fixed up testcase which does not have that uninitialized
variable and GCC 13 was able to optimize away the call to foo still:
```
void foo(void);
static signed char b, c;
static short e, f;
static int g = 41317;
static int(a)(int h, int i) { return h + i; }
static int(d)(int h, int i) { return i ? h : 0; }
short t = 10;
int main() {
{
signed char j;
short k = t;
for (; g >= 10; g = (short)g) {
_Bool l = 1;
int m = 0;
j = 8 * k;
k = j <= 0;
f = c + 3;
for (; c < 2; c = f) {
signed char n = 4073709551615;
if (!(((m) >= 0) && ((m) <= 0))) {
__builtin_unreachable();
}
if (g)
;
else {
if ((m = k, (b = a(d(l, k), e) && n) || l) < k) foo();
e = l = 0;
}
}
}
}
}
```
More information about the Gcc-bugs
mailing list