public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113607] New: [14] RISC-V rv64gcv vector: Runtime mismatch at -O3
@ 2024-01-25 23:05 patrick at rivosinc dot com
  2024-01-26  1:52 ` [Bug target/113607] " juzhe.zhong at rivai dot ai
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: patrick at rivosinc dot com @ 2024-01-25 23:05 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2024-02-02 18:20 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 23:05 [Bug target/113607] New: [14] RISC-V rv64gcv vector: Runtime mismatch at -O3 patrick at rivosinc dot com
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

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).