https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110979
--- Comment #2 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Yes, it is wrong-code to full extent. To demonstrate, you can initialize 'sum'
and the array to negative zeroes:
#define FLT double
#define N 20
__attribute__((noipa))
FLT
foo3 (FLT *a)
{
FLT sum = -0.0;
for (int i = 0; i != N; i++)
sum += a[i];
return sum;
}
int main()
{
FLT a[N];
for (int i = 0; i != N; i++)
a[i] = -0.0;
if (!__builtin_signbit(foo3(a)))
__builtin_abort();
}