public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/105014] [nvptx] FAIL: gcc.dg/pr97459-1.c execution test
Date: Tue, 22 Mar 2022 10:14:00 +0000	[thread overview]
Message-ID: <bug-105014-4-OqI3xAI0d6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105014-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
First FAIL minimizes to:
...
typedef __uint128_t T;

union u {
  T t;
  struct {
    unsigned long long x;
    unsigned long long y;
  } xy;
};

#define PRINT(VAR)                                      \
  do                                                    \
    {                                                   \
      __builtin_printf (#VAR ": lo: %llx\n", VAR.xy.x); \
      __builtin_printf (#VAR ": hi: %llx\n", VAR.xy.y); \
    } \
  while (0)

extern T __udivmodti4 (T, T, T *);

int
main (void)
{
  union u a, b, mod, div;
  a.t = -4;
  b.t = 1;
  PRINT (a);
  PRINT (b);
  div.t = __udivmodti4 (a.t, b.t, &mod.t);
  PRINT (div);
  PRINT (mod);
  if (mod.t != 0)
    __builtin_abort ();

  return 0;
}
...

Fails like this:
...
$ ./install/bin/nvptx-none-run  ./pr97459-1.exe 
a: lo: fffffffffffffffc
a: hi: ffffffffffffffff
b: lo: 1
b: hi: 0
div: lo: fffffffffffffffd
div: hi: ffffffffffffffff
mod: lo: ffffffffffff
mod: hi: 0
nvptx-run: error getting kernel result: unspecified launch failure
(CUDA_ERROR_LAUNCH_FAILED, 719)
$
...

With -O0 JIT instead:
...
$ ./install/bin/nvptx-none-run -O0  ./pr97459-1.exe 
a: lo: fffffffffffffffc
a: hi: ffffffffffffffff
b: lo: 1
b: hi: 0
div: lo: fffffffffffffffc
div: hi: ffffffffffffffff
mod: lo: 0
mod: hi: 0
...

  reply	other threads:[~2022-03-22 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 10:10 [Bug target/105014] New: " vries at gcc dot gnu.org
2022-03-22 10:14 ` vries at gcc dot gnu.org [this message]
2022-03-22 15:09 ` [Bug target/105014] " vries at gcc dot gnu.org
2022-03-22 15:17 ` vries at gcc dot gnu.org
2022-03-24  8:48 ` vries at gcc dot gnu.org
2022-03-24 13:23 ` vries at gcc dot gnu.org
2022-03-28 10:21 ` vries at gcc dot gnu.org

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-105014-4-OqI3xAI0d6@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).