public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114027] New: [14] RISC-V vector: miscompile at -O3
@ 2024-02-21  2:06 patrick at rivosinc dot com
  2024-02-21  2:16 ` [Bug target/114027] " sjames at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: patrick at rivosinc dot com @ 2024-02-21  2:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114027
           Summary: [14] RISC-V vector: miscompile 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:
long a;
int b[10][7] = {{},
                {},
                {},
                {},
                {},
                {},
                {0, 0, 0, 0, 0, 1},
                {1, 1, 1, 1, 1, 1},
                {1, 1, 1, 1, 1, 1}};
int c;
int main() {
  int d;
  c = 0xFFFFFFFF;
  for (; a < 6; a++) {
    d = 0;
    for (; d < 6; d++) {
      c ^= -3L;
      if (b[a + 3][d])
        continue;
      c = 0;
    }
  }

  if (c == -3) {
    return 0;
  } else {
    return 1;
  }
}


Commands:
> /scratch/tc-testing/tc-feb-20/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv -O3 red.c -o red.out
> /scratch/tc-testing/tc-feb-20-llvm/build/bin/qemu-riscv64 red.out
> echo $?
1
> /scratch/tc-testing/tc-feb-20/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc red.c -o red.out
> /scratch/tc-testing/tc-feb-20-llvm/build/bin/qemu-riscv64 red.out
> echo $?
0

Discovered/tested using g61ab046a327 (not bisected)
Found using 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-02-21  2:06 [Bug target/114027] New: [14] RISC-V vector: miscompile at -O3 patrick at rivosinc dot com
2024-02-21  2:16 ` [Bug target/114027] " sjames at gcc dot gnu.org
2024-02-21  2:39 ` pinskia at gcc dot gnu.org
2024-02-22  6:39 ` pan2.li at intel dot com
2024-02-22  7:43 ` pan2.li at intel dot com
2024-02-22  8:57 ` rdapp at gcc dot gnu.org
2024-02-22  8:59 ` sjames at gcc dot gnu.org
2024-02-22  9:05 ` pinskia at gcc dot gnu.org
2024-02-22  9:06 ` rdapp at gcc dot gnu.org
2024-02-22  9:13 ` [Bug tree-optimization/114027] [14 Regression] " pinskia at gcc dot gnu.org
2024-02-22  9:20 ` [Bug tree-optimization/114027] [11/12/13/14 Regression] miscompile at `-O3 -fno-vect-cost-model -msse4.2` pinskia at gcc dot gnu.org
2024-02-22  9:26 ` jakub at gcc dot gnu.org
2024-02-22  9:37 ` rguenth at gcc dot gnu.org
2024-02-22  9:37 ` rguenth at gcc dot gnu.org
2024-02-22  9:37 ` rguenth at gcc dot gnu.org
2024-02-22  9:48 ` rguenth at gcc dot gnu.org
2024-02-22 12:14 ` cvs-commit at gcc dot gnu.org
2024-03-21 11:49 ` [Bug tree-optimization/114027] [11/12/13 " cvs-commit at gcc dot gnu.org
2024-03-26  7:39 ` [Bug tree-optimization/114027] [11/12 " chenglulu at loongson dot cn
2024-03-26  8:48 ` cvs-commit at gcc dot gnu.org
2024-03-26  8:48 ` cvs-commit at gcc dot gnu.org
2024-03-26  8:49 ` rguenth at gcc dot gnu.org
2024-05-16  9:56 ` cvs-commit at gcc dot gnu.org
2024-05-16  9:56 ` 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).