public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/94439] [10 Regression] gcc: error: gcc/testsuite/gcc.dg/torture/builtin-complex-1.c: ‘-fcompare-debug’ failure since r10-3499-g0ce77f463d1d150e
Date: Wed, 01 Apr 2020 12:57:46 +0000	[thread overview]
Message-ID: <bug-94439-4-p2fNZoZidf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94439-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly reduced testcase:
extern void exit (int);
extern void abort (void);

#define COMPARE_BODY(A, B, TYPE, COPYSIGN)                              \
  do {                                                                  \
    TYPE s1 = COPYSIGN ((TYPE) 1.0, A);                                 \
    TYPE s2 = COPYSIGN ((TYPE) 1.0, B);                                 \
    if (s1 != s2)                                                       \
      abort ();                                                         \
    if ((__builtin_isnan (A) != 0) != (__builtin_isnan (B) != 0))       \
      abort ();                                                         \
    if ((A != B) != (__builtin_isnan (A) != 0))                         \
      abort ();                                                         \
  } while (0)

void
comparel (long double a, long double b)
{
  COMPARE_BODY (a, b, long double, __builtin_copysignl);
}

void
comparecl (_Complex long double a, long double r, long double i)
{
  comparel (__real__ a, r);
  comparel (__imag__ a, i);
}

#define VERIFY(A, B, TYPE, COMPARE)                     \
  do {                                                  \
    TYPE a = A;                                         \
    TYPE b = B;                                         \
    _Complex TYPE cr = __builtin_complex (a, b);        \
    static _Complex TYPE cs = __builtin_complex (A, B); \
    COMPARE (cr, A, B);                                 \
    COMPARE (cs, A, B);                                 \
  } while (0)

#define ALL_CHECKS(PZ, NZ, NAN, INF, TYPE, COMPARE)     \
  do {                                                  \
    VERIFY (NAN, NZ, TYPE, COMPARE);                    \
    VERIFY (INF, NZ, TYPE, COMPARE);                    \
    VERIFY (INF, NAN, TYPE, COMPARE);                   \
    VERIFY (INF, INF, TYPE, COMPARE);                   \
  } while (0)

void
check_long_double (void)
{
  ALL_CHECKS (0.0l, -0.0l, __builtin_nanl(""), __builtin_infl(), long double,
comparecl);
}

  parent reply	other threads:[~2020-04-01 12:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 12:35 [Bug debug/94439] New: " marxin at gcc dot gnu.org
2020-04-01 12:36 ` [Bug debug/94439] [10 Regression] " marxin at gcc dot gnu.org
2020-04-01 12:57 ` jakub at gcc dot gnu.org [this message]
2020-04-01 13:17 ` jakub at gcc dot gnu.org
2020-04-02 11:16 ` jakub at gcc dot gnu.org
2020-04-17 18:11 ` law at redhat dot com
2020-04-17 19:16 ` law at redhat dot com
2020-04-17 19:21 ` law at redhat dot com
2020-04-18 15:40 ` cvs-commit at gcc dot gnu.org
2020-04-18 15:41 ` law at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94439-4-p2fNZoZidf@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).