diff options
author | Jeff Law <jlaw@ventanamicro.com> | 2024-12-30 13:51:55 -0700 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-12-30 13:53:12 -0700 |
commit | 07e532a0608640b9e57ae6fc3a0ca83c9afc75a1 (patch) | |
tree | 4d4276d70afd41ad66d973e3895675998f80bb3f /gcc/tree-ssa-ifcombine.cc | |
parent | efc0981077a70c4de4596f682c4aeade07ec2f17 (diff) | |
download | gcc-07e532a0608640b9e57ae6fc3a0ca83c9afc75a1.zip gcc-07e532a0608640b9e57ae6fc3a0ca83c9afc75a1.tar.gz gcc-07e532a0608640b9e57ae6fc3a0ca83c9afc75a1.tar.bz2 |
[RISC-V][PR target/106544] Avoid ICEs due to bogus asms
This is a fix for a bug Andrew P filed a while back where essentially a poorly
crafted asm statement could trigger a ICE during assembly output. Various
cases will use INTVAL (op) without verifying the operand is a CONST_INT node
first.
The usual way to handle this is via output_operand_lossage, which this patch
implements.
I focused primarily on the CONST_INT cases, there could well be other problems
in this space, if so they should get distinct bugs with testcases.
Tested in my tester on rv32 and rv64. Waiting for pre-commit testing before
moving forward.
PR target/106544
gcc/
* config/riscv/riscv.cc (riscv_print_operand): Issue an error for
invalid operands rather than invalidly accessing INTVAL of an
object that is not a CONST_INT. Fix one error string for 'N'.
gcc/testsuite
* gcc.target/riscv/pr106544.c: New test.
Diffstat (limited to 'gcc/tree-ssa-ifcombine.cc')
0 files changed, 0 insertions, 0 deletions