public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "patrick at rivosinc dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113607] New: [14] RISC-V rv64gcv vector: Runtime mismatch at -O3
Date: Thu, 25 Jan 2024 23:05:29 +0000	[thread overview]
Message-ID: <bug-113607-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 113607
           Summary: [14] RISC-V rv64gcv vector: Runtime mismatch at -O3
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Tested using r14-8438-g136a828754f

Testcase:
struct {
  signed b;
} c, d = {6};
short e, f;
int g[1000];
signed char h;
int i, j;
long k, l;

long m(long n, long o) {
  if (n < 1 && o == 0)
    return 0;
  return n;
}

static int p() {
  long q = 0;
  int a = 0;
  for (; e < 2; e += 1)
    g[e * 7 + 1] = 2637287069;
  for (; h <= 6; h += 1) {
    k = g[8] || f;
    l = m(g[f * 7 + 1], k);
    a = l;
    j = a < 0 || g[f * 7 + 1] < 0 || g[f * 7 + 1] >= 32 ? a : a << g[f * 7 +
1];
    if (j)
      ++q;
  }
  if (q)
    c = d;
  return i;
}

int main() {
  p();
  if (c.b == 0)
    return 0;
  else
    return 1;
}

Commands:
> /scratch/tc-testing/tc-jan-25-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -O3 -march=rv64gcv red.c -o user-config-o3.out
> QEMU_CPU=rv64,vlen=128,v=true,vext_spec=v1.0,Zve32f=true,Zve64f=true /scratch/tc-testing/tc-jan-25-trunk/build-rv64gcv/bin/qemu-riscv64 user-config-o3.out
> echo $?
1

> /scratch/tc-testing/tc-jan-25-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -O2 -march=rv64gcv red.c -o user-config-o2.out
> QEMU_CPU=rv64,vlen=128,v=true,vext_spec=v1.0,Zve32f=true,Zve64f=true /scratch/tc-testing/tc-jan-25-trunk/build-rv64gcv/bin/qemu-riscv64 user-config-o2.out
> echo $?
0

Found using fuzzer.

             reply	other threads:[~2024-01-25 23:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 23:05 patrick at rivosinc dot com [this message]
2024-01-26  1:52 ` [Bug target/113607] " juzhe.zhong at rivai dot ai
2024-01-26  1:52 ` juzhe.zhong at rivai dot ai
2024-01-26  2:12 ` juzhe.zhong at rivai dot ai
2024-01-26  7:58 ` rdapp at gcc dot gnu.org
2024-01-26  8:05 ` patrick at rivosinc dot com
2024-01-26  8:12 ` patrick at rivosinc dot com
2024-01-26  8:14 ` rdapp at gcc dot gnu.org
2024-01-26  8:19 ` juzhe.zhong at rivai dot ai
2024-01-26  9:09 ` juzhe.zhong at rivai dot ai
2024-01-26  9:38 ` rdapp at gcc dot gnu.org
2024-01-26  9:42 ` juzhe.zhong at rivai dot ai
2024-01-26  9:42 ` pinskia at gcc dot gnu.org
2024-01-26  9:59 ` juzhe.zhong at rivai dot ai
2024-01-28  6:08 ` pinskia at gcc dot gnu.org
2024-01-29  3:27 ` juzhe.zhong at rivai dot ai
2024-01-29 12:29 ` rdapp at gcc dot gnu.org
2024-01-29 16:30 ` rdapp at gcc dot gnu.org
2024-01-29 19:50 ` rdapp at gcc dot gnu.org
2024-01-30 21:03 ` rdapp at gcc dot gnu.org
2024-01-30 22:12 ` juzhe.zhong at rivai dot ai
2024-01-30 22:14 ` pinskia at gcc dot gnu.org
2024-01-30 22:21 ` pinskia at gcc dot gnu.org
2024-01-31  8:28 ` rdapp at gcc dot gnu.org
2024-01-31 20:31 ` [Bug middle-end/113607] " cvs-commit at gcc dot gnu.org
2024-02-02 18:20 ` patrick at rivosinc 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-113607-4@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).