[Bug target/116085] RISC-V: Miscompile at -O2 with zbb

2024-07-25 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116085 --- Comment #6 from Jeffrey A. Law --- So I think Philipp's code would work if it transformed the resulting min/max into a minu/maxu. And I think there's some room for improvement here. The core bug is that we're sign-extending the non-constan

[Bug target/116085] RISC-V: Miscompile at -O2 with zbb

2024-07-25 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116085 --- Comment #5 from Jeffrey A. Law --- Bisection landed on this change from 2022: commit 3142265dedd84c2f3dbf824f2d1b0c182e3c8b3c Author: Philipp Tomsich Date: Sun Oct 16 10:51:47 2022 +0200 RISC-V: No extensions for SImode min/max agai

[Bug target/116085] RISC-V: Miscompile at -O2 with zbb

2024-07-25 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116085 Jeffrey A. Law changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug target/116085] RISC-V: Miscompile at -O2 with zbb

2024-07-25 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116085 --- Comment #3 from Patrick O'Neill --- (In reply to Xi Ruoyao from comment #2) > Maybe add __attribute__((noipa)) for test() and merge the files. That worked, thanks! Testcase: int a = 2; unsigned b = 0x8000; int arr_5[2][23]; void test(i

[Bug target/116085] RISC-V: Miscompile at -O2 with zbb

2024-07-25 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116085 Xi Ruoyao changed: What|Removed |Added CC||xry111 at gcc dot gnu.org --- Comment #2 fr

[Bug target/116085] RISC-V: Miscompile at -O2 with zbb

2024-07-24 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116085 --- Comment #1 from Patrick O'Neill --- Tested using r15-2276-gd2fc64c8578