https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107107
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. I don't think it is exactly TBAA which is causing the issue but
rather the way PRE does aliasing walks.
Take:
```
static inline void set_longish(int is_long, void *p, long x)
{
if (is_long)
*(long*)p = x;
else
*(long long*)p = x;
}
static long test(long long *p, int index, int mode)
{
*p = 1;
set_longish(mode, p+index, 2);
return *p;
}
long (*volatile vtest)(long long*, int, int) = test;
#include <stdio.h>
int main(void)
{
long long x;
long result = vtest(&x, 0, 0);
printf("%lu/%llu\n", result, x);
}
```
Which is only difference by which order the if statement (and mode which is
swapped). This case works.