[Bug ipa/106783] [12/13/14/15 Regression] ICE in ipa-modref.cc:analyze_function since r12-5247-ga34edf9a3e907de2
tnfchris at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jul 23 19:02:55 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106783
--- Comment #8 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #6)
> The problem is that n/=0 is undefined behavior (so we can optimize out call
> to function doing divide by zero), while __builtin_trap is observable and we
> do not optimize out code paths that may trip to it.
>
Hmmmm I hit this today with:
void foo1 (char *restrict a, int *restrict c, int n, int stride)
{
if (stride <= 1)
return;
for (int i = 0; i < 9; i++)
{
int res = c[i];
c[i] = a[i] ? res : 9;
}
}
compiled with -Ofast -march=armv9-a -fdump-tree-modref.
At least this variant has no builtin traps (nor UB).
See https://godbolt.org/z/1h83rasns
More information about the Gcc-bugs
mailing list