https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58757

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Marc Glisse from comment #3)
> (In reply to Uroš Bizjak from comment #2)
> > Well, the testcase does fail on alpha:
> 
> Thanks. In the original testcase (
> https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00875.html ) I was xfailing on
> alpha, but Joseph asked me not to xfail it until someone has actually
> observed the failure. Could you please xfail it (or whatever similar option
> you prefer) until this PR is addressed? (Unless you want to fix this PR, of
> course ;-)

Something like ...

int
__attribute__((noinline, noclone))
checkz (const char *ptr, int n)
{
  for ( ; n > 0; ptr++, --n)
    if (*ptr != 0)
      return 0;
  return 1;
}

int main ()
{
  volatile float f = FLT_TRUE_MIN;
  volatile double d = DBL_TRUE_MIN;
  volatile long double l = LDBL_TRUE_MIN;

  if (checkz (&f, sizeof(f))
      || checkz (&d, sizeof(d))
      || checkz (&l, sizeof (l)))
    __builtin_abort ();
  return 0;
}

perhaps?

This works on alpha and x86 with some compilation warnings ...

Reply via email to