[Bug target/91635] wrong code at -O2 with __builtin_add_overflow() and shifts
wilson at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 5 20:33:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635
--- Comment #25 from Jim Wilson <wilson at gcc dot gnu.org> ---
Author: wilson
Date: Thu Sep 5 20:32:55 2019
New Revision: 275444
URL: https://gcc.gnu.org/viewcvs?rev=275444&root=gcc&view=rev
Log:
RISC-V: Fix bad insn splits with paradoxical subregs.
Shifting by more than the size of a SUBREG_REG doesn't work, so we either
need to disable splits if an input is paradoxical, or else we need to
generate a clean temporary for intermediate results.
Jakub wrote the first version of this patch, so gets primary credit for it.
gcc/
PR target/91635
* config/riscv/riscv.md (zero_extendsidi2, zero_extendhi<GPR:mode>2,
extend<SHORT:mode><SUPERQI:mode>2): Don't split if
paradoxical_subreg_p (operands[0]).
(*lshrsi3_zero_extend_3+1, *lshrsi3_zero_extend_3+2): Add clobber and
use as intermediate value.
gcc/testsuite/
PR target/91635
* gcc.c-torture/execute/pr91635.c: New test.
* gcc.target/riscv/shift-shift-4.c: New test.
* gcc.target/riscv/shift-shift-5.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr91635.c
trunk/gcc/testsuite/gcc.target/riscv/shift-shift-4.c
trunk/gcc/testsuite/gcc.target/riscv/shift-shift-5.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/riscv/riscv.md
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list