]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISC-V] Fix false positive from Wuninitialized
authorJeff Law <jlaw@ventanamicro.com>
Mon, 19 May 2025 18:00:56 +0000 (12:00 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Mon, 19 May 2025 18:00:56 +0000 (12:00 -0600)
commitcbc258cd318756db8b5f0e4055dd8f1c1d618d22
tree8bdd89125277b0c45f483c371b480ac333493746
parentbf98b735ae01c652f641b824a7c4e1d575b5b6d8
[RISC-V] Fix false positive from Wuninitialized

As Mark and I independently tripped, there's a Wuninitialized issue in the
RISC-V backend.  While *I* know the value would always be properly initialized,
it'd be somewhat painful to either eliminate the infeasible paths or do deep
enough analysis to suppress the false positive.

So this initializes OUTPUT and verifies it's got a reasonable value before
using it for the final copy into operands[0].

Bootstrapped on the BPI (regression testing still has ~12hrs to go).

gcc/
* config/riscv/riscv.cc (synthesize_ior_xor): Initialize OUTPUT and
verify it's non-null before emitting the final copy insn.
gcc/config/riscv/riscv.cc