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

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

            Bug ID: 113431
           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: ---

Testcase:
int a[2][9];
int b;
int c;
int d;
int main() {
  for (b = 0;b < 2; b++)
    for (long e = 8; e > 0; e--)
      a[b][e] = a[0][1] == 0;

  if (!a[1][1])
    return 0;
  else
    return 1;
}

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

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

> /scratch/tc-testing/tc-jan-16-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -O3 -march=rv64gc red_copy.c -o user-config.out
> QEMU_CPU=rv64,vlen=128,v=true,vext_spec=v1.0,Zve32f=true,Zve64f=true timeout --verbose -k 0.1 1 /scratch/tc-testing/tc-jan-16-trunk/build-rv64gcv/bin/qemu-riscv64 user-config.out
> echo $?
0

When a[1][1] is set a[0][1] is true(1) so a[1][1] == 0 should be false(0). At
-O3 rv64gcv the condition is evaluated incorrectly.

Godbolt: https://godbolt.org/z/Tfz3d646e

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

end of thread, other threads:[~2024-03-19  9:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 21:45 [Bug target/113431] New: [14] RISC-V rv64gcv vector: Runtime mismatch at -O3 patrick at rivosinc dot com
2024-01-16 21:46 ` [Bug target/113431] " patrick at rivosinc dot com
2024-01-16 22:37 ` juzhe.zhong at rivai dot ai
2024-01-16 22:57 ` patrick at rivosinc dot com
2024-01-17  1:38 ` juzhe.zhong at rivai dot ai
2024-01-17  1:42 ` patrick at rivosinc dot com
2024-01-17  1:44 ` juzhe.zhong at rivai dot ai
2024-01-17  1:53 ` patrick at rivosinc dot com
2024-01-17  1:56 ` juzhe.zhong at rivai dot ai
2024-01-17  3:33 ` [Bug tree-optimization/113431] [14 Regression] Wrong code " pinskia at gcc dot gnu.org
2024-01-17  8:08 ` rguenth at gcc dot gnu.org
2024-01-17  8:31 ` juzhe.zhong at rivai dot ai
2024-01-17  8:48 ` rguenth at gcc dot gnu.org
2024-01-17 12:34 ` rguenth at gcc dot gnu.org
2024-01-17 12:59 ` rguenth at gcc dot gnu.org
2024-01-18  7:37 ` cvs-commit at gcc dot gnu.org
2024-01-18  7:39 ` rguenth at gcc dot gnu.org
2024-01-19  8:55 ` ro at gcc dot gnu.org
2024-01-19  8:56 ` ro at gcc dot gnu.org
2024-02-28 14:55 ` ro at gcc dot gnu.org
2024-03-15 14:06 ` jakub at gcc dot gnu.org
2024-03-15 15:42 ` rguenth at gcc dot gnu.org
2024-03-15 15:52 ` cvs-commit at gcc dot gnu.org
2024-03-15 15:53 ` jakub at gcc dot gnu.org
2024-03-19  9:44 ` ro at CeBiTec dot Uni-Bielefeld.DE

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