public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114734] New: [14] RISC-V rv64gcv_zvl256b miscompile with -flto -O3 -mrvv-vector-bits=zvl
@ 2024-04-16  5:14 patrick at rivosinc dot com
  2024-04-16  7:47 ` [Bug target/114734] " rdapp at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: patrick at rivosinc dot com @ 2024-04-16  5:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114734
           Summary: [14] RISC-V rv64gcv_zvl256b miscompile with -flto -O3
                    -mrvv-vector-bits=zvl
           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: ---

Testcase: 
int f[18];
int g[18];
int h[18][18][18];
int a[324];
long b[18];
int *i = g;
int (*j)[18][18] = h;
int z;
int main() {
  for (int m = 0; m < 18; ++m)
    f[m] = 3;
  for (int m = 0; m < 18; m += 1)
    for (int n = 0; n < 18; n += 3) {
      a[m * 8 + n] = j[m][m][0] ? i[n] : 0;
      b[n] = f[n] ? -i[m] : 0;
    }
  for (long n = 0; n < 8; ++n)
    z = a[n];
  __builtin_printf("%ld\n", b[15]);
}

Commands:
> /scratch/tc-testing/tc-apr-15/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv_zvl256b -flto -O3 -mrvv-vector-bits=zvl red.c -o red.out
> /scratch/tc-testing/tc-apr-15/build-rv64gcv/bin/qemu-riscv64 red.out
-3
> /scratch/tc-testing/tc-apr-15/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc red.c -o red.out
> /scratch/tc-testing/tc-apr-15/build-rv64gcv/bin/qemu-riscv64 red.out
0

Result is not affected by -fno-strict-aliasing.

Tested using r14-9976-gf8409c3109d (not bisected)

Found via fuzzer.

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

end of thread, other threads:[~2024-05-16  9:56 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16  5:14 [Bug target/114734] New: [14] RISC-V rv64gcv_zvl256b miscompile with -flto -O3 -mrvv-vector-bits=zvl patrick at rivosinc dot com
2024-04-16  7:47 ` [Bug target/114734] " rdapp at gcc dot gnu.org
2024-04-16  7:51 ` rguenth at gcc dot gnu.org
2024-04-16 11:50 ` rguenth at gcc dot gnu.org
2024-04-16 12:58 ` rdapp at gcc dot gnu.org
2024-04-16 13:14 ` rdapp at gcc dot gnu.org
2024-04-22 15:45 ` rdapp at gcc dot gnu.org
2024-04-24 14:16 ` rdapp at gcc dot gnu.org
2024-04-25  6:31 ` rguenth at gcc dot gnu.org
2024-04-25  8:15 ` rdapp at gcc dot gnu.org
2024-04-25 13:28 ` rguenth at gcc dot gnu.org
2024-04-25 13:52 ` rdapp at gcc dot gnu.org
2024-04-26 13:45 ` [Bug target/114734] RISC-V rv64gcv_zvl256b miscompile with -flto -O3 -mrvv-vector-bits=zvl since r8-6047-g65dd1346027bb5 rguenth at gcc dot gnu.org
2024-04-26 13:52 ` rguenth at gcc dot gnu.org
2024-04-30  6:46 ` [Bug target/114734] [11/12/13/14/15 regression] " cvs-commit at gcc dot gnu.org
2024-04-30  6:47 ` [Bug target/114734] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-04-30 14:50 ` patrick at rivosinc dot com
2024-05-02 16:22 ` cvs-commit at gcc dot gnu.org
2024-05-03 12:51 ` cvs-commit at gcc dot gnu.org
2024-05-03 12:51 ` cvs-commit at gcc dot gnu.org
2024-05-03 12:52 ` [Bug target/114734] [11/12/13 " rguenth at gcc dot gnu.org
2024-05-06 13:15 ` cvs-commit at gcc dot gnu.org
2024-05-06 13:15 ` cvs-commit at gcc dot gnu.org
2024-05-16  9:56 ` [Bug target/114734] [11/12 " cvs-commit at gcc dot gnu.org

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