public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/114485] New: [14] Wrong code with -O3 -march=rv64gcv on riscv
@ 2024-03-26 14:54 patrick at rivosinc dot com
  2024-03-26 20:35 ` [Bug tree-optimization/114485] " pinskia at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-26 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114485
           Summary: [14] Wrong code with -O3 -march=rv64gcv on riscv
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Testcase:
int b, c = 8, d;
int e[23];
int main() {
  int *h = e;
  for (int i = 1; i < b + 21; i += 2) {
    c *= -1;
    d = h[i] ? i : 0;
  }
  __builtin_printf("%u\n", c);
}

Commands
> /scratch/tc-testing/tc-mar-25/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv -O3 red.c -o red.out
> /scratch/tc-testing/tc-mar-25/build-rv64gcv/bin/qemu-riscv64 red.out
4294967288
> /scratch/tc-testing/tc-mar-25/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv -O2 red.c -o red.out
> /scratch/tc-testing/tc-mar-25/build-rv64gcv/bin/qemu-riscv64 red.out
8

This is likely a duplicate of pr114476 (but this testcase does not require
-fwrapv).

Found via fuzzer

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

end of thread, other threads:[~2024-05-03 13:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 14:54 [Bug tree-optimization/114485] New: [14] Wrong code with -O3 -march=rv64gcv on riscv patrick at rivosinc dot com
2024-03-26 20:35 ` [Bug tree-optimization/114485] " pinskia at gcc dot gnu.org
2024-03-26 20:39 ` [Bug tree-optimization/114485] [13/14 Regression] Wrong code with -O3 -march=rv64gcv on riscv or `-O3 -march=armv9-a` for aarch64 pinskia at gcc dot gnu.org
2024-03-27  8:19 ` rguenth at gcc dot gnu.org
2024-03-27  8:19 ` rguenth at gcc dot gnu.org
2024-03-27 14:06 ` rdapp at gcc dot gnu.org
2024-03-27 21:03 ` pinskia at gcc dot gnu.org
2024-03-27 21:04 ` pinskia at gcc dot gnu.org
2024-03-27 21:06 ` pinskia at gcc dot gnu.org
2024-04-03 13:13 ` rguenth at gcc dot gnu.org
2024-04-04  7:52 ` rguenth at gcc dot gnu.org
2024-04-04  7:59 ` rguenth at gcc dot gnu.org
2024-04-04  8:04 ` rguenth at gcc dot gnu.org
2024-04-04 11:09 ` cvs-commit at gcc dot gnu.org
2024-04-04 11:10 ` [Bug tree-optimization/114485] [13 " rguenth at gcc dot gnu.org
2024-05-03 13:55 ` cvs-commit at gcc dot gnu.org
2024-05-03 13:58 ` rguenth 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).